com.hitsw.xml.databinding
Interface XMLRecordset

All Superinterfaces:
XMLColumnInfo, XMLConnectionInfo

public interface XMLRecordset
extends XMLColumnInfo, XMLConnectionInfo

The XMLRecordset interface is the collection of all methods that refer to a recordset. This interface is the main entry point into the jAllora product functionality. The types of operations you can perform using jAllora are:

Use XMLRecordsetBuilder.newInstance to create a XMLRecordset object.

Most methods in XMLRecordset are available if you are writing a jAllora client application that uses the jAllora Web Service. Check the explanation for each method to see if the method can be used via the jAllora Web Service.



Copyright (C) 2001-2004 by HiT Software, Inc. All rights reserved.


Field Summary
static int ALL_RECORDS
          Indicates that there is no limit set on the number of records to retrieve and that all records will be retrieved during marshalling processes.
static int CREATE_TABLE_KEYS
          Enables the creation of keys when tables are created in an unmarshal process.
static int CREATE_TABLE_RELATIONS
          Enables the creation of keys and foreign keys when tables are created in an unmarshal process.
static int DISABLE_RECORD_VALIDATION
          When set, performs schema validation of the whole output document at the end of the marshal process.
static int ENABLE_UPDATE_ON_INSERT
          Enables update of existing records during an unmarshal operation.
static int IGNORE_XMLSCHEMA_DATATYPES
          When set, the marshal process ignores the XML schema data types.
static int SPLIT_OUTPUTXML_FILE
          Enables the split of the output XML into many files, one for each child of the root element.
static int TRANSACTION_NONE
          JDBC SQL transaction isolation level indicating that transactions are not supported.
static int TRANSACTION_READ_COMMITTED
          A JDBC SQL transaction isolation level indicating that dirty reads are prevented and that non-repeatable reads and phantom reads can occur.
static int TRANSACTION_READ_UNCOMMITTED
          A JDBC SQL transaction isolation level indicating that dirty reads, non-repeatable reads and phantom reads can occur.
static int TRANSACTION_REPEATABLE_READ
          A JDBC SQL transaction isolation level indicating that dirty reads and non-repeatable reads are prevented and that phantom reads can occur.
static int TRANSACTION_SERIALIZABLE
          A JDBC SQL transaction isolation level indicating that dirty reads, non-repeatable reads and phantom reads are prevented.
static int UNIQUE_CACHE
          When set, the corresponding field value will be used in computing a hash value for the record.
static int UNIQUE_DBMS
          When set, the corresponding field value will be tested for unicity against the database (together with all the other fields under this constraint in the same database table) using a SQL SELECT statement.
static int UNIQUE_NONE
          The default, no unicity constraints are derived from the column this value is used with.
static int USE_AUTOINCREMENT
          Specifies whether auto-incremental fields specified in the mapping file or retrieved from the database should be used in the unmarshal process.
static int USE_ISO_TIMESTAMP_FORMAT
          Sets the use the ISO8601 format "yyyy:mm:ddThh:mm:ss.n" for timestamp data in the output XML of a marshal operation.
static int USE_NO_INDENT
          Disables the indenting done while marshalling to a character stream.
static int USE_NO_UNICITY
          Disables the unicity features with this option.
static int USE_ONE_TO_MANY_UNCOMBINE_METHOD
          When enabled, uses a one-to-many approach to resolve an XML input file containing nodes aggregated under a single occurrence of a parent node (combined node) during unmarshalling.
static int USE_SELECT_DISTINCT
          When this option is set the select statement generated by the marshal process include the DISTINCT clause.
static int USE_SORT_COMBINE
          Enables the combining and sorting performed while marshalling a recordset with a mapping definition that includes combine and sort settings.
static int USE_STRICTMATCH
          Deprecated.  
 
Fields inherited from interface com.hitsw.xml.databinding.XMLColumnInfo
NOT_NULLABLE, NULLABLE, NULLABLE_UNKNOWN
 
