com.ibm.etools.sqltoxml
Class BaseProperties

java.lang.Object
  |
  +--com.ibm.etools.sqltoxml.BaseProperties
Direct 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

Constructor Summary
BaseProperties()
          The default constructor.
 
Method Summary
 java.lang.String getEncoding()
          Returns the Java style encoding value for the properties file.
 java.lang.String getEncodingTag()
          Returns the encoding value for the properties file to be written if store() is called.
 java.lang.String getJdbcDriver()
          Returns a JDBC driver name.
 java.lang.String getJdbcServer()
          Returns a JDBC server path.
 java.lang.String getLoginId()
          Returns a database user ID that has the appropriate privilege to perform the query.
 java.lang.String getPassword()
          Returns a password for the user ID that has the appropriate privilege to perform the query.
abstract  void load(java.io.InputStream stream)
          Loads database operation values from an InputStream.
abstract  void load(java.lang.String xstFilename)
          Loads database operation values from an external file.
 void setEncoding(java.lang.String enc)
          Sets the Java style encoding value for the properties file to be written if store() is called.
 void setEncodingTag(java.lang.String encTag)
          Sets the encoding value for the properties file to be written if store() is called.
 void setJdbcDriver(java.lang.String newJdbcDriver)
          Sets a JDBC driver name.
 void setJdbcServer(java.lang.String newJdbcServer)
          Sets a JDBC server path.
 void setLoginId(java.lang.String newLoginId)
          Sets a database user ID that has a privilege to perform the query.
 void setPassword(java.lang.String newPassword)
          Sets a password for the user ID that has a privilege to perform the query.
abstract  void store(java.lang.String xstFilename)
          Stores database operation information to an external file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseProperties

public BaseProperties()
The default constructor.
Method Detail

setEncoding

public void setEncoding(java.lang.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(java.lang.String), store(java.lang.String)

getEncoding

public java.lang.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(java.lang.String)

setEncodingTag

public void setEncodingTag(java.lang.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(java.lang.String), store(java.lang.String)

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(java.lang.String)

load

public abstract void load(java.lang.String xstFilename)
                   throws java.lang.Exception
Loads database operation values from an external file. The external file name uses the extension .xst.
Parameters:
xstFilename - The name of the external file.
Throws:
java.lang.Exception - Thrown when loading from a file fails.

load

public abstract void load(java.io.InputStream stream)
                   throws java.lang.Exception
Loads database operation values from an InputStream. The content of the InputStream is in the XML format equivalent to that of an external file with the .xst extension.
Parameters:
stream - java.io.InputStream Provides database operation information in an XML format.
Throws:
java.lang.Exception - Thrown when loading from an InputStream is failed.

store

public abstract void store(java.lang.String xstFilename)
                    throws java.lang.Exception
Stores database operation information to an external file. The external file name uses the extension .xst.
Parameters:
xstFilename - The name of the external file to be created
Throws:
java.lang.Exception - Thrown when storing to a file is failed.

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:hospital
 
where 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 the appropriate 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.

setJdbcDriver

public void setJdbcDriver(java.lang.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(java.lang.String newJdbcServer)
Sets a JDBC server path. An example form of the server argument is
   jdbc:db2:hospital
 
where hospital is a database name for the query.
Parameters:
newJdbcServer - A JDBC server name.

setLoginId

public void setLoginId(java.lang.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(java.lang.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.