Class com.ibm.etools.sqltoxml.BaseProperties
java.lang.Object com.ibm.etools.sqltoxml.BasePropertiesDirect Known Subclasses:
QueryProperties, SQLProperties
public abstract class BaseProperties
extends java.lang.Object
This class provides database connection information for SQL and XML. The database connection information can be either set manually or loaded from an external file (which usually has the extension .xst). The database connection information can also be stored in an external file with the extension .xst.
- See Also
- QueryProperties, SQLProperties
Table 1. Constructor Index Constructor Description BaseProperties() 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 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. void load(InputStream) Loads database operation values from an InputStream. void load(String) Loads database operation values from an external 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 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 store(String) Stores database operation information to an external file.
Constructors
BaseProperties
public BaseProperties()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
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.
load
public void load(InputStream stream) throws ExceptionLoads database operation 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.
load
public void load(String xstFilename) throws ExceptionLoads necessary query values from an external file. The external file name uses an extension .xst.
- Parameters
- xstFilename - The name of the external file.
- Throws
- Exception Thrown when loading from a file fails.
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
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. The ID can be any string value that a database takes since the ID is used for logging into a database.
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. The password is used for logging into a database, so the password can be any string value that a database takes.
store
public void store(String xstFilename) throws ExceptionStores necessary query values to an external file. The external file name uses an extension .xst.
- Parameters
- xstFilename - The name of the external file to be created.
- Throws
- Exception Thrown when storing to a file fails.
Related reference
Class com.ibm.etools.sqltoxml.QueryProperties
Class com.ibm.etools.xmltosql.SQLProperties