Method Summary
 void beginTrans_UnitOfWork(int isolation)
          Starts a transaction for a unit of work by setting the specified isolation level.
 void beginTrans(int isolation)
          Starts a transaction by setting the specified isolation level.
 void build()
          Generates classes for data binding.
 void build(java.lang.String inputString)
          Generates classes for data binding.
 void clearOption(int option)
          Clears one option at a time.
 void close_UnitOfWork()
          Closes a previously opened unit of work and disconnects from the database.
 void close()
          Closes a previously opened recordset and disconnects from the database.
 void commitTrans_UnitOfWork()
          Commits all the changes of the current unit of work transaction to the database.
 void commitTrans()
          Commits all the changes of the current transaction to the database.
 void deleteInstance()
          It is advisable to call this method to release database connections and the recordset's related implementation objects.
 com.hitsw.xml.databinding.XMLColumnInfo getColumnInfo()
          Retrieves the XMLColumnInfo object describing the columns of an opened recordset.
 com.hitsw.xml.databinding.XMLColumnValues getColumnValues()
          Retrieves the values for the current XMLRecord during marshalling.
 java.sql.Connection getConnection()
          Retrieves the JDBC Connection object used internally by the XMLRecordset to update or query the database during a marshal or unmarshal operation.
 com.hitsw.xml.databinding.XMLConnectionInfo getConnectionInfo()
          Retrieves information about the connection properties of the current recordset.
 org.w3c.dom.Document getDOMDocument()
          Returns a DOM document containing DOM nodes resulting from a marshalling operation where a DOM document has been set using setDOM.
 java.lang.String getEmptyStringValue()
          Returns the value used to represent an empty string in a character data type column, see setEmptyStringValue.
 com.hitsw.xml.databinding.XMLSchemaMapper getMapping()
          Gets the XMLSchemaMapper object previously set with setMapping.
 java.lang.String getNullValue()
          Returns the value used to represent a null value in an XML document, see setNullValue.
 int getOptions()
          Retrieves the combined value of all options.
 org.w3c.dom.Element getRecordsetElement()
          Returns a DOM document element resulting from a marshalling operation where a DOM document has been set using setDOM.
 java.lang.String[][] getSkipEntityInInputXML()
          Retrieves the list of public and system identifiers that are currently set on the recordset and that identify the entity that shouldn't be resolve while parsing an inputXML.
 boolean isOptionSet(int option)
          Checks whether an option is in use.
 void marshal()
          Starts the marshalling process to an XML output stream determined by the setOutputXML or setDOM methods.
 void marshal(java.io.OutputStream outputStream)
          Deprecated. use setOutputXML or setOutputXML_JMS, and marshal() instead.
 void marshal(java.io.OutputStream outputStream, java.lang.String encoding)
          Deprecated. use setOutputXML or setOutputXML_JMS, and marshal() instead.
 void marshal(java.io.Writer writer)
          Deprecated. use setOutputXML or setOutputXML_JMS, and marshal() instead.
 void marshalEnd()
          Completes marshalling by generating final characters to produce valid XML documents.
 void marshalOVLT(java.lang.String inputString, java.lang.String logFileName)
          Performs an optimized marshalXMLStream using multiple queries to resolve the mapping.
 void marshalXMLStream()
          Given a table name or an SQL query specified using the setTable or setQuery methods, or a mapping file specified using the setMapping method marshals the recordset to the XML stream previously set using setOutputXML, setOutputXML_JMS or setDOM.
 void marshalXMLStream(java.lang.String inputString)
          Given a table name, a SQL query or a mapping file, marshals the recordset to an XML stream.
 com.hitsw.xml.databinding.XMLRecord newRecord()
          Creates a new XMLRecord based on the specified mapping or default XML schema.
 com.hitsw.xml.databinding.XMLRecord nextRecord()
          While marshalling, it fetches the next record from the database and builds an XMLRecord based on the specified mapping or defaulf XMLSchema (see marshal for more details).
 com.hitsw.xml.databinding.XMLRecord[] nextRecords(int n)
          While marshalling, it fetches the next n records from the database and builds an array of records based on the specified mapping or default XML schema (see marshal for more details).
 void open_UnitOfWork()
          Opens a unit of work.
 void open_UnitOfWork(int isolation)
          Opens a unit of work, as described in open_UnitOfWork, and starts a transaction using the specified isolation level (see beginTrans_UnitOfWork(int) beginTrans_UnitOfWork).
 void open_UnitOfWork(java.lang.String inputString)
          Opens a unit of work.
 void open_UnitOfWork(java.lang.String inputString, int isolation)
          Opens a unit of work, as described in open_UnitOfWork, and starts a transaction using the specified isolation level (see beginTrans_UnitOfWork(int) beginTrans_UnitOfWork).
 void open()
          Opens a recordset by connecting to the database and executing a SQL SELECT statement.
 void open(int isolation)
          Opens a recordset by connecting to the database using the specified isolation level and executing a SQL SELECT statement.
 void open(java.lang.String inputString)
          Opens a recordset by connecting to the database and executing a SQL SELECT statement.
 void open(java.lang.String inputString, int isolation)
          Opens a recordset by connecting to the database using the specified isolation level and executing a SQL SELECT statement.
 void rollbackTrans_UnitOfWork()
          Rolls back all the changes of the current transaction to the database.
 void rollbackTrans()
          Rolls back all the changes of the current transaction to the database.
 void runXQuery(java.lang.String xquery, boolean useDBPredicates, boolean useFullMapping)
          Execute the specified XQuery
 org.w3c.dom.Element sendUpdategram(org.w3c.dom.Element updategram)
          Deprecated. use sendUpdategram(Element, int) instead.
 com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(org.w3c.dom.Element updategram, int isolation)
          Executes an updategram, translating the updategram DOM document into database inserts, updates and deletes.
 org.w3c.dom.Element sendUpdategram(org.w3c.dom.Element updategram, java.util.Map params)
          Deprecated. use sendUpdategram(Element, Map, int) instead.
 com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(org.w3c.dom.Element updategram, java.util.Map params, int isolation)
          Executes an updategram, translating the updategram DOM document into database inserts, updates and deletes.
 com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(java.lang.String updategram, int isolation)
          Executes an updategram translating the XML updategram file into database inserts, updates and deletes.
 com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(java.lang.String updategram, java.util.Map params, int isolation)
          Executes an updategram translating the XML updategram file into database inserts, updates and deletes.
 void setBlockInsertSize(int size)
          Specifies the number of records buffered during an unmarshal operation before performing the actual insert on the database.
 void setBuildPath(java.lang.String buildPath)
          Specifies the path to use when creating databinding classes using the build methods.
 void setClassName(java.lang.String className)
          Specifies the class name to use when creating databinding classes using the build methods.
 void setColumnUnicity(int index, int mode)
          Sets a unicity constraint on a recordset column.
 void setConnection(java.sql.Connection conn)
          This method is used to execute a marshal or unmarshal operation using an opened JDBC connection.
 void setConnectionLinger(int linger)
          Enables a form of connection pooling where a connection lingers for a number of milliseconds after being closed.
 org.w3c.dom.Document setDOM(org.w3c.dom.Document document)
          Generates a DOM tree when marshalling data.
 org.w3c.dom.Document setDOM(java.lang.String parserFactoryName)
          Generates a DOM tree when marshalling data.
 void setEmptyStringValue(java.lang.String emptyStringValue)
          Sets a value that represents an empty string for a character database column.
 void setEncoding(java.lang.String encoding)
          Specifies the encoding to use when marshalling, unmarshalling, or reading XSL files.
 void setHttpPassword(java.lang.String httpPassword)
          Specifies the password to use in connecting to inputXML, outputXML or inputXSL when they are URLs.
 void setHttpUser(java.lang.String httpUser)
          Specifies the user to use in connecting to inputXML, outputXML or inputXSL when they are URLs.
 void setInputXML_JMS(java.lang.String factoryName, java.lang.String queueName)
          Specifies the queue connection factory name and the queue name from from which to read an XML document for unmarshalling.
 void setInputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms)
          Specifies the XMLJMS object (connected to a queue) from which to read a XML document for unmarshalling.
 void setInputXML(java.io.InputStream inputStream)
          Specifies the input stream from which to read XML data for unmarshalling.
 void setInputXML(java.io.InputStream inputStream, java.lang.String encoding)
          Specifies the input stream from which to read XML data for unmarshalling.
 void setInputXML(java.io.Reader reader)
          Specifies the Reader from which to read the input XML data for unmarshalling.
 void setInputXML(java.lang.String inputXML)
          Specifies the input file from which to read XML data for unmarshalling.
 void setInputXMLSystemId(java.lang.String systemId)
          Sets the system identifier for the stream passed to setInputXML or for the inputXML file specified in the inputString of the unmarshalXMLStream or unmarshal methods.
 void setInputXSL(java.io.InputStream inputStream)
          Specifies the input stream from which to read an XSL document to use for XSLT transformations.
 void setInputXSL(java.io.InputStream inputStream, java.lang.String encoding)
          Specifies the input stream from which to read an XSL document to use for XSLT transformations.
 void setInputXSL(java.io.Reader reader)
          Specifies the Reader from which to read an XSL document to use for XSLT transformations.
 void setInputXSL(java.lang.String inputXSL)
          Specifies the input file from which to read an XSL document to use for XSLT transformations.
 void setLocale(java.util.Locale locale)
          Allows you to change the locale used when marshalling or unmarshalling numeric, date or time types.
 void setMapping(com.hitsw.xml.databinding.XMLSchemaMapper xmlMap)
          Sets an XMLSchemaMapper object for use in marshalling and unmarshalling operations.
 void setMaxRecords(int maxRecords)
          Specifies the maximum number of records for a marshal operation.
 void setNullValue(java.lang.String nullValue)
          Sets a value that represents a null value in an XML document.
 void setOption(int option)
          Sets a single option.
 void setOptions(int options)
          Sets one or more options in a single call.
 void setOutputXML_JMS(java.lang.String factoryName, java.lang.String queueName)
          Specifies the queue connection factory name and the queue name where the result of a marshal process will be posted.
 void setOutputXML_JMS(java.lang.String factoryName, java.lang.String queueName, java.lang.String encoding)
          Specifies the queue connection factory name and the queue name where the result of a marshal process will be posted.
 void setOutputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms)
          Specifies the XMLJMS object that will be used to post the the results of the marshal process to the queue.
 void setOutputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms, java.lang.String encoding)
          Specifies the XMLJMS object that will be used to post the the results of the marshal process to the queue.
 java.io.Writer setOutputXML(java.io.OutputStream outputStream)
          Specifies the output stream for XML data while marshalling.
 java.io.Writer setOutputXML(java.io.OutputStream outputStream, java.lang.String encoding)
          Specifies the output stream for XML data while marshalling.
 void setOutputXML(java.lang.String outputXML)
          Specifies the output file for XML data while marshalling.
 void setOutputXML(java.lang.String outputXML, java.util.List outputFileNames)
          Specifies the marshal output XML file and retrieves a list of all the file names generated during the marshal process.
 java.io.Writer setOutputXML(java.io.Writer writer)
          Specifies the Writer object for XML data output while marshalling.
 void setPackageName(java.lang.String packageName)
          Specifies the package name to use when creating databinding classes using the build methods.
 void setPassword_JMS(java.lang.String password)
          Sets the JMS password to be used in connecting to the JMS provider.
 void setPassword(java.lang.String password)
          Specifies the password to use in connecting to a database.
 void setProvider(java.lang.String provider)
          Specifies the JDBC provider that will be used for marshalling or unmarshalling.
 void setQuery(java.lang.String query)
          Specifies a SQL query for a marshal process.
 void setRootName(java.lang.String rootName)
          Specifies the name of the top level element added to the marshal output XML.
 void setSchema(java.lang.String schema)
          Specifies the name of a W3C XML Schema file that will be used to validate an unmarshal input XML document or a marshal output XML document.
 void setTable(java.lang.String table)
          Specifies a database table name when marshalling or unmarshalling using the default schema.
 void setUrl(java.lang.String url)
          Specifies the URL to use when connecting to a database using a JDBC provider class.
 void setUser_JMS(java.lang.String username)
          Sets the JMS user name to be used in connecting to the JMS provider.
 void setUser(java.lang.String user)
          Specifies the user to use connecting to a database.
 void showDTD(boolean show)
          Requests the inclusion of a DTD in the XML output document after marshalling using the default schema.
 void showXMLSchema(boolean show)
          Requests the inclusion of a W3C schema in the XML ouptut document after marshalling using the default schema.
 void skipEntityInInputXML(java.lang.String publicId, java.lang.String systemId)
          This method allow to specify the external entities that shouldn't be resolved while parsing the inputXML file.
 void unmarshal()
          Starts the import of an XML document into a database.
 void unmarshal(java.io.InputStream inputStream)
          Deprecated. use setInputXML or setInputXML_JMS, and unmarshal() instead.
 void unmarshal(java.io.Reader reader)
          Deprecated. use setInputXML or setInputXML_JMS, and unmarshal() instead.
 void unmarshal(java.lang.String inputString)
          Starts the import of an XML document into a database.
 void unmarshalOVLT(java.lang.String inputString, java.lang.String logFileName)
          Performs an optimized unmarshalXMLStream.
 void unmarshalOVLTToCSV(java.lang.String inputString, java.lang.String logFileName, boolean gerateOracleCtrlFile)
          Performs an optimized unmarshalXMLStream to a CSV file.
 com.hitsw.xml.databinding.XMLRecord unmarshalRecord()
          Deprecated. use nextRecord instead
 void unmarshalXMLStream()
          Imports an XML document into a database.
 void unmarshalXMLStream(java.io.InputStream inputStream)
          Deprecated. use setInputXML and unmarshalXMLStream() instead.
 void unmarshalXMLStream(java.lang.String inputString)
          Imports an XML document into a database using an input string for database and XML data parameters.
 void unmarshalXMLStream(java.lang.String inputString, com.hitsw.xml.jms.XMLListener xmlListener)
          Works exactly like unmarshalXMLStream(String inputString), except that an XMLListener is handling asynchronous receives from a queue.
 void unmarshalXMLStream(com.hitsw.xml.jms.XMLListener xmlListener)
          Works exactly like unmarshalXMLStream() except that an XMLListener is handling asynchronous receives from a queue.
 boolean writeDocument(java.io.Writer writer, boolean indent)
          Outputs the recordset's DOM document to a writer.
 
Methods inherited from interface com.hitsw.xml.databinding.XMLColumnInfo
getColumnAliasName, getColumnIndex, getColumnIndex, getColumnInfo, getColumnKeyOrdinalPosition, getColumnLength, getColumnName, getColumnNullable, getColumnPrecision, getColumnScale, getColumnTableName, getColumnType, getColumnTypeName, getColumnUnicity, getNumColumns, getRestriction, getSchemaDataType
 
Methods inherited from interface com.hitsw.xml.databinding.XMLConnectionInfo
getConnectionLinger, getMaxRecords, getPassword, getProvider, getQuery, getTable, getUrl, getUser
 

Field Detail

TRANSACTION_NONE

