Class com.ibm.etools.sqltoxml.QueryProperties
java.lang.Object com.ibm.etools.sqltoxml.BaseProperties | com.ibm.etools.sqltoxml.QueryPropertiespublic 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 .xst extension). Also, the information can be stored to a query file.
- See Also
- SQLToXML
Table 1. Constructor Index Constructor Description QueryProperties() The default constructor.
Table 2. Method Index Method Description String getEncoding() Returns the Java style encoding value for the properties file. String getEncodingTag() Returns the encoding value for the properties file to be written if store() is called. String getFormat() Returns a format option. String getJdbcDriver() Returns a JDBC driver name. String getJdbcServer() Returns a JDBC server path. String getLoginId() Returns a database user ID that has the appropriate privilege to perform the query. String getPassword() Returns a password for the user ID that has the appropriate privilege to perform the query. Boolean getRecurse() Returns a Boolean value indicating whether the queries should also be performed on the target tables when foreign key columns from the current query are found. String getStatement() Returns current SQL statement to be executed. Vector getVarTypes() Deprecated. Returns a sequence of substitution parameter types when used. void load(InputStream) Loads necessary query values from an InputStream. void load(String) Loads necessary query values from a query file. void setEncoding(String) Sets the Java style encoding value for the properties file to be written if store() is called. void setEncodingTag(String) Sets the encoding value for the properties file to be written if store() is called. void setFormat(String) Sets a format option. void setJdbcDriver(String) Sets a JDBC driver name. void setJdbcServer(String) Sets a JDBC server path. void setLoginId(String) Sets a database user ID that has a privilege to perform the query. void setPassword(String) Sets a password for the user ID that has a privilege to perform the query. void setRecurse(Boolean) Sets a Boolean value indicating whether the queries should also be performed on the target tables when foreign key columns are found from the current query. void setStatement(String) Sets current SQL statement. void setVarTypes(Vector) 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(String) Stores necessary query values to a query file.
Constructors
QueryProperties
public QueryProperties()The default constructor.
Methods
getEncoding
public String getEncoding()Returns the Java style encoding value for the properties file.
- Returns
- A Java style encoding value. For example, UTF8.
- See Also
- getEncodingTag
- store
getEncodingTag
public java.lang.String getEncodingTag()Returns the encoding value for the properties file to be written if store() is called.
- Returns
- An encoding value. For example, UTF-8.
- See Also
- getEncoding
- store
getFormat
public 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.
getJdbcDriver
public java.lang.String getJdbcDriver()Returns a JDBC driver name. An example form of the driver argument is:
COM.ibm.db2.jdbc.app.DB2Driver
- Returns
- A JDBC driver class name.
getJdbcServer
public java.lang.String getJdbcServer()Returns a JDBC server path. An example form of the server argument is:
jdbc:db2:hospitalwhere hospital is a database name for the query.
- Returns
- A JDBC server name.
getLoginId
public java.lang.String getLoginId()Returns a database user ID that has a privilege to perform the query.
- Returns
- A database user ID.
getPassword
public java.lang.String getPassword()Returns a password for the user ID that has the appropriate privilege to perform the query.
- Returns
- A password for the database user ID.
getRecurse
public Boolean getRecurse()Returns a Boolean value indicating whether the queries should also be performed on the target tables when foreign key columns are found from the current query.
- Returns
- A Boolean value.
getStatement
public 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 when used. 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.
load
public void load(InputStream stream) throws ExceptionLoads necessary query values from an InputStream. The content of the InputStream is in the XML format equivalent to that of a query file.
- Parameters
- stream - java.io.InputStream Provides query information in XML format.
- Throws
- Exception Thrown when loading from an InputStream fails.
- Overrides
- load in class BaseProperties
load
public void load(String xstFilename) throws ExceptionLoads necessary query values from a query file. The query file name uses an .xst extension.
- Parameters
- xstFilename - The name of the query file.
- Throws
- Exception Thrown when loading from a file fails.
- Overrides
- load in class BaseProperties
setEncoding
public void setEncoding(String enc)Sets the Java style encoding value for the properties file to be written if store() is called.
- Parameters
- enc - Java style encoding value. For example, UTF8.
- See Also
- setEncodingTag
- store
setEncodingTag
public void setEncodingTag(String encTag)Sets the encoding value for the properties file to be written if store() is called.
- Parameters
- encTag - An encoding value. For example, UTF-8.
- See Also
- setEncoding
- store
setFormat
public void setFormat(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.
setJdbcDriver
public void setJdbcDriver(String newJdbcDriver)Sets a JDBC driver name. An example form of the driver argument is:
COM.ibm.db2.jdbc.app.DB2Driver
- Parameters
- newJdbcDriver - A JDBC driver class name.
setJdbcServer
public void setJdbcServer(String newJdbcServer)Sets a JDBC server path. An example form of the server argument is:
jdbc:db2:hospitalwhere hospital is a database name for the query.
- Parameters
- newJdbcServer - A JDBC server name.
setLoginId
public void setLoginId(String newLoginId)Sets a database user ID that has a privilege to perform the query.
- Parameters
- newLoginId - A database user ID.
setPassword
public void setPassword(String newPassword)Sets a password for the user ID that has a privilege to perform the query.
- Parameters
- newPassword - A password for the database user ID.
setRecurse
public void setRecurse(Boolean newRecurse)Sets a Boolean value indicating whether the queries should also be performed on the target tables when foreign key columns are found from the current query.
- Parameters
- newRecurse - A Boolean value that determines whether new queries should be performed for the foreign key columns.
setStatement
public void setStatement(String newStatement)Sets current SQL statement.
- Parameters
- newStatement - A SQL statement. If newStatement is invalid, it throws an SQL exception (with an explanation) when one of the execute() methods is called
setVarTypes
public void setVarTypes(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.
store
public void store(String xstFilename) throws ExceptionStores necessary query values to a query file. The query file name uses an .xst extension.
- Parameters
- xstFilename - The name of the query file to be created.
- Throws
- Exception Thrown when loading storing to a file fails.
- Overrides
- store in class BaseProperties
Related reference
Class com.ibm.etools.sqltoxml.SQLToXML
Class com.ibm.etools.sqltoxml.BaseProperties