Class com.ibm.etools.xmltosql.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.

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 DELETE

SQL DELETE action type. Existing rows are deleted

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

 

Constructors

SQLProperties

public SQLProperties()

The default constructor.

 

Methods

getAction

public String getAction()

Returns the action to be performed by XMLToSQL

getSchema

public String getSchema()

Returns the schema name.

load

public void load(InputStream stream) throws Exception

Loads 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.

load

public void load(String xstFilename) throws Exception

Loads necessary property values from an external file.

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.

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 ...

store

public void store(String xstFilename) throws Exception

This method is used for internal testing purposes only. Stores property values to an external file.

 

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