public static final int TRANSACTION_NONE
JDBC SQL transaction isolation level indicating that transactions are not supported. This is the default isolation level for XMLRecordset indicating that no transactions are used. The JDBC connection is set in autocommit mode and commit/rollback methods are not supported by the XMLRecordset.

See Also:
Constant Field Values

TRANSACTION_READ_COMMITTED

public static final int TRANSACTION_READ_COMMITTED
A JDBC SQL transaction isolation level indicating that dirty reads are prevented and that non-repeatable reads and phantom reads can occur.

See Also:
Constant Field Values

TRANSACTION_READ_UNCOMMITTED

public static final int TRANSACTION_READ_UNCOMMITTED
A JDBC SQL transaction isolation level indicating that dirty reads, non-repeatable reads and phantom reads can occur.

See Also:
Constant Field Values

TRANSACTION_REPEATABLE_READ

public static final int TRANSACTION_REPEATABLE_READ
A JDBC SQL transaction isolation level indicating that dirty reads and non-repeatable reads are prevented and that phantom reads can occur.

See Also:
Constant Field Values

TRANSACTION_SERIALIZABLE

public static final int TRANSACTION_SERIALIZABLE
A JDBC SQL transaction isolation level indicating that dirty reads, non-repeatable reads and phantom reads are prevented.

See Also:
Constant Field Values

USE_AUTOINCREMENT

public static final int USE_AUTOINCREMENT
Specifies whether auto-incremental fields specified in the mapping file or retrieved from the database should be used in the unmarshal process. If the option is disabled, the auto-incremental fields will be ignored. This option is disabled by default.

See Also:
Constant Field Values

USE_STRICTMATCH

public static final int USE_STRICTMATCH
Deprecated.  

Specifies whether to match all XMLRecord values during an UPDATE or DELETE statement. By default, only the values that were set on the XMLRecord using XMLRecord.setValue are matched.

See Also:
XMLRecord.isValueSet, XMLColumnValues.isValueSet, Constant Field Values

USE_NO_UNICITY

public static final int USE_NO_UNICITY
Disables the unicity features with this option. When this option is enabled, the existence of a record is checked before any insert, update or delete operation for all the tables where a unique key is defined. This option is enabled by default.

See Also:
setColumnUnicity, Constant Field Values

USE_NO_INDENT

public static final int USE_NO_INDENT
Disables the indenting done while marshalling to a character stream. Indenting is enabled by default.

See Also:
Constant Field Values

USE_SORT_COMBINE

public static final int USE_SORT_COMBINE
Enables the combining and sorting performed while marshalling a recordset with a mapping definition that includes combine and sort settings. This option is enabled by default.

See Also:
Constant Field Values

ENABLE_UPDATE_ON_INSERT

public static final int ENABLE_UPDATE_ON_INSERT
Enables update of existing records during an unmarshal operation. When this option is set, the existence of a record is checked before every insert. If the record already exists, an update is performed. Otherwise a new record is inserted. This option requires a key on the database tables or defined in the mapping file. This option is disabled by default and it is ignored when marshalling.

See Also:
Constant Field Values

USE_ONE_TO_MANY_UNCOMBINE_METHOD

public static final int USE_ONE_TO_MANY_UNCOMBINE_METHOD
When enabled, uses a one-to-many approach to resolve an XML input file containing nodes aggregated under a single occurrence of a parent node (combined node) during unmarshalling. This option is set to true by default for unmarshalling. When set to false, the engine resolves XML input files containing combined nodes using a many-to-many approach. This option is ignored when marshalling.

See Also:
Constant Field Values

USE_ISO_TIMESTAMP_FORMAT

public static final int USE_ISO_TIMESTAMP_FORMAT
Sets the use the ISO8601 format "yyyy:mm:ddThh:mm:ss.n" for timestamp data in the output XML of a marshal operation. If the option is disabled, the format will be JAVA standard "yyyy:mm:dd hh:mm:ss.n".

See Also:
Constant Field Values

SPLIT_OUTPUTXML_FILE

public static final int SPLIT_OUTPUTXML_FILE
Enables the split of the output XML into many files, one for each child of the root element. This option is disabled by default. To have the output XML split in many files, the methods setOutputXML(String) or setOutputXML(String, List) must be called to set the name of an output XML or a name of an existing directory. An XML expression can also be used to modify the output file name using values from elements or attributes of the XML file. If, while generating the name for the output file, a name collision occurs, a number is appended to the end the file name.

See Also:
Constant Field Values

CREATE_TABLE_RELATIONS

public static final int CREATE_TABLE_RELATIONS
Enables the creation of keys and foreign keys when tables are created in an unmarshal process. This option is disabled by default.

See Also:
Constant Field Values

CREATE_TABLE_KEYS

public static final int CREATE_TABLE_KEYS
Enables the creation of keys when tables are created in an unmarshal process. This option is disabled by default.

See Also:
Constant Field Values

IGNORE_XMLSCHEMA_DATATYPES

public static final int IGNORE_XMLSCHEMA_DATATYPES
When set, the marshal process ignores the XML schema data types. Element/attribute values in the output file are formatted according to the JDBC data type of the field mapped to that element/attribute. For an unmarshal process, the values in the input XML document must have the JDBC format. This option is disabled by default.

When disabled, all the values in the output file are formatted according to the schema data type specified in the mapping file. For unmarshalling, values in the input xml document are expected to have been formatted according to the schema data type specified in the mapping file.

See Also:
Constant Field Values

DISABLE_RECORD_VALIDATION

public static final int DISABLE_RECORD_VALIDATION
When set, performs schema validation of the whole output document at the end of the marshal process. This option is disabled by default. The default behavior during schema validation, when a schema has been set for validation using setSchema, is to validate each record generated by the marshal process. To disable this behaviour and validate the entire marshal output document, enable this option.

This option is ignored by an unmarshal process.

See Also:
Constant Field Values

USE_SELECT_DISTINCT

public static final int USE_SELECT_DISTINCT
When this option is set the select statement generated by the marshal process include the DISTINCT clause. This option is ignored by an unmarshal process.

See Also:
Constant Field Values

UNIQUE_NONE

public static final int UNIQUE_NONE
The default, no unicity constraints are derived from the column this value is used with.

See Also:
setColumnUnicity, Constant Field Values

UNIQUE_CACHE

public static final int UNIQUE_CACHE
When set, the corresponding field value will be used in computing a hash value for the record. This hash value then determines the record's unicity for the life of the recordset. When multiple fields in the same database table are set to this unicity constraint their values are combined to generate the hash value.

See Also:
setColumnUnicity, Constant Field Values

UNIQUE_DBMS

public static final int UNIQUE_DBMS
When set, the corresponding field value will be tested for unicity against the database (together with all the other fields under this constraint in the same database table) using a SQL SELECT statement. open, beginTrans and beginTrans_UnitOfWork can be used to fine-tune transaction isolation.

See Also:
setColumnUnicity, Constant Field Values

ALL_RECORDS

public static final int ALL_RECORDS
Indicates that there is no limit set on the number of records to retrieve and that all records will be retrieved during marshalling processes. Used with the setMaxRecords method.

See Also:
Constant Field Values
Method Detail

getDOMDocument

public org.w3c.dom.Document getDOMDocument()
Returns a DOM document containing DOM nodes resulting from a marshalling operation where a DOM document has been set using setDOM. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Returns:
the DOM document that contains the DOM nodes resulting from a recordset marshal operation.
See Also:
setDOM

getRecordsetElement

public org.w3c.dom.Element getRecordsetElement()
Returns a DOM document element resulting from a marshalling operation where a DOM document has been set using setDOM. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Returns:
the DOM top level element resulting from a recordset marshal operation if setDOM was called earlier.

writeDocument

public boolean writeDocument(java.io.Writer writer,
                             boolean indent)
                      throws java.io.IOException
Outputs the recordset's DOM document to a writer.

Parameters:
writer - The writer to use for the output of the recordset's DOM document.
indent - Use true to indent the output, false otherwise.
Returns:
true if the recordset has a DOM document, false otherwise.
java.io.IOException

setDOM

public org.w3c.dom.Document setDOM(java.lang.String parserFactoryName)
                            throws XMLRecordsetException
Generates a DOM tree when marshalling data. A DOM document is created using the specified parser factory class. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
parserFactoryName - the name of the factory class. If null is specified, then the default, javax.xml.parsers.DocumentBuilderFactory, is used.
Returns:
the DOM document instance created.
Throws:
XMLRecordsetException - codes
See Also:
getDOMDocument

setDOM

public org.w3c.dom.Document setDOM(org.w3c.dom.Document document)
                            throws XMLRecordsetException
Generates a DOM tree when marshalling data. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
document - a DOM document instance to host the DOM tree.
Returns:
the DOM document instance specified.
Throws:
XMLRecordsetException - codes

setOutputXML

public java.io.Writer setOutputXML(java.io.Writer writer)
                            throws XMLRecordsetException
Specifies the Writer object for XML data output while marshalling. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
writer - the character stream the XML data is written to.
Returns:
the writer specified.
Throws:
XMLRecordsetException - codes

setOutputXML

public java.io.Writer setOutputXML(java.io.OutputStream outputStream)
                            throws XMLRecordsetException
Specifies the output stream for XML data while marshalling. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null, the platform's default encoding is used. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
outputStream - the byte stream where the XML data is written.
Returns:
the writer created from the outputStream parameter.
Throws:
XMLRecordsetException - codes
See Also:
setEncoding

setOutputXML

public java.io.Writer setOutputXML(java.io.OutputStream outputStream,
                                   java.lang.String encoding)
                            throws XMLRecordsetException
