com.ibm.etools.sqltoxml
Class QueryProperties

java.lang.Object
  |
  +--com.ibm.etools.sqltoxml.BaseProperties
        |
        +--com.ibm.etools.sqltoxml.QueryProperties

public final class QueryProperties
extends BaseProperties

This class provides information necessary for SQLToXML to perform its SQL query and generate an XML file as well as several other artifacts. The information can be either set manually or loaded from a query file (which usually has an extension .xst). Also, the information can be stored to a query file.

See Also:
SQLToXML

Constructor Summary
QueryProperties()
          The default constructor.
 
Method Summary
 java.lang.String getFormat()
          Returns a format option.
 boolean getRecurse()
          Returns a boolean value indicating whether or not the queries should also be performed on the target tables when foreign key columns from the current query are found.
 java.lang.String getStatement()
          Returns current SQL statement to be executed.
 java.util.Vector getVarTypes()
          Deprecated. Returns a sequence of substitution parameter types. VarTypes are used when a SQL statement contains substitution parameters, such as '?', and the user wants to indicate the data types for those parameters explicitly.
 void load(java.io.InputStream stream)
          Loads necessary query values from an InputStream.
 void load(java.lang.String xstFilename)
          Loads necessary query values from a query file.
 void setFormat(java.lang.String newFormat)
          Sets a format option.
 void setRecurse(boolean newRecurse)
          Sets a boolean value indicating whether or not the queries should also be performed on the target tables when foreign key columns from the current query are found.
 void setStatement(java.lang.String newStatement)
          Sets current SQL statement.
 void setVarTypes(java.util.Vector types)
          Deprecated. VarTypes are used when a SQL statement contains substitution parameters, such as '?', and the user wants to indicate the data types for those parameters explicitly.
 void store(java.lang.String xstFilename)
          Stores necessary query values to a query file.
 
Methods inherited from class com.ibm.etools.sqltoxml.BaseProperties
getEncoding, getEncodingTag, getJdbcDriver, getJdbcServer, getLoginId, getPassword, setEncoding, setEncodingTag, setJdbcDriver, setJdbcServer, setLoginId, setPassword
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryProperties

public QueryProperties()
The default constructor.
Method Detail

load

public void load(java.lang.String xstFilename)
          throws java.lang.Exception
Loads necessary query values from a query file. The query file name uses the extension .xst.
Overrides:
load in class BaseProperties
Parameters:
xstFilename - The name of the query file.
Throws:
java.lang.Exception - Thrown when loading from a file fails.

load

public void load(java.io.InputStream stream)
          throws java.lang.Exception
Loads necessary query values from an InputStream. The content of the InputStream is in the XML format equivalent to that of a query file.
Overrides:
load in class BaseProperties
Parameters:
stream - java.io.InputStream Provides query information in XML format.
Throws:
java.lang.Exception - Thrown when loading from an InputStream is failed.

store

public void store(java.lang.String xstFilename)
           throws java.lang.Exception
Stores necessary query values to a query file. The query file name uses the extension .xst.
Overrides:
store in class BaseProperties
Parameters:
xstFilename - The name of the query file to be created
Throws:
java.lang.Exception - Thrown when storing to a file is failed.

getFormat

public java.lang.String getFormat()
Returns a format option. Available output formats are
   SQLGenerateOptions.GENERATE_AS_ELEMENTS,
   SQLGenerateOptions.GENERATE_AS_ATTRIBUTES,
   SQLGenerateOptions.GENERATE_PRIMARYKEYS_AS_ATTRIBUTES, and
   SQLGenerateOptions.GENERATE_ID_AND_IDREF
 
Returns:
A format option for the query result.

getRecurse

public boolean getRecurse()
Returns a boolean value indicating whether or not the queries should also be performed on the target tables when foreign key columns from the current query are found.
Returns:
A boolean value to determine whether or not new queries should be performed for the foreign key columns.

getStatement

public java.lang.String getStatement()
Returns current SQL statement to be executed.
Returns:
Current SQL statement.

getVarTypes

public java.util.Vector getVarTypes()
Deprecated. Returns a sequence of substitution parameter types. VarTypes are used when a SQL statement contains substitution parameters, such as '?', and the user wants to indicate the data types for those parameters explicitly.

Returns:
A Vector containing data types for substitution parameters.

setFormat

public void setFormat(java.lang.String newFormat)
Sets a format option. Available output formats are
   GENERATE_AS_ELEMENTS,
   GENERATE_AS_ATTRIBUTES,
   GENERATE_PRIMARYKEYS_AS_ATTRIBUTES, and
   GENERATE_ID_AND_IDREF
 
Parameters:
newFormat - A format option for the query result.

setRecurse

public void setRecurse(boolean newRecurse)
Sets a boolean value indicating whether or not the queries should also be performed on the target tables when foreign key columns from the current query are found.
Parameters:
newRecurse - A boolean value to determine whether or not new queries should be performed for the foreign key columns.

setStatement

public void setStatement(java.lang.String newStatement)
Sets current SQL statement.
Parameters:
newStatement - A SQL statement.

setVarTypes

public void setVarTypes(java.util.Vector types)
Deprecated. VarTypes are used when a SQL statement contains substitution parameters, such as '?', and the user wants to indicate the data types for those parameters explicitly.

Parameters:
types - A Vector containing data types for substitution parameters.