Class com.ibm.etools.xmltosql.SQLProperties
java.lang.Object com.ibm.etools.sqltoxml.BaseProperties com.ibm.etools.xmltosql.SQLPropertiespublic 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.
Table 1. Field Index Field Description DELETE SQL DELETE action type. INSERT SQL INSERT action type. UPDATE SQL UPDATE action type.
Table 2. Constructor Index Constructor Description SQLProperties() The default constructor.
Table 3. Method Index Method Description String getAction() Returns the action to be performed by XMLToSQL. String getSchema() Returns the schema name. void load(InputStream) Loads necessary database manipulation values from an InputStream. void load(String) Loads necessary database manipulation values from an external file. void setAction(String) Sets the action to be performed by XMLToSQL: void setSchema(String) Sets the schema name if required. void store (String) Stores database manipulation values to an external file.
Fields
DELETE
public static final java.lang.String DELETESQL DELETE action type. Existing rows are deleted
INSERT
public static final java.lang.String INSERTSQL INSERT action type. New rows are added to the table
UPDATE
public static final java.lang.String UPDATESQL UPDATE action type. Existing rows are updated
Constructors
SQLProperties
public SQLProperties()The default constructor.
Methods
getAction
public String getAction()Returns the action to be performed by XMLToSQL
- Returns
- Either SQLProperties.INSERT or SQLProperties.UPDATE
- See Also
- setAction
getSchema
public String getSchema()Returns the schema name.
- Returns
- The schema name of the table
- See Also
- setSchema
load
public void load(InputStream stream) throws ExceptionLoads necessary property 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 necessary property values 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 property values from an external file.
- Parameters
- xstFilename - The name of the property file.
- Throws
- Exception Thrown when loading from a file fails.
- Overrides
- load in class BaseProperties
setAction
public void setAction(String type)Sets the action to be performed by XMLToSQL:
SQLProperties.INSERT : New rows are added to the table from the XML contents. SQLProperties.UPDATE : Existing rows are updated from the XML contents. At least one of the column elements should map to a primary key column. SQLProperties.DELETE : Existing rows are deleted based on the XML document.
- Parameters
- type - Either SQLProperties.INSERT or SQLProperties.UPDATE or SQLProperties.DELETE
setSchema
public void setSchema(String schemaName)Sets the schema name if required. 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
store
public void store(String xstFilename) throws ExceptionThis method is used for internal testing purposes only. Stores property values to an external file.
- Parameters
- xstFilename - The name of the external file to be created
- Throws
- Exception Thrown when storing to a file fails.
- Overrides
- store in class BaseProperties
Related tasks
Updating tables using the XMLToSQL class
Related reference
Class com.ibm.etools.xmltosql.XMLToSQL
Class com.ibm.etools.sqltoxml.BaseProperties
Class com.ibm.etools.sqltoxml.SQLToXML