Specifies the output stream for XML data while marshalling. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
outputStream - the byte stream to which the XML data is written.
encoding - the encoding to use for characters to bytes encoding.
Returns:
the Writer created from the outputStream parameter
Throws:
XMLRecordsetException - codes

setOutputXML

public void setOutputXML(java.lang.String outputXML)
Specifies the output file for XML data while marshalling. The parameter may be a simple path and file name or a URL. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null, the platform's default encoding is used.

Parameters:
outputXML - the name of the file where the XML data is written.
See Also:
setEncoding

setOutputXML

public void setOutputXML(java.lang.String outputXML,
                         java.util.List outputFileNames)
Specifies the marshal output XML file and retrieves a list of all the file names generated during the marshal process. This API is used together with the SPLIT_OUTPUT_FILE option.

Parameters:
outputXML - the name of the file or directory where the XML data is written. If an XML expression to set the output file name is saved in the mapping file, the XML expression is evaluated before saving each output file and the resulting string is appended to the outputXML value to obtain the name of the output file.
outputFileNames - if not null, this List object will contain the names of all the output files created by the marshal process.
See Also:
setOutputXML(String outputXML)

setInputXML

public void setInputXML(java.io.InputStream inputStream)
                 throws XMLRecordsetException
Specifies the input stream from which to read XML data for unmarshalling. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null the platform's default encoding is used. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
inputStream - the byte input stream to read XML data from.
Throws:
XMLRecordsetException - codes
See Also:
setEncoding

setInputXML

public void setInputXML(java.io.InputStream inputStream,
                        java.lang.String encoding)
                 throws XMLRecordsetException
Specifies the input stream from which to read XML data for unmarshalling. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
inputStream - the byte input stream from which to read XML data.
encoding - the encoding to use for bytes to characters decoding.
Throws:
XMLRecordsetException - codes

setInputXML

public void setInputXML(java.io.Reader reader)
Specifies the Reader from which to read the input XML data for unmarshalling. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
reader - the character input stream to read XML data from.

setInputXML

public void setInputXML(java.lang.String inputXML)
Specifies the input file from which to read XML data for unmarshalling. The parameter may be a simple path and file name or a URL. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null the platform's default encoding is use.

Parameters:
inputXML - the name of the file to read XML data from.
See Also:
setEncoding

setInputXMLSystemId

public void setInputXMLSystemId(java.lang.String systemId)
Sets the system identifier for the stream passed to setInputXML or for the inputXML file specified in the inputString of the unmarshalXMLStream or unmarshal methods. The system identifier is used to resolve relative URIs contained in the inputXML.


setInputXSL

public void setInputXSL(java.io.InputStream inputStream)
                 throws XMLRecordsetException
Specifies the input stream from which to read an XSL document to use for XSLT transformations. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null, the platform's default encoding is used.

Throws:
XMLRecordsetException - codes
See Also:
setEncoding

setInputXSL

public void setInputXSL(java.io.InputStream inputStream,
                        java.lang.String encoding)
                 throws XMLRecordsetException
Specifies the input stream from which to read an XSL document to use for XSLT transformations.

Parameters:
inputStream - the byte input stream to read XSL data from.
Throws:
XMLRecordsetException - codes

setInputXSL

public void setInputXSL(java.io.Reader reader)
                 throws XMLRecordsetException
Specifies the Reader from which to read an XSL document to use for XSLT transformations.

Parameters:
reader - the character input stream to read XSL data from.
Throws:
XMLRecordsetException - codes

setInputXSL

public void setInputXSL(java.lang.String inputXSL)
Specifies the input file from which to read an XSL document to use for XSLT transformations. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null, the platform's default encoding is used.

Parameters:
inputXSL - the name of the file to read the XSL document from.
See Also:
setEncoding

showDTD

public void showDTD(boolean show)
Requests the inclusion of a DTD in the XML output document after marshalling using the default schema. It has no effect if a mapping file is used. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
show - when set to true, the XML output document contains a DTD of the output document.

showXMLSchema

public void showXMLSchema(boolean show)
Requests the inclusion of a W3C schema in the XML ouptut document after marshalling using the default schema. It has no effect if a mapping file is used. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
show - when set to true, the marshal output document contains a W3C schema of the output document.

setProvider

public void setProvider(java.lang.String provider)
                 throws XMLRecordsetException
Specifies the JDBC provider that will be used for marshalling or unmarshalling. It can be a class name or a JNDI datasource name. If a class name is specified, a URL must also be set using the setUrl method. If it's a datasource name, the URL must be set to null. The format for the datasource name is contextname!resourcename or simply resourcename. A '!' character in the context name or in the resource name can be escaped using a '\'.

Parameters:
provider - the classname of the JDBC provider to use or a JNDI datasource name.
Throws:
XMLRecordsetException - codes

setUrl

public void setUrl(java.lang.String url)
            throws XMLRecordsetException
Specifies the URL to use when connecting to a database using a JDBC provider class. In some cases such a URL may contain username/password information. The URL must be set to null if a JNDI datasource name was set using setProvider.

Parameters:
url - a database url of the form jdbc:subprotocol:subname
Throws:
XMLRecordsetException - codes
See Also:
setUser, setPassword, setProvider

setUser

public void setUser(java.lang.String user)
             throws XMLRecordsetException
Specifies the user to use connecting to a database.

Parameters:
user - the database user on whose behalf the connection is going to be made
Throws:
XMLRecordsetException - codes
See Also:
setUrl

setPassword

public void setPassword(java.lang.String password)
                 throws XMLRecordsetException
Specifies the password to use in connecting to a database.

Parameters:
password - the password of the database user on whose behalf the connection is going to be made
Throws:
XMLRecordsetException - codes
See Also:
setUrl

setConnectionLinger

public void setConnectionLinger(int linger)
Enables a form of connection pooling where a connection lingers for a number of milliseconds after being closed. When the JDBC connection is closed it can be told to linger for a number of milliseconds so that it is available for reuse within that time. Connecting to a JDBC provider can be slow depending on the underlying JDBC implementation and databases. By default, connections are not pooled and the linger is zero.

Parameters:
linger - the number of milliseconds the low level connection should linger after being closed.

setEncoding

public void setEncoding(java.lang.String encoding)
Specifies the encoding to use when marshalling, unmarshalling, or reading XSL files. The encoding name must be a name understood by the Java Runtime Environment. A null value indicates that the platform's default encoding should be used. By default the encoding used is UTF-8.


setLocale

public void setLocale(java.util.Locale locale)
Allows you to change the locale used when marshalling or unmarshalling numeric, date or time types.


setMaxRecords

public void setMaxRecords(int maxRecords)
Specifies the maximum number of records for a marshal operation. When this value is set, the JDBC function setMaxRows is called before the execution of the SELECT statement.

Parameters:
maxRecords - the maximum number of records for a marshal operation. By default, maxRecords is ALL_RECORDS.

setTable

public void setTable(java.lang.String table)
Specifies a database table name when marshalling or unmarshalling using the default schema. When used before a marshal operation, and no query was set with setQuery or in the input string parameter of the open(inputString, isolation) method, the following generic query is used: select * from table
When used before unmarshalXMLStream or unmarshal, the table overrides the value obtained from the table attribute of the <RECORDSET> element. A call to this method has no effect if a mapping file is used.

Parameters:
table - the name of a database table.

setQuery

public void setQuery(java.lang.String query)
Specifies a SQL query for a marshal process.

Parameters:
query - a SQL SELECT statement. If this value is not specified before the recordset is opened, then a query is constructed from the value set with setTable instead.

setOptions

public void setOptions(int options)
Sets one or more options in a single call. Options available are: This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
options - an option value or the result of the Bitwise OR between more options.

setOption

public void setOption(int option)
Sets a single option. Options available are This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
option - one option to be or'ed together with the options already set on the recordset.

clearOption

public void clearOption(int option)
Clears one option at a time. Options available are: This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
option - one option to be cleared from the options set on the recordset.

isOptionSet

public boolean isOptionSet(int option)
Checks whether an option is in use. Options available are: This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
option - one option to be tested against the options set on the recordset.

getOptions

public int getOptions()
Retrieves the combined value of all options. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Returns:
the options currently set on the recordset.

setBuildPath

public void setBuildPath(java.lang.String buildPath)
Specifies the path to use when creating databinding classes using the build methods.

Parameters:
buildPath - The file names are generated as follows:
  • buildPath/packageName/className_RecordsetBuilder.java
  • buildPath/packageName/className_Record.java

setClassName

public void setClassName(java.lang.String className)
Specifies the class name to use when creating databinding classes using the build methods.

Parameters:
className - The file names are generated as follows:
  • buildPath/packageName/className_RecordsetBuilder.java
  • buildPath/packageName/className_Record.java

setPackageName

public void setPackageName(java.lang.String packageName)
Specifies the package name to use when creating databinding classes using the build methods.

Parameters:
packageName - The file names are generated as follows:
  • buildPath/packageName/className_RecordsetBuilder.java
  • buildPath/packageName/className_Record.java

build

public void build()
           throws XMLRecordsetException
Generates classes for data binding. Based on buildPath, className and packageName strings, the build method generates classes corresponding to an unmarshalled document, a database table, an SQL query or a mapping file. A mapping file is specified using setMapping. The selection of the document to unmarshal, the table to retrieve, or the query to run is based on setters called earlier such as setInputXML, setTable, setQuery.

Throws:
XMLRecordsetException - codes

build

public void build(java.lang.String inputString)
           throws XMLRecordsetException
