com.ibm.etools.xmltosql
Class SQLProperties

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

public final class SQLProperties
extends BaseProperties

This class is used to provide data necessary for XMLToSQL to update database tables. An instance of this class is used as an argument to the XMLToSQL constructor.


Field Summary
static java.lang.String DELETE
          SQL DELETE action type.
static java.lang.String INSERT
          SQL INSERT action type.
static java.lang.String UPDATE
          SQL UPDATE action type.
 
Constructor Summary
SQLProperties()
          The default constructor.
 
Method Summary
 java.lang.String getAction()
          Returns the action to be performed by XMLToSQL
 java.lang.String getSchema()
          Returns the schema name.
 void load(java.io.InputStream stream)
          Loads necessary database manipulation values from an InputStream.
 void load(java.lang.String xstFilename)
          Loads necessary database manipulation values from an external file.
 void setAction(java.lang.String type)
          Sets the action to be performed by XMLToSQL.
 void setSchema(java.lang.String schemaName)
          Sets the schema name if required.
 void store(java.lang.String xstFilename)
          Stores database manipulation values to an external 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
 

Field Detail

INSERT

public static final java.lang.String INSERT
SQL INSERT action type. New rows are added to the table

UPDATE

public static final java.lang.String UPDATE
SQL UPDATE action type. Existing rows are updated

DELETE

public static final java.lang.String DELETE
SQL DELETE action type. Existing rows are deleted
Constructor Detail

SQLProperties

public SQLProperties()
The default constructor.
Method Detail

setAction

public void setAction(java.lang.String type)
Sets the action to be performed by XMLToSQL. The actions include:
   SQLProperties.INSERT : New rows are added to the table from the
                          XML document.
   SQLProperties.UPDATE : Existing rows are updated from the
                          XML document. 
   SQLProperties.DELETE : Existing rows are deleted based on the XML
                          document.
 
Parameters:
type - SQLProperties.INSERT, SQLProperties.UPDATE, or SQLProperties.DELETE

getAction

public java.lang.String getAction()
Returns the action to be performed by XMLToSQL
Returns:
Either SQLProperties.INSERT or SQLProperties.UPDATE
See Also:
setAction(java.lang.String)

setSchema

public void setSchema(java.lang.String schemaName)
Sets the schema name if required. MySQL does not use the schema name for instance. This is used to build up a table name for SQL execution. For example,
 UPDATE schemaName.tableName SET ...
 
Parameters:
schemaName - Schema name of the table

getSchema

public java.lang.String getSchema()
Returns the schema name.
Returns:
The schema name of the table
See Also:
setSchema(java.lang.String)

load

public void load(java.lang.String xstFilename)
          throws java.lang.Exception
Loads necessary database manipulation values from an external file.
Overrides:
load in class BaseProperties
Parameters:
xstFilename - The name of the properties file.
Throws:
java.lang.Exception - Thrown when loading from a file is failed.

load

public void load(java.io.InputStream stream)
          throws java.lang.Exception
Loads necessary database manipulation 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.
Overrides:
load in class BaseProperties
Parameters:
stream - java.io.InputStream Provides necessary property values in an XML format.
Throws:
java.lang.Exception - Thrown when loading from an InputStream fails.

store

public void store(java.lang.String xstFilename)
           throws java.lang.Exception
Stores database manipulation values to an external file.
Overrides:
store in class BaseProperties
Parameters:
xstFilename - The name of the external file to be created
Throws:
java.lang.Exception - Thrown when storing to a file fails.