Generates classes for data binding. Based on buildPath, className and packageName strings, the build method generates classes corresponding to an unmarshalled document, a database table, a SQL query or a mapping file. A mapping file is specified using setMapping. The selection of the document to unmarshal, the table to retrieve or the query to run is based on the value of inputString.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setInputXML, setOutputXML, setTable, setQuery, setProvider, setUrl, setUser, setPassword, setConnectionLinger, setBuildPath, setClassName, setEncoding, setLocale, setPackageName. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<query=query-string>
<table=table-name>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<buildPath=path_where_to_build_databinding_Java_classes>
<className=name_of_a_Java_class_to_build>
<packageName=name_of_package_where_to_build_a_Java_class>
Throws:
XMLRecordsetException - codes

marshalXMLStream

public void marshalXMLStream()
                      throws XMLRecordsetException
Given a table name or an SQL query specified using the setTable or setQuery methods, or a mapping file specified using the setMapping method marshals the recordset to the XML stream previously set using setOutputXML, setOutputXML_JMS or setDOM. Database connection information is obtained from the following methods:
setProvider,
setUrl,
setUser,
setPassword. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

marshalXMLStream

public void marshalXMLStream(java.lang.String inputString)
                      throws XMLRecordsetException
Given a table name, a SQL query or a mapping file, marshals the recordset to an XML stream. A mapping file is specified using setMapping. A mapping file must define a mapping for at least an element or attribute, otherwise an error is generated.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setOutputXML, setTable, setQuery, setProvider, setUrl, setInputXSL, setUser, setPassword, setConnectionLinger, setUser_JMS, setPassword_JMS, setEncoding, setLocale, setOutputXML_JMS. setHttpUser. setHttpPassword. setSchema. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<query=query-string>
<table=table-name>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<outputXML=where_to_XML_marshal_a_recordset_can_be_URL>
<inputXSL=path_or_URL_to_XSLT_document_to_use>
<userJMS=user_name_to_connect_to_specified_queue>
<passwordJMS=password_to_connect_to_specified_queue>
<factoryJMS=connection_factory_name>
<outputQueueJMS=output_queue_name>
<connectionLinger=number_of_milliseconds>
<maxRecords=maximum_number_of_records>
<httpUser=authorization_to_access_to_the_specified_URLs>
<httpPassword=authorization_to_access_to_the_specified_URLs>
<schema=path_or_URL_to_the_XMLSchema_used_for_validation>
Throws:
XMLRecordsetException - codes

unmarshalXMLStream

public void unmarshalXMLStream()
                        throws XMLRecordsetException
Imports an XML document into a database. Typically uses a mapping file (set using setMapping) to determine how to associate XML elements and attributes to database columns. Can also import an XML document directly into a database table if the document conforms to HiT's XML Recordset schema (i.e. a document was generated by marshalling using the default schema.) Input XML data is obtained from the setInputXML or setInputXML_JMS methods. If the input file is a well-formed, but empty XML file, and the mapping file contains table definitions, tables are created. Connection information is obtained from the setProvider, setUrl, setUser, setPassword methods. If any of the tables used in the mapping are missing in the database and the mapping file contains table definitions, the missing tables are created using the SQL CREATE TABLE statement. If no mapping file is used and the input XML Document uses the default schema, and contains the default XML schema, the missing table will also be created by the unmarshal process. If an exception is thrown during table creation, tables are dropped and changes are rolled back when an isolation level is set and a transaction is used. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

unmarshalXMLStream

public void unmarshalXMLStream(java.lang.String inputString)
                        throws XMLRecordsetException
Imports an XML document into a database using an input string for database and XML data parameters. Typically uses a mapping file (set using setMapping) to determine how to associate XML elements and attributes to database columns. Can also import an XML document directly if the document uses HiT's XML Recordset schema (i.e. the document was generated by marshalling using the default schema.) If any of the tables used in the mapping are missing in the database and the mapping file contains tables definition, the missing tables are created using the SQL CREATE TABLE statement. If the input file is a well-formed, but empty XML file, and the mapping file contains table definitions, tables are created. If no mapping file is used and the input XML Document uses the default schema, and contains the default XML schema, the missing table will also be created by the unmarshal process. If an exception is thrown during the unmarshal process, the tables created are dropped and changes are rolled back if a transaction was started.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setInputXML, setTable, setProvider, setUrl, setUser, setPassword, setConnectionLinger, setUser_JMS, setPassword_JMS, setEncoding, setLocale, setInputXML_JMS. setHttpUser. setHttpPassword. setSchema. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<table=table-name>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<inputXML=XML_document_to_unmarshal>
<userJMS=user_name_to_connect_to_specified_queue>
<passwordJMS=password_to_connect_to_specified_queue>
<factoryJMS=connection_factory_name>
<inputQueueJMS=input_queue_name>
<connectionLinger=number_of_milliseconds>
<httpUser=authorization_to_access_to_the_specified_URLs>
<httpPassword=authorization_to_access_to_the_specified_URLs>
<schema=path_or_URL_to_the_XMLSchema_used_for_validation>
This method can also be called in a jAllora client application that uses the jAllora Web Service.
Throws:
XMLRecordsetException - codes

unmarshalXMLStream

public void unmarshalXMLStream(java.io.InputStream inputStream)
                        throws XMLRecordsetException
Deprecated. use setInputXML and unmarshalXMLStream() instead.

XMLRecordsetException

marshal

public void marshal()
             throws XMLRecordsetException
Starts the marshalling process to an XML output stream determined by the setOutputXML or setDOM methods. The recordset must be opened using open before calling this method or an Exception is thrown. This method is used together with open and nextRecord to perform a marshal at record level:
    // set connection properties
    // ...
    // connect to the database
    recordset.open();
    // start the marshal process
    recordset.marshal();
    while (true) {
        // get the next XMLRecord
        XMLRecord record = recordset.nextRecord();
        if (record == null)
            break;
        // ...
        // here you can work on the record using the getValue and
        // setValue methods of the XMLRecord interface
        // ...
        // marshal the XMLRecord to the output XML
        record.marshal();
    }
    recordset.marshalEnd();
 
This method marshals data using one of the following sources: This method initializes the marshal process, marshalling the document prolog and the root node, if specified. The XML schema and DTD information, if requested with showXMLSchema and showDTD, are also marshalled to the output XML. As shown in the example, record data is marshalled by calling the XMLRecord.marshal method. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

marshal

public void marshal(java.io.OutputStream outputStream)
             throws XMLRecordsetException
Deprecated. use setOutputXML or setOutputXML_JMS, and marshal() instead.

XMLRecordsetException

marshal

public void marshal(java.io.OutputStream outputStream,
                    java.lang.String encoding)
             throws XMLRecordsetException
Deprecated. use setOutputXML or setOutputXML_JMS, and marshal() instead.

XMLRecordsetException

marshal

public void marshal(java.io.Writer writer)
             throws XMLRecordsetException
Deprecated. use setOutputXML or setOutputXML_JMS, and marshal() instead.

XMLRecordsetException

marshalEnd

public void marshalEnd()
                throws XMLRecordsetException
Completes marshalling by generating final characters to produce valid XML documents. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

unmarshal

public void unmarshal()
               throws XMLRecordsetException
Starts the import of an XML document into a database. Typically uses a mapping file (set using setMapping) to determine how to associate XML elements and attributes to database columns. Can also import an XML document directly if the database uses HiT's XML Recordset schema (i.e. a document was generated by marshalling using the default schema.) Input data is obtained from the setInputXML or setInputXML_JMS methods. The recordset must be opened using open_UnitOfWork before calling this method or an exception is thrown. This method is used together with open_UnitOfWork and nextRecord to perform an unmarshal at record level:
    // set connection properties
    // ...
    // connect to the database
    recordset.open_UnitOfWork();
    // start the unmarshal process
    recordset.unmarshal();
    while (true) {
        // get the next XMLRecord
        XMLRecord record = recordset.nextRecord();
        if (record == null)
            break;
        // ...
        // here you can work on the record using the getValue and
        // setValue methods of the XMLRecord interface
        // ...
        // unmarshal the XMLRecord
        record.insert();
    }
    recordset.close_UnitOfWork();
 
Connection information is obtained from the setProvider, setUrl, setUser, setPassword methods. If any of the tables used in the mapping are missing in the database and the mapping file contains table definitions, the missing tables are created using the SQL CREATE TABLE statement. If no mapping file is used, and the input XML Document contains the XMLSchema, the missing table will also be created by the unmarshal process. If an exception is thrown during table creation, tables are dropped and changes are rolled back when an isolation level is set and a transaction is used. Individual records are unmarshalled by calling the nextRecord or nextRecords methods and inserted into the database tables by calling the XMLRecord.insert method.

Throws:
XMLRecordsetException - codes

unmarshal

public void unmarshal(java.lang.String inputString)
               throws XMLRecordsetException
Starts the import of an XML document into a database. See unmarshal() for more information.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setInputXML, setTable, setProvider, setUrl, setUser, setPassword, setConnectionLinger, setUser_JMS, setPassword_JMS, setEncoding, setLocale, setInputXML_JMS. setHttpUser. setHttpPassword. setSchema. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<table=table-name>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<inputXML=XML_document_to_unmarshal>
<outputXML=where_to_XML_marshal_a_recordset>
<userJMS=user_name_to_connect_to_specified_queue>
<passwordJMS=password_to_connect_to_specified_queue>
<factoryJMS=connection_factory_name>
<inputQueueJMS=input_queue_name>
<connectionLinger=number_of_milliseconds>
<httpUser=authorization_to_access_to_the_specified_URLs>
<httpPassword=authorization_to_access_to_the_specified_URLs>
<schema=path_or_URL_to_the_XMLSchema_used_for_validation>
Throws:
XMLRecordsetException - codes

unmarshal

public void unmarshal(java.io.InputStream inputStream)
               throws XMLRecordsetException
Deprecated. use setInputXML or setInputXML_JMS, and unmarshal() instead.

XMLRecordsetException

unmarshal

public void unmarshal(java.io.Reader reader)
               throws XMLRecordsetException
Deprecated. use setInputXML or setInputXML_JMS, and unmarshal() instead.

XMLRecordsetException

unmarshalRecord

public com.hitsw.xml.databinding.XMLRecord unmarshalRecord()
                                                    throws XMLRecordsetException
Deprecated. use nextRecord instead

XMLRecordsetException

open

public void open()
          throws XMLRecordsetException
Opens a recordset by connecting to the database and executing a SQL SELECT statement. The SQL statement is derived from a mapping file if setMapping was called, otherwise it is the query specified using setQuery or "select * from table" if a table was set using setTable. Database connection information is obtained from the following methods:
setProvider,
setUrl,
setUser,
setPassword
The isolation level is set to TRANSACTION_NONE (autocommit) and may be changed with beginTrans.
This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes
See Also:
open(int isolation)

open

public void open(java.lang.String inputString)
          throws XMLRecordsetException
Opens a recordset by connecting to the database and executing a SQL SELECT statement. The SQL statement is derived from a mapping file if setMapping was called, otherwise it is the query specified in the inputString parameter or set using setQuery, or it is the statement "select * from table" if a table is defined in the inputString parameter or set using setTable.
The isolation level is set to TRANSACTION_NONE (autocommit) and may be changed with beginTrans.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setOutputXML, setTable, setQuery, setProvider, setUrl, setInputXSL, setUser, setPassword, setConnectionLinger, setUser_JMS, setPassword_JMS, setEncoding, setLocale, setOutputXML_JMS. setHttpUser. setHttpPassword. setSchema. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<query=query-string>
<table=table-name>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<outputXML=where_to_XML_marshal_a_recordset>
<userJMS=user_name_to_connect_to_specified_queue>
<passwordJMS=password_to_connect_to_specified_queue>
<factoryJMS=connection_factory_name>
<outputQueueJMS=output_queue_name>
<connectionLinger=number_of_milliseconds>
<maxRecords=maximum_number_of_records>
<httpUser=authorization_to_access_to_the_specified_URLs>
<httpPassword=authorization_to_access_to_the_specified_URLs>
<schema=path_or_URL_to_the_XMLSchema_used_for_validation>
This method can also be called in a jAllora client application that uses the jAllora Web Service.
Throws:
XMLRecordsetException - codes
See Also:
open(String inputString, int isolation)

open

public void open(int isolation)
          throws XMLRecordsetException
Opens a recordset by connecting to the database using the specified isolation level and executing a SQL SELECT statement. The SQL statement is derived from a mapping file if setMapping was called, otherwise it is the query specified using setQuery or "select * from table" if a table was set using setTable.
Database connection information is obtained from the following methods:
setProvider,
setUrl,
setUser,
setPassword
This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
isolation - the isolation level to use with the JDBC connection. Allowed values are: If isolation is TRANSACTION_NONE the JDBC connection is set to autocommit, otherwise the autocommit is set to false and setTransactionIsolation is called with the specified isolation level.
Throws:
XMLRecordsetException - codes

open

public void open(java.lang.String inputString,
                 int isolation)
          throws XMLRecordsetException
Opens a recordset by connecting to the database using the specified isolation level and executing a SQL SELECT statement. The SQL statement is derived from a mapping file if setMapping was called, otherwise it is the query specified in the inputString parameter or set using setQuery, or it is the statement "select * from table" if a table is defined in the inputString parameter or set using setTable.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setOutputXML, setTable, setQuery, setProvider, setUrl, setInputXSL, setUser, setPassword, setConnectionLinger, setUser_JMS, setPassword_JMS, setEncoding, setLocale, setOutputXML_JMS. setHttpUser. setHttpPassword. setSchema. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<query=query-string>
<table=table-name>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<outputXML=where_to_XML_marshal_a_recordset>
<userJMS=user_name_to_connect_to_specified_queue>
<passwordJMS=password_to_connect_to_specified_queue>
<factoryJMS=connection_factory_name>
<outputQueueJMS=output_queue_name>
<connectionLinger=number_of_milliseconds>
<maxRecords=maximum_number_of_records>
<httpUser=authorization_to_access_to_the_specified_URLs>
<httpPassword=authorization_to_access_to_the_specified_URLs>
<schema=path_or_URL_to_the_XMLSchema_used_for_validation>
This method can also be called in a jAllora client application that uses the jAllora Web Service.
isolation - the isolation level to use with the JDBC connection. Allowed values are: If isolation is TRANSACTION_NONE, the JDBC connection is set to autocommit, otherwise the autocommit is set to false and setTransactionIsolation is called with the specified isolation level.
Throws:
XMLRecordsetException - codes

close

public void close()
           throws XMLRecordsetException
Closes a previously opened recordset and disconnects from the database. Recordsets must be closed to release possible locks and/or to release database cursors. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

beginTrans

public void beginTrans(int isolation)
                throws XMLRecordsetException
Starts a transaction by setting the specified isolation level. This method is used in conjunction with unmarshal methods to keep the database changes under a transaction that can be later committed or rolled back using the commitTrans or rollbackTrans methods.

Parameters:
isolation - the isolation level to use with the JDBC connection. Allowed values are: The autocommit of the JDBC connection is set to false and the specified isolation level is set using the setTransactionIsolation JDBC method.
Throws:
XMLRecordsetException - codes

commitTrans

public void commitTrans()
                 throws XMLRecordsetException
Commits all the changes of the current transaction to the database. This method is used in conjunction with unmarshal methods and requires a previous call to beginTrans.

Throws:
XMLRecordsetException - codes

rollbackTrans

public void rollbackTrans()
                   throws XMLRecordsetException
Rolls back all the changes of the current transaction to the database. This method is used in conjunction with unmarshal methods and requires a previous call to beginTrans.

Throws:
XMLRecordsetException - codes

nextRecord

public com.hitsw.xml.databinding.XMLRecord nextRecord()
                                               throws XMLRecordsetException
While marshalling, it fetches the next record from the database and builds an XMLRecord based on the specified mapping or defaulf XMLSchema (see marshal for more details). While unmarshalling, it retrieves the next XMLRecord from the specified input stream. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Returns:
the next XMLRecord or null if no more records are available.
Throws:
XMLRecordsetException - codes

nextRecords

public com.hitsw.xml.databinding.XMLRecord[] nextRecords(int n)
                                                  throws XMLRecordsetException
While marshalling, it fetches the next n records from the database and builds an array of records based on the specified mapping or default XML schema (see marshal for more details). While unmarshalling, it retrieves the next n records from the specified input stream. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
n - the number of XMLRecords to fetch
Returns:
an array of n XMLRecords. If less than n records are are available the remainder of the array is padded with null.
Throws:
XMLRecordsetException - codes

newRecord

public com.hitsw.xml.databinding.XMLRecord newRecord()
                                              throws XMLRecordsetException
Creates a new XMLRecord based on the specified mapping or default XML schema. The implementation class used is either the system default or the class set earlier with XMLRecordsetBuilder.newInstance(Class) and generated earlier with build. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

open_UnitOfWork

public void open_UnitOfWork()
                     throws XMLRecordsetException
Opens a unit of work. Units of work must be opened before calling XMLRecord.insert, XMLRecord.update or XMLRecord.delete operations. Database connection information is obtained from the following methods:
setProvider,
setUrl,
setUser,
setPassword
The isolation level is set to TRANSACTION_NONE (autocommit) and may be changed with beginTrans_UnitOfWork(int isolation).
This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

open_UnitOfWork

public void open_UnitOfWork(java.lang.String inputString)
                     throws XMLRecordsetException
Opens a unit of work. Units of work must be opened before calling XMLRecord.insert, XMLRecord.update or XMLRecord.delete operations. The isolation level is set to TRANSACTION_NONE (autocommit) and may be changed with beginTrans_UnitOfWork(int isolation).
This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
inputString - a string of <> surrounded key/value pairs. These values will override settings made earlier with setters such as setProvider, setUrl, setUser, setPassword, setConnectionLinger. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<connectionLinger=number_of_milliseconds>
Throws:
XMLRecordsetException - codes

open_UnitOfWork

public void open_UnitOfWork(int isolation)
                     throws XMLRecordsetException
Opens a unit of work, as described in open_UnitOfWork, and starts a transaction using the specified isolation level (see beginTrans_UnitOfWork(int) beginTrans_UnitOfWork).

Parameters:
isolation - the isolation level to use with the JDBC connection. Allowed values are:
Throws:
XMLRecordsetException - codes

open_UnitOfWork

public void open_UnitOfWork(java.lang.String inputString,
                            int isolation)
                     throws XMLRecordsetException
Opens a unit of work, as described in open_UnitOfWork, and starts a transaction using the specified isolation level (see beginTrans_UnitOfWork(int) beginTrans_UnitOfWork).

Parameters:
inputString - a string of <> surrounding key/value pairs. These values will override settings made earlier with setters such as setProvider, setUrl, setUser, setPassword, setConnectionLinger. Acceptable keywords are:
<provider=provider-name>
<url=url-value>
<user=username_to_connect_with>
<password=password_of_user>
<encoding=encoding-name>
<locale=java.util.Locale locale field name>
<connectionLinger=number_of_milliseconds>
isolation - the isolation level to use with the JDBC connection. Allowed values are:
Throws:
XMLRecordsetException - codes

close_UnitOfWork

public void close_UnitOfWork()
                      throws XMLRecordsetException
Closes a previously opened unit of work and disconnects from the database. Units of work must be closed to release possible locks and/or to release database cursors. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

beginTrans_UnitOfWork

public void beginTrans_UnitOfWork(int isolation)
                           throws XMLRecordsetException
Starts a transaction for a unit of work by setting the specified isolation level. A previous call to open_UnitOfWork is required. This method is used in conjunction with unmarshal methods to keep the database changes under a transaction that can be later committed or rolled back using the commitTrans_UnitOfWork or rollbackTrans_UnitOfWork methods. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
isolation - the isolation level to use with the JDBC connection. Allowed values are: The autocommit of the JDBC connection is set to false and the specified isolation level is set using the setTransactionIsolation JDBC method.
Throws:
XMLRecordsetException - codes

commitTrans_UnitOfWork

public void commitTrans_UnitOfWork()
                            throws XMLRecordsetException
Commits all the changes of the current unit of work transaction to the database. This method is used in conjunction with unmarshal methods and requires a previous call to beginTrans_UnitOfWork. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

rollbackTrans_UnitOfWork

public void rollbackTrans_UnitOfWork()
                              throws XMLRecordsetException
Rolls back all the changes of the current transaction to the database. This method is used in conjunction with unmarshal methods and requires a previous call to beginTrans_UnitOfWork. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

setUser_JMS

public void setUser_JMS(java.lang.String username)
Sets the JMS user name to be used in connecting to the JMS provider.

Parameters:
username - the username on whose behalf the JMS connection is to be established.

setPassword_JMS

public void setPassword_JMS(java.lang.String password)
Sets the JMS password to be used in connecting to the JMS provider.

Parameters:
password - the password for the username on whose behalf the JMS connection is to be established.

setOutputXML_JMS

public void setOutputXML_JMS(java.lang.String factoryName,
                             java.lang.String queueName)
                      throws XMLRecordsetException
Specifies the queue connection factory name and the queue name where the result of a marshal process will be posted. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null the platform's default encoding is used.

Parameters:
factoryName - the factory name
queueName - the queue name
Throws:
XMLRecordsetException - codes
See Also:
setEncoding

setOutputXML_JMS

public void setOutputXML_JMS(java.lang.String factoryName,
                             java.lang.String queueName,
                             java.lang.String encoding)
                      throws XMLRecordsetException
Specifies the queue connection factory name and the queue name where the result of a marshal process will be posted.

Parameters:
factoryName - the factory name
queueName - the queue name
encoding - the encoding to use for characters to bytes encoding.
Throws:
XMLRecordsetException - codes

setOutputXML_JMS

public void setOutputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms)
                      throws XMLRecordsetException
Specifies the XMLJMS object that will be used to post the the results of the marshal process to the queue. If no encoding value was set using setEncoding, the default character encoding UTF-8 is used for encoding characters into bytes. If the encoding is set to null the platform's default encoding is used.

Parameters:
xmljms - a XMLJMS object
Throws:
XMLRecordsetException - codes
See Also:
setEncoding

setOutputXML_JMS

public void setOutputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms,
                             java.lang.String encoding)
                      throws XMLRecordsetException
Specifies the XMLJMS object that will be used to post the the results of the marshal process to the queue.

Parameters:
xmljms - a XMLJMS object
encoding - the encoding to use for characters to bytes encoding.
Throws:
XMLRecordsetException - codes

setInputXML_JMS

public void setInputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms)
Specifies the XMLJMS object (connected to a queue) from which to read a XML document for unmarshalling.

Parameters:
xmljms - the XMLJMS object

setInputXML_JMS

public void setInputXML_JMS(java.lang.String factoryName,
                            java.lang.String queueName)
                     throws XMLRecordsetException
Specifies the queue connection factory name and the queue name from from which to read an XML document for unmarshalling.

Parameters:
factoryName - the factory name
queueName - the queue name
Throws:
XMLRecordsetException - codes

unmarshalXMLStream

public void unmarshalXMLStream(com.hitsw.xml.jms.XMLListener xmlListener)
                        throws XMLRecordsetException
Works exactly like unmarshalXMLStream() except that an XMLListener is handling asynchronous receives from a queue.

Parameters:
xmlListener - a XMLListener object.
Throws:
XMLRecordsetException - codes

unmarshalXMLStream

public void unmarshalXMLStream(java.lang.String inputString,
                               com.hitsw.xml.jms.XMLListener xmlListener)
                        throws XMLRecordsetException
Works exactly like unmarshalXMLStream(String inputString), except that an XMLListener is handling asynchronous receives from a queue.

Parameters:
inputString - the inputString.
xmlListener - a XMLListener object.
Throws:
XMLRecordsetException - codes

deleteInstance

public void deleteInstance()
                    throws XMLRecordsetException
It is advisable to call this method to release database connections and the recordset's related implementation objects. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - codes

getColumnInfo

public com.hitsw.xml.databinding.XMLColumnInfo getColumnInfo()
Retrieves the XMLColumnInfo object describing the columns of an opened recordset. Column information includes type and name information. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Returns:
an XMLColumnInfo object

getColumnValues

public com.hitsw.xml.databinding.XMLColumnValues getColumnValues()
Retrieves the values for the current XMLRecord during marshalling.

Returns:
a XMLColumnValues object

getConnectionInfo

public com.hitsw.xml.databinding.XMLConnectionInfo getConnectionInfo()
Retrieves information about the connection properties of the current recordset. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Returns:
an XMLConnectionInfo object.

setMapping

public void setMapping(com.hitsw.xml.databinding.XMLSchemaMapper xmlMap)
                throws XMLRecordsetException
Sets an XMLSchemaMapper object for use in marshalling and unmarshalling operations. XMLSchemaMapper objects are created using XMLSchemaMapperBuilder and contain information retrieved from a jAllora mapping file. Mapping files contain instructions for associating XML elements and attributes to database columns and vice versa. Note that a mapping file may contain options settings. setMapping sets the options from the mapping file to this recordset. Use setOptions to override the options specified in the mapping file. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Throws:
XMLRecordsetException - An exception is thrown if the recordset is open.

getMapping

public com.hitsw.xml.databinding.XMLSchemaMapper getMapping()
                                                     throws XMLRecordsetException
Gets the XMLSchemaMapper object previously set with setMapping.

Returns:
an XMLSchemaMapper object.
XMLRecordsetException

sendUpdategram

public org.w3c.dom.Element sendUpdategram(org.w3c.dom.Element updategram)
                                   throws XMLRecordsetException
Deprecated. use sendUpdategram(Element, int) instead.

XMLRecordsetException

sendUpdategram

public org.w3c.dom.Element sendUpdategram(org.w3c.dom.Element updategram,
                                          java.util.Map params)
                                   throws XMLRecordsetException
Deprecated. use sendUpdategram(Element, Map, int) instead.

XMLRecordsetException

sendUpdategram

public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(org.w3c.dom.Element updategram,
                                                                    int isolation)
                                                             throws XMLRecordsetException
Executes an updategram, translating the updategram DOM document into database inserts, updates and deletes. Database connection information is obtained from the following methods:
setProvider,
setUrl,
setUser,
setPassword

Parameters:
updategram - a DOM element representing an XML updategram as specified by Microsoft.
isolation - the isolation level to use, one of:
Returns:
an array of UpdategramResults interfaces, one for each sync block in the updategram, describing the results of the execution of the updategram.
Throws:
XMLRecordsetException - codes

sendUpdategram

public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(org.w3c.dom.Element updategram,
                                                                    java.util.Map params,
                                                                    int isolation)
                                                             throws XMLRecordsetException
Executes an updategram, translating the updategram DOM document into database inserts, updates and deletes. Parameters contained in the XML updategram document are resolved using the params Map object.

Parameters:
updategram - a DOM element representing an XML updategram as specified by Microsoft.
params - a Map Object mapping parameters names to their values.
isolation - the isolation level to use, one of:
Returns:
an array of UpdategramResults interfaces, one for each sync block in the updategram, describing the results of the execution of the updategram.
Throws:
XMLRecordsetException - codes

sendUpdategram

public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(java.lang.String updategram,
                                                                    int isolation)
                                                             throws XMLRecordsetException
Executes an updategram translating the XML updategram file into database inserts, updates and deletes. Database connection information is obtained from the following methods:
setProvider,
setUrl,
setUser,
setPassword

Parameters:
updategram - a file name containing the XML updategram.
isolation - the isolation level to use, one of:
Returns:
an array of UpdategramResults interfaces, one for each sync block in the updategram, describing the results of the execution of the updategram.
Throws:
XMLRecordsetException - codes

sendUpdategram

public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(java.lang.String updategram,
                                                                    java.util.Map params,
                                                                    int isolation)
                                                             throws XMLRecordsetException
Executes an updategram translating the XML updategram file into database inserts, updates and deletes. Parameters contained in the XML updategram document are resolved using the params Map object.

Parameters:
updategram - a file name containing the XML updategram.
params - a Map Object mapping parameters names to their values.
isolation - the isolation level to use, one of:
Returns:
an array of UpdategramResults interfaces, one for each sync block in the updategram, describing the results of the execution of the updategram.
Throws:
XMLRecordsetException - codes

setNullValue

public void setNullValue(java.lang.String nullValue)
                  throws XMLRecordsetException
Sets a value that represents a null value in an XML document. When a database field mapped to a XML schema element or attribute returns a NULL value, the value of that element or attribute is forced to nullValue in the output XML. If nullValue is null, the element or attribute is not added to the outputXML. In an unmarshal process, all the elements or attributes with value equal to nullValue are converted to NULL values in the database. This method can also be called in a jAllora client application that uses the jAllora Web Service.

Parameters:
nullValue - the value to substitute for null.
XMLRecordsetException

getNullValue

public java.lang.String getNullValue()
Returns the value used to represent a null value in an XML document, see setNullValue.

Returns:
the value set with setNullValue or the empty string by default.

setEmptyStringValue

public void setEmptyStringValue(java.lang.String emptyStringValue)
                         throws XMLRecordsetException
Sets a value that represents an empty string for a character database column. If this value is set in an unmarshal operation, all the XML nodes mapped to character data type columns and having value equal to "" (empty string), are replaced with emptyStringValue. For a marshal, all the character data type columns with value equal to emptyStringValue are replaced with an empty string in the output XML file.

Parameters:
emptyStringValue - string value representing an empty string in the database. The default value is "" (empty string).
Throws:
XMLRecordsetException - codes

getEmptyStringValue

public java.lang.String getEmptyStringValue()
Returns the value used to represent an empty string in a character data type column, see setEmptyStringValue.

Returns:
the value previously set with setEmptyStringValue or the empty string default value.

setColumnUnicity

public void setColumnUnicity(int index,
                             int mode)
                      throws XMLRecordsetException
Sets a unicity constraint on a recordset column. Unicity constraints are considered before making a change to a database table with XMLRecord.insert, XMLRecord.update or XMLRecord.delete. Unicity is used to verify the existence of a record in a database table. Updates and deletes are skipped if the record does not exist and inserts are skipped if the record already exists, unless the option ENABLE_UPDATE_ON_INSERT is set.
When marshalling a recordset using the default XML schema (no mapping file), and showXMLSchema or showDTD are enabled, unicity constraints are included in the resulting XML schema as a hitns:unicity attribute An attempt is made to extract these unicity constraints from the database's catalog data. Not all JDBC drivers and databases support these features.
When unmarshalling XML data, the unicity constraints found in the schema, when using default schema, or in the mapping file are enforced and they override any constraints found in the database.
Unicity constraints can be disabled for the recordset by setting the USE_NO_UNICITY option.

Parameters:
index - the index of the field in the recordset columns.
mode - one of:
  • UNIQUE_NONE - the default, no unicity constraint
  • UNIQUE_CACHE - this field's value will be used in computing a hash value for the record. This hash value then determines the record's unicity for the life of the recordset. When multiple fields are set to this unicity constraint their hash values are combined before being tested.
  • UNIQUE_DBMS - this field's value will be tested for unicity against the database (together with all other fields under this constraint) using a SQL SELECT statement. open, beginTrans and beginTrans_UnitOfWork can be used to fine-tune transaction isolation.
Throws:
XMLRecordsetException - codes

setBlockInsertSize

public void setBlockInsertSize(int size)
Specifies the number of records buffered during an unmarshal operation before performing the actual insert on the database. This is performed using the JDBC addBatch and executeBatch methods. Be sure that these methods are supported by the JDBC driver before using setBlockInsertSize. This value is automatically set for some JDBC drivers to have the best performance. Use setBlockInsertSize to override the default behaviour. The block insert size is ignored for all the tables having one or more columns with unicity value equal to UNIQUE_DBMS.

Parameters:
size - size of the insert buffer.

setHttpUser

public void setHttpUser(java.lang.String httpUser)
Specifies the user to use in connecting to inputXML, outputXML or inputXSL when they are URLs.

Parameters:
httpUser - the user name to use in connecting to a URL, if not set or null an anonymous access will be used.
See Also:
marshalXMLStream, unmarshalXMLStream

setHttpPassword

public void setHttpPassword(java.lang.String httpPassword)
Specifies the password to use in connecting to inputXML, outputXML or inputXSL when they are URLs.

Parameters:
httpPassword - the password to connect to the URLs.
See Also:
marshalXMLStream, unmarshalXMLStream

setSchema

public void setSchema(java.lang.String schema)
Specifies the name of a W3C XML Schema file that will be used to validate an unmarshal input XML document or a marshal output XML document. The validation of a marshal output file is done for each XMLRecord unless the option DISABLE_RECORD_VALIDATION is set.

Parameters:
schema - full path of a schema file or URL.

setConnection

public void setConnection(java.sql.Connection conn)
                   throws XMLRecordsetException
This method is used to execute a marshal or unmarshal operation using an opened JDBC connection. If this method is not called, jAllora will open a new JDBC connection using the provider and url specified in the input string or set using the setProvider and setUrl methods.

Parameters:
conn - an opened JDBC connection, or null to remove from this recordset all references to a Connection object that was previously set using setConnection.
XMLRecordsetException
See Also:
setProvider, setUrl

getConnection

public java.sql.Connection getConnection()
Retrieves the JDBC Connection object used internally by the XMLRecordset to update or query the database during a marshal or unmarshal operation. If the XMLRecordset does not have an open connection to a database then null is returned. If setConnection was previously called then the external Connection object set by the setConnection method is returned.

Returns:
the Connection object used by XMLRecord to perform the marshal or unmarshal operation.

setRootName

public void setRootName(java.lang.String rootName)
Specifies the name of the top level element added to the marshal output XML. If the root name is set to null a top level element will not be added to the output file. Depending on the combine setting in the mapping file the output file might result in a list of XML elements. In this case, because only one top level element is allowed in an XML document, removing the root node results in an output XML that is not well-formed.
The default value for the root node is xml.

Parameters:
rootName - the name of the top level element of the marshal ouptput XML.

runXQuery

public void runXQuery(java.lang.String xquery,
                      boolean useDBPredicates,
                      boolean useFullMapping)
               throws XMLRecordsetException
Execute the specified XQuery

Parameters:
xquery - the xquery string to execute
useDBPredicates - if true the predictes in the xquery are translated, when possible, into SQL predicates and added to the SELECT statement generated from the mapping file.
useFullMapping - if true the specified XQuery is executed on the output XML resulting from the marshal of the whole mapping file. If false, only the elements and attributes in the mapping file needed to resolve the xquery are used. Depending on the value of this option you might get different results, particularly if using the position functions
Throws:
XMLRecordsetException

marshalOVLT

public void marshalOVLT(java.lang.String inputString,
                        java.lang.String logFileName)
                 throws XMLRecordsetException
Performs an optimized marshalXMLStream using multiple queries to resolve the mapping. This method can be used only when the mapping file structure matches the following conditions: For each combined element in the mapping file, its sub-nodes are mapped to the same table and it is linked to tables for any descendent combined nodes with a foreign key. Contact HiT Software Technical Support (xml-support@hitsw.com) if you intend to use this method. It translates all the database values mapped to an element/attribute with a lookup rule, to the corresponding XML value as indicated by the lookup association. The lookup rules are set using XMLSchemaMapper.setMarshalLookups

Parameters:
inputString - specifies the input string as in marshalXMLStream
logFileName - the name of a log file where to report missing entries in the lookups.
Throws:
XMLRecordsetException

unmarshalOVLT

public void unmarshalOVLT(java.lang.String inputString,
                          java.lang.String logFileName)
                   throws XMLRecordsetException
Performs an optimized unmarshalXMLStream. This method can be used only when the mapping file structure matches the following conditions: For each combined element in the mapping file, its sub-nodes are mapped to the same table and it is linked to tables for any descendent combined nodes with a foreign key. Contact HiT Software Technical Support (xml-support@hitsw.com) if you intend to use this method. It translates the XML value of an element/attribute with a lookup rule set, to the corresponding database value as indicated by the lookup association. The lookup rules are set using XMLSchemaMapper.setUnmarshalLookups

Parameters:
inputString - specifies the input string as in unmarshalXMLStream
logFileName - the name of a log file where to report missing entries in the lookup file.
Throws:
XMLRecordsetException

unmarshalOVLTToCSV

public void unmarshalOVLTToCSV(java.lang.String inputString,
                               java.lang.String logFileName,
                               boolean gerateOracleCtrlFile)
                        throws XMLRecordsetException
Performs an optimized unmarshalXMLStream to a CSV file. The outputXML must be a name of a directory where the output files are saved. There will be an outputXML file for each table involved in the mapping file. The table name is used as a file name with a .csv extesion. Optionally, the Oracle SQL*Loader control file can also be generated.

Parameters:
inputString - specifies the input string as in unmarshalXMLStream
logFileName - the name of a log file where to report missing entries in the lookup file.
gerateOracleCtrlFile - specifies if an oracle SQL*Loader control file must also be generated.
Throws:
XMLRecordsetException
See Also:
unmarshalOVLT(String, String) for more details.

skipEntityInInputXML

public void skipEntityInInputXML(java.lang.String publicId,
                                 java.lang.String systemId)
This method allow to specify the external entities that shouldn't be resolved while parsing the inputXML file. By default all the entities are resolved and if a link is not found an exception is thrown. An entity is specified using a PUBLIC identifier value and a SYSTEM identifier value. All the entities that match the specified publicId and systemId will not be resolved while parsing the inputXML.

Parameters:
publicId - the regular expression to which the PUBLIC identifier of the external entity declaration is to be matched. A null value matches any PUBLIC identifier value.
systemId - regular expression to which the SYSTEM identifier of the external entity declaration is to be matched. A null value matches any SYSTEM identifier value.

getSkipEntityInInputXML

public java.lang.String[][] getSkipEntityInInputXML()
Retrieves the list of public and system identifiers that are currently set on the recordset and that identify the entity that shouldn't be resolve while parsing an inputXML. These are all the values previously set using the skipEntityInInputXML method.

Returns:
an array of String[2] object containing the public identifier and the system identifier. A null value is returned if no previous call to skipEntityInInputXML have been made.