|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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:
marshalXMLStream.
unmarshalXMLStream.XMLRecord provide methods for record-level export and import
of relational data to and from XML. These methods are useful when you need record-level control
over marshalling and unmarshalling operations.
XMLRecordset.build to bind
Java objects to tables and rows in a relational database. Using the bound Java objects:
XMLRecord class.
XMLRecord class.
XMLJMS interface.
XMLRecordsetBuilder.newInstance
to create a XMLRecordset object.
| 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 |
public static final int TRANSACTION_NONE
public static final int TRANSACTION_READ_COMMITTED
public static final int TRANSACTION_READ_UNCOMMITTED
public static final int TRANSACTION_REPEATABLE_READ
public static final int TRANSACTION_SERIALIZABLE
public static final int USE_AUTOINCREMENT
public static final int USE_STRICTMATCH
XMLRecord.setValue
are matched.
XMLRecord.isValueSet,
XMLColumnValues.isValueSet,
Constant Field Valuespublic static final int USE_NO_UNICITY
setColumnUnicity,
Constant Field Valuespublic static final int USE_NO_INDENT
public static final int USE_SORT_COMBINE
public static final int ENABLE_UPDATE_ON_INSERT
public static final int USE_ONE_TO_MANY_UNCOMBINE_METHOD
public static final int USE_ISO_TIMESTAMP_FORMAT
public static final int SPLIT_OUTPUTXML_FILE
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.
public static final int CREATE_TABLE_RELATIONS
public static final int CREATE_TABLE_KEYS
public static final int IGNORE_XMLSCHEMA_DATATYPES
public static final int DISABLE_RECORD_VALIDATION
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.
public static final int USE_SELECT_DISTINCT
public static final int UNIQUE_NONE
setColumnUnicity,
Constant Field Valuespublic static final int UNIQUE_CACHE
setColumnUnicity,
Constant Field Valuespublic static final int UNIQUE_DBMS
SELECT statement.
open, beginTrans and
beginTrans_UnitOfWork can be used to
fine-tune transaction isolation.
setColumnUnicity,
Constant Field Valuespublic static final int ALL_RECORDS
setMaxRecords method.
| Method Detail |
public org.w3c.dom.Document getDOMDocument()
setDOM.
This method can also be called in a jAllora client application that uses
the jAllora Web Service.
setDOMpublic org.w3c.dom.Element getRecordsetElement()
setDOM.
This method can also be called in a jAllora client application that uses
the jAllora Web Service.
setDOM was called earlier.
public boolean writeDocument(java.io.Writer writer,
boolean indent)
throws java.io.IOException
writer - The writer to use for the output of the recordset's DOM document.indent - Use true to indent the output, false otherwise.
java.io.IOException
public org.w3c.dom.Document setDOM(java.lang.String parserFactoryName)
throws XMLRecordsetException
parserFactoryName - the name of the factory class. If
null is specified, then the default,
javax.xml.parsers.DocumentBuilderFactory, is used.
XMLRecordsetException - codesgetDOMDocument
public org.w3c.dom.Document setDOM(org.w3c.dom.Document document)
throws XMLRecordsetException
document - a DOM document instance to host the DOM tree.
XMLRecordsetException - codes
public java.io.Writer setOutputXML(java.io.Writer writer)
throws XMLRecordsetException
writer - the character stream the XML data is written to.
XMLRecordsetException - codes
public java.io.Writer setOutputXML(java.io.OutputStream outputStream)
throws XMLRecordsetException
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.
outputStream - the byte stream where the XML data is written.
XMLRecordsetException - codessetEncoding
public java.io.Writer setOutputXML(java.io.OutputStream outputStream,
java.lang.String encoding)
throws XMLRecordsetException
outputStream - the byte stream to which the XML data is written.encoding - the encoding to use for characters to bytes encoding.
XMLRecordsetException - codespublic void setOutputXML(java.lang.String outputXML)
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.
outputXML - the name of the file where the XML data is written.setEncoding
public void setOutputXML(java.lang.String outputXML,
java.util.List outputFileNames)
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.setOutputXML(String outputXML)
public void setInputXML(java.io.InputStream inputStream)
throws XMLRecordsetException
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.
inputStream - the byte input stream to read XML data from.
XMLRecordsetException - codessetEncoding
public void setInputXML(java.io.InputStream inputStream,
java.lang.String encoding)
throws XMLRecordsetException
inputStream - the byte input stream from which to read XML data.encoding - the encoding to use for bytes to characters decoding.
XMLRecordsetException - codespublic void setInputXML(java.io.Reader reader)
reader - the character input stream to read XML data from.public void setInputXML(java.lang.String inputXML)
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.
inputXML - the name of the file to read XML data from.setEncodingpublic void setInputXMLSystemId(java.lang.String systemId)
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.
public void setInputXSL(java.io.InputStream inputStream)
throws XMLRecordsetException
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.
XMLRecordsetException - codessetEncoding
public void setInputXSL(java.io.InputStream inputStream,
java.lang.String encoding)
throws XMLRecordsetException
inputStream - the byte input stream to read XSL data from.
XMLRecordsetException - codes
public void setInputXSL(java.io.Reader reader)
throws XMLRecordsetException
reader - the character input stream to read XSL data from.
XMLRecordsetException - codespublic void setInputXSL(java.lang.String inputXSL)
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.
inputXSL - the name of the file to read the XSL document from.setEncodingpublic void showDTD(boolean show)
show - when set to true, the XML output document
contains a DTD of the output document.public void showXMLSchema(boolean show)
show - when set to true, the marshal output document
contains a W3C schema of the output document.
public void setProvider(java.lang.String provider)
throws XMLRecordsetException
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 '\'.
provider - the classname of the JDBC provider to use or a
JNDI datasource name.
XMLRecordsetException - codes
public void setUrl(java.lang.String url)
throws XMLRecordsetException
null if a JNDI
datasource name was set using setProvider.
url - a database url of the form
jdbc:subprotocol:subname
XMLRecordsetException - codessetUser,
setPassword,
setProvider
public void setUser(java.lang.String user)
throws XMLRecordsetException
user - the database user on whose behalf the connection is going
to be made
XMLRecordsetException - codessetUrl
public void setPassword(java.lang.String password)
throws XMLRecordsetException
password - the password of the database user on whose behalf the
connection is going to be made
XMLRecordsetException - codessetUrlpublic void setConnectionLinger(int linger)
linger - the number of milliseconds the low level connection
should linger after being closed.public void setEncoding(java.lang.String encoding)
null value
indicates that the platform's default encoding should be used.
By default the encoding used is UTF-8.
public void setLocale(java.util.Locale locale)
public void setMaxRecords(int maxRecords)
setMaxRows is
called before the execution of the SELECT statement.
maxRecords - the maximum number of records for a marshal
operation. By default, maxRecords is ALL_RECORDS.public void setTable(java.lang.String table)
setQuery
or in the input string parameter of the
open(inputString, isolation) method, the
following generic query is used:
select * from tableunmarshalXMLStream 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.
table - the name of a database table.public void setQuery(java.lang.String query)
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.public void setOptions(int options)
ENABLE_UPDATE_ON_INSERT
USE_AUTOINCREMENT
USE_STRICTMATCH
USE_NO_INDENT
USE_NO_UNICITY
USE_SORT_COMBINE
USE_ONE_TO_MANY_UNCOMBINE_METHOD
USE_ISO_TIMESTAMP_FORMAT
SPLIT_OUTPUTXML_FILE
CREATE_TABLE_RELATIONS
CREATE_TABLE_KEYS
IGNORE_XMLSCHEMA_DATATYPES
DISABLE_RECORD_VALIDATION
options - an option value or the result of the Bitwise OR between
more options.public void setOption(int option)
ENABLE_UPDATE_ON_INSERT
USE_AUTOINCREMENT
USE_STRICTMATCH
USE_NO_INDENT
USE_NO_UNICITY
USE_SORT_COMBINE
USE_ONE_TO_MANY_UNCOMBINE_METHOD
USE_ISO_TIMESTAMP_FORMAT
SPLIT_OUTPUTXML_FILE
CREATE_TABLE_RELATIONS
CREATE_TABLE_KEYS
IGNORE_XMLSCHEMA_DATATYPES
DISABLE_RECORD_VALIDATION
option - one option to be or'ed together with the
options already set on the recordset.public void clearOption(int option)
ENABLE_UPDATE_ON_INSERT
USE_AUTOINCREMENT
USE_STRICTMATCH
USE_NO_INDENT
USE_NO_UNICITY
USE_SORT_COMBINE
USE_ONE_TO_MANY_UNCOMBINE_METHOD
USE_ISO_TIMESTAMP_FORMAT
SPLIT_OUTPUTXML_FILE
CREATE_TABLE_RELATIONS
CREATE_TABLE_KEYS
IGNORE_XMLSCHEMA_DATATYPES
DISABLE_RECORD_VALIDATION
option - one option to be cleared from the options set on
the recordset.public boolean isOptionSet(int option)
ENABLE_UPDATE_ON_INSERT
USE_AUTOINCREMENT
USE_STRICTMATCH
USE_NO_INDENT
USE_NO_UNICITY
USE_SORT_COMBINE
USE_ONE_TO_MANY_UNCOMBINE_METHOD
USE_ISO_TIMESTAMP_FORMAT
SPLIT_OUTPUTXML_FILE
CREATE_TABLE_RELATIONS
CREATE_TABLE_KEYS
IGNORE_XMLSCHEMA_DATATYPES
DISABLE_RECORD_VALIDATION
option - one option to be tested against the options set on
the recordset.public int getOptions()
public void setBuildPath(java.lang.String buildPath)
build methods.
buildPath - The file names are generated as follows:
buildPath/packageName/className_RecordsetBuilder.java
buildPath/packageName/className_Record.java
public void setClassName(java.lang.String className)
build methods.
className - The file names are generated as follows:
buildPath/packageName/className_RecordsetBuilder.java
buildPath/packageName/className_Record.java
public void setPackageName(java.lang.String packageName)
build methods.
packageName - The file names are generated as follows:
buildPath/packageName/className_RecordsetBuilder.java
buildPath/packageName/className_Record.java
public void build()
throws XMLRecordsetException
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.
XMLRecordsetException - codes
public void build(java.lang.String inputString)
throws XMLRecordsetException
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.
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>
XMLRecordsetException - codes
public void marshalXMLStream()
throws XMLRecordsetException
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.
XMLRecordsetException - codes
public void marshalXMLStream(java.lang.String inputString)
throws XMLRecordsetException
setMapping. A mapping file must define a mapping
for at least an element or attribute, otherwise an error is generated.
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>
XMLRecordsetException - codes
public void unmarshalXMLStream()
throws XMLRecordsetException
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.
XMLRecordsetException - codesINPUTSTREAM_MISSING
INPUTFILE_OPEN_FAILED
OPEN_CONNECTION_FAILED
IO_EXCEPTION
SAXPARSE_FAILED
JAXP_CONFIGURATION_EXCEPTION
JMS_EXCEPTION
CATALOG_EXCEPTION
CONVERSION_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
CLOSE_CURSORS_FAILED
CREATE_TABLE_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
public void unmarshalXMLStream(java.lang.String inputString)
throws XMLRecordsetException
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.
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>XMLRecordsetException - codesINPUTSTREAM_MISSING
INPUTFILE_OPEN_FAILED
OPEN_CONNECTION_FAILED
IO_EXCEPTION
SAXPARSE_FAILED
JAXP_CONFIGURATION_EXCEPTION
JMS_EXCEPTION
CATALOG_EXCEPTION
CONVERSION_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
CLOSE_CURSORS_FAILED
CREATE_TABLE_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
public void unmarshalXMLStream(java.io.InputStream inputStream)
throws XMLRecordsetException
setInputXML and
unmarshalXMLStream() instead.
XMLRecordsetException
public void marshal()
throws XMLRecordsetException
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:
setMapping.
If the mapping file contains no mappings, an error is generated.
setTable
setQuery
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.
XMLRecordsetException - codes
public void marshal(java.io.OutputStream outputStream)
throws XMLRecordsetException
setOutputXML or
setOutputXML_JMS, and
marshal()
instead.
XMLRecordsetException
public void marshal(java.io.OutputStream outputStream,
java.lang.String encoding)
throws XMLRecordsetException
setOutputXML or
setOutputXML_JMS, and
marshal()
instead.
XMLRecordsetException
public void marshal(java.io.Writer writer)
throws XMLRecordsetException
setOutputXML or
setOutputXML_JMS, and
marshal()
instead.
XMLRecordsetException
public void marshalEnd()
throws XMLRecordsetException
XMLRecordsetException - codes
public void unmarshal()
throws XMLRecordsetException
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.
XMLRecordsetException - codes
public void unmarshal(java.lang.String inputString)
throws XMLRecordsetException
unmarshal() for more information.
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>XMLRecordsetException - codes
public void unmarshal(java.io.InputStream inputStream)
throws XMLRecordsetException
setInputXML or
setInputXML_JMS, and
unmarshal()
instead.
XMLRecordsetException
public void unmarshal(java.io.Reader reader)
throws XMLRecordsetException
setInputXML or
setInputXML_JMS, and
unmarshal()
instead.
XMLRecordsetException
public com.hitsw.xml.databinding.XMLRecord unmarshalRecord()
throws XMLRecordsetException
nextRecord instead
XMLRecordsetException
public void open()
throws XMLRecordsetException
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
TRANSACTION_NONE (autocommit) and may be
changed with beginTrans.
XMLRecordsetException - codesopen(int isolation)
public void open(java.lang.String inputString)
throws XMLRecordsetException
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.
TRANSACTION_NONE
(autocommit) and may be changed with beginTrans.
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>XMLRecordsetException - codesopen(String inputString, int isolation)
public void open(int isolation)
throws XMLRecordsetException
setMapping was called,
otherwise it is the query specified using setQuery or
"select * from table" if a table was set using
setTable.
setProvider, setUrl, setUser, setPassword
isolation - the isolation level to use with the JDBC connection.
Allowed values are:
TRANSACTION_NONE
TRANSACTION_READ_COMMITTED
TRANSACTION_READ_UNCOMMITTED
TRANSACTION_REPEATABLE_READ
TRANSACTION_SERIALIZABLE
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.
XMLRecordsetException - codes
public void open(java.lang.String inputString,
int isolation)
throws XMLRecordsetException
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.
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>isolation - the isolation level to use with the JDBC connection.
Allowed values are:
TRANSACTION_NONE
TRANSACTION_READ_COMMITTED
TRANSACTION_READ_UNCOMMITTED
TRANSACTION_REPEATABLE_READ
TRANSACTION_SERIALIZABLE
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.
XMLRecordsetException - codes
public void close()
throws XMLRecordsetException
XMLRecordsetException - codes
public void beginTrans(int isolation)
throws XMLRecordsetException
commitTrans or
rollbackTrans methods.
isolation - the isolation level to use with the JDBC connection.
Allowed values are:
TRANSACTION_READ_COMMITTED
TRANSACTION_READ_UNCOMMITTED
TRANSACTION_REPEATABLE_READ
TRANSACTION_SERIALIZABLE
false and
the specified isolation level is set using the
setTransactionIsolation JDBC method.
XMLRecordsetException - codes
public void commitTrans()
throws XMLRecordsetException
beginTrans.
XMLRecordsetException - codes
public void rollbackTrans()
throws XMLRecordsetException
beginTrans.
XMLRecordsetException - codes
public com.hitsw.xml.databinding.XMLRecord nextRecord()
throws XMLRecordsetException
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.
null if no more records are
available.
XMLRecordsetException - codes
public com.hitsw.xml.databinding.XMLRecord[] nextRecords(int n)
throws XMLRecordsetException
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.
n - the number of XMLRecords to fetch
null.
XMLRecordsetException - codes
public com.hitsw.xml.databinding.XMLRecord newRecord()
throws XMLRecordsetException
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.
XMLRecordsetException - codes
public void open_UnitOfWork()
throws XMLRecordsetException
XMLRecord.insert,
XMLRecord.update or
XMLRecord.delete operations.
Database connection information is obtained from the following methods:
setProvider, setUrl,setUser, setPassword TRANSACTION_NONE (autocommit) and may be
changed with beginTrans_UnitOfWork(int isolation).
XMLRecordsetException - codes
public void open_UnitOfWork(java.lang.String inputString)
throws XMLRecordsetException
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).
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>
XMLRecordsetException - codes
public void open_UnitOfWork(int isolation)
throws XMLRecordsetException
open_UnitOfWork, and starts a transaction using
the specified isolation level
(see beginTrans_UnitOfWork(int) beginTrans_UnitOfWork).
isolation - the isolation level to use with the JDBC connection.
Allowed values are:
XMLRecordsetException - codes
public void open_UnitOfWork(java.lang.String inputString,
int isolation)
throws XMLRecordsetException
open_UnitOfWork, and starts a transaction
using the specified isolation level
(see beginTrans_UnitOfWork(int) beginTrans_UnitOfWork).
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:
XMLRecordsetException - codes
public void close_UnitOfWork()
throws XMLRecordsetException
XMLRecordsetException - codes
public void beginTrans_UnitOfWork(int isolation)
throws XMLRecordsetException
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.
isolation - the isolation level to use with the JDBC connection.
Allowed values are:
TRANSACTION_READ_COMMITTED
TRANSACTION_READ_UNCOMMITTED
TRANSACTION_REPEATABLE_READ
TRANSACTION_SERIALIZABLE
false and
the specified isolation level is set using the
setTransactionIsolation JDBC method.
XMLRecordsetException - codes
public void commitTrans_UnitOfWork()
throws XMLRecordsetException
beginTrans_UnitOfWork.
This method can also be called in a jAllora client application that uses
the jAllora Web Service.
XMLRecordsetException - codes
public void rollbackTrans_UnitOfWork()
throws XMLRecordsetException
beginTrans_UnitOfWork.
This method can also be called in a jAllora client application that uses
the jAllora Web Service.
XMLRecordsetException - codespublic void setUser_JMS(java.lang.String username)
username - the username on whose behalf the JMS connection
is to be established.public void setPassword_JMS(java.lang.String password)
password - the password for the username on whose behalf the JMS
connection is to be established.
public void setOutputXML_JMS(java.lang.String factoryName,
java.lang.String queueName)
throws XMLRecordsetException
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.
factoryName - the factory namequeueName - the queue name
XMLRecordsetException - codessetEncoding
public void setOutputXML_JMS(java.lang.String factoryName,
java.lang.String queueName,
java.lang.String encoding)
throws XMLRecordsetException
factoryName - the factory namequeueName - the queue nameencoding - the encoding to use for characters to bytes encoding.
XMLRecordsetException - codes
public void setOutputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms)
throws XMLRecordsetException
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.
xmljms - a XMLJMS object
XMLRecordsetException - codessetEncoding
public void setOutputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms,
java.lang.String encoding)
throws XMLRecordsetException
xmljms - a XMLJMS objectencoding - the encoding to use for characters to bytes encoding.
XMLRecordsetException - codespublic void setInputXML_JMS(com.hitsw.xml.jms.XMLJMS xmljms)
xmljms - the XMLJMS object
public void setInputXML_JMS(java.lang.String factoryName,
java.lang.String queueName)
throws XMLRecordsetException
factoryName - the factory namequeueName - the queue name
XMLRecordsetException - codes
public void unmarshalXMLStream(com.hitsw.xml.jms.XMLListener xmlListener)
throws XMLRecordsetException
unmarshalXMLStream()
except that an XMLListener is handling asynchronous receives from a
queue.
xmlListener - a XMLListener object.
XMLRecordsetException - codesINPUTSTREAM_MISSING
INPUTFILE_OPEN_FAILED
OPEN_CONNECTION_FAILED
IO_EXCEPTION
SAXPARSE_FAILED
JAXP_CONFIGURATION_EXCEPTION
JMS_EXCEPTION
CATALOG_EXCEPTION
CONVERSION_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
CLOSE_CURSORS_FAILED
CREATE_TABLE_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
public void unmarshalXMLStream(java.lang.String inputString,
com.hitsw.xml.jms.XMLListener xmlListener)
throws XMLRecordsetException
unmarshalXMLStream(String inputString),
except that an XMLListener is handling asynchronous receives from a
queue.
inputString - the
inputString.xmlListener - a XMLListener object.
XMLRecordsetException - codesINPUTSTREAM_MISSING
INPUTFILE_OPEN_FAILED
OPEN_CONNECTION_FAILED
IO_EXCEPTION
SAXPARSE_FAILED
JAXP_CONFIGURATION_EXCEPTION
JMS_EXCEPTION
CATALOG_EXCEPTION
CONVERSION_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
CLOSE_CURSORS_FAILED
CREATE_TABLE_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
public void deleteInstance()
throws XMLRecordsetException
XMLRecordsetException - codespublic com.hitsw.xml.databinding.XMLColumnInfo getColumnInfo()
XMLColumnInfo objectpublic com.hitsw.xml.databinding.XMLColumnValues getColumnValues()
XMLColumnValues objectpublic com.hitsw.xml.databinding.XMLConnectionInfo getConnectionInfo()
XMLConnectionInfo object.
public void setMapping(com.hitsw.xml.databinding.XMLSchemaMapper xmlMap)
throws XMLRecordsetException
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.
XMLRecordsetException - An exception is thrown if the recordset is open.
public com.hitsw.xml.databinding.XMLSchemaMapper getMapping()
throws XMLRecordsetException
XMLSchemaMapper object previously set with
setMapping.
XMLSchemaMapper object.
XMLRecordsetException
public org.w3c.dom.Element sendUpdategram(org.w3c.dom.Element updategram)
throws XMLRecordsetException
sendUpdategram(Element, int) instead.
XMLRecordsetException
public org.w3c.dom.Element sendUpdategram(org.w3c.dom.Element updategram,
java.util.Map params)
throws XMLRecordsetException
sendUpdategram(Element, Map, int) instead.
XMLRecordsetException
public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(org.w3c.dom.Element updategram,
int isolation)
throws XMLRecordsetException
setProvider, setUrl,setUser, setPassword
updategram - a DOM element representing an XML updategram as
specified by Microsoft.isolation - the isolation level to use, one of:
UpdategramResults interfaces, one for each
sync block in the updategram, describing the results of the
execution of the updategram.
XMLRecordsetException - codesTRANSNOTSTARTED_ERROR
COMMITTRANS_FAILED
CONNECTION_NOT_OPEN
CONNECTION_SET_TO_AUTOCOMMIT
TRANSNOTSTARTED_ERROR
CONVERSION_EXCEPTION
CATALOG_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
UPDATE_STMT_INVALID
UPDATE_PREPARESTMT_FAILED
DELETE_STMT_INVALID
DELETE_PREPARESTMT_FAILED
INSERT_FAILED
UPDATE_FAILED
DELETE_FAILED
public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(org.w3c.dom.Element updategram,
java.util.Map params,
int isolation)
throws XMLRecordsetException
params Map object.
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:
UpdategramResults interfaces, one for each
sync block in the updategram, describing the results of the
execution of the updategram.
XMLRecordsetException - codesTRANSNOTSTARTED_ERROR
COMMITTRANS_FAILED
CONNECTION_NOT_OPEN
CONNECTION_SET_TO_AUTOCOMMIT
TRANSNOTSTARTED_ERROR
CATALOG_EXCEPTION
CONVERSION_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
UPDATE_STMT_INVALID
UPDATE_PREPARESTMT_FAILED
DELETE_STMT_INVALID
DELETE_PREPARESTMT_FAILED
INSERT_FAILED
UPDATE_FAILED
DELETE_FAILED
public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(java.lang.String updategram,
int isolation)
throws XMLRecordsetException
setProvider, setUrl,setUser, setPassword
updategram - a file name containing the XML updategram.isolation - the isolation level to use, one of:
UpdategramResults interfaces, one for each
sync block in the updategram, describing the results of the
execution of the updategram.
XMLRecordsetException - codesTRANSNOTSTARTED_ERROR
COMMITTRANS_FAILED
CONNECTION_NOT_OPEN
CONNECTION_SET_TO_AUTOCOMMIT
TRANSNOTSTARTED_ERROR
CONVERSION_EXCEPTION
CATALOG_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
UPDATE_STMT_INVALID
UPDATE_PREPARESTMT_FAILED
DELETE_STMT_INVALID
DELETE_PREPARESTMT_FAILED
INSERT_FAILED
UPDATE_FAILED
DELETE_FAILED
public com.hitsw.xml.databinding.UpdategramResults[] sendUpdategram(java.lang.String updategram,
java.util.Map params,
int isolation)
throws XMLRecordsetException
params Map object.
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:
UpdategramResults interfaces, one for each
sync block in the updategram, describing the results of the
execution of the updategram.
XMLRecordsetException - codesTRANSNOTSTARTED_ERROR
COMMITTRANS_FAILED
CONNECTION_NOT_OPEN
CONNECTION_SET_TO_AUTOCOMMIT
TRANSNOTSTARTED_ERROR
CATALOG_EXCEPTION
CONVERSION_EXCEPTION
INVALID_COLUMNINFO
EXECUTE_STATEMENT_FAILED
SETPARAMETER_FAILED
INSERT_STMT_INVALID
INSERT_PREPARESTMT_FAILED
UPDATE_STMT_INVALID
UPDATE_PREPARESTMT_FAILED
DELETE_STMT_INVALID
DELETE_PREPARESTMT_FAILED
INSERT_FAILED
UPDATE_FAILED
DELETE_FAILED
public void setNullValue(java.lang.String nullValue)
throws XMLRecordsetException
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.
nullValue - the value to substitute for null.
XMLRecordsetExceptionpublic java.lang.String getNullValue()
null value in an XML
document, see setNullValue.
setNullValue or
the empty string by default.
public void setEmptyStringValue(java.lang.String emptyStringValue)
throws XMLRecordsetException
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.
emptyStringValue - string value representing an empty string
in the database. The default value is "" (empty string).
XMLRecordsetException - codespublic java.lang.String getEmptyStringValue()
setEmptyStringValue.
setEmptyStringValue or the empty string default value.
public void setColumnUnicity(int index,
int mode)
throws XMLRecordsetException
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.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.USE_NO_UNICITY option.
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.
XMLRecordsetException - codespublic void setBlockInsertSize(int size)
UNIQUE_DBMS.
size - size of the insert buffer.public void setHttpUser(java.lang.String httpUser)
httpUser - the user name to use in connecting to a URL, if not set
or null an anonymous access will be used.marshalXMLStream,
unmarshalXMLStreampublic void setHttpPassword(java.lang.String httpPassword)
httpPassword - the password to connect to the URLs.marshalXMLStream,
unmarshalXMLStreampublic void setSchema(java.lang.String schema)
DISABLE_RECORD_VALIDATION is set.
schema - full path of a schema file or URL.
public void setConnection(java.sql.Connection conn)
throws XMLRecordsetException
conn - an opened JDBC connection, or null to remove from this
recordset all references to a Connection object that was
previously set using setConnection.
XMLRecordsetExceptionsetProvider,
setUrlpublic java.sql.Connection getConnection()
null is returned. If setConnection
was previously called then the external Connection object set by the
setConnection method is returned.
public void setRootName(java.lang.String rootName)
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.
rootName - the name of the top level element of the marshal
ouptput XML.
public void runXQuery(java.lang.String xquery,
boolean useDBPredicates,
boolean useFullMapping)
throws XMLRecordsetException
xquery - the xquery string to executeuseDBPredicates - 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
XMLRecordsetException
public void marshalOVLT(java.lang.String inputString,
java.lang.String logFileName)
throws XMLRecordsetException
XMLSchemaMapper.setMarshalLookups
inputString - specifies the input string as in marshalXMLStreamlogFileName - the name of a log file where to report missing
entries in the lookups.
XMLRecordsetException
public void unmarshalOVLT(java.lang.String inputString,
java.lang.String logFileName)
throws XMLRecordsetException
XMLSchemaMapper.setUnmarshalLookups
inputString - specifies the input string as in unmarshalXMLStreamlogFileName - the name of a log file where to report missing
entries in the lookup file.
XMLRecordsetException
public void unmarshalOVLTToCSV(java.lang.String inputString,
java.lang.String logFileName,
boolean gerateOracleCtrlFile)
throws XMLRecordsetException
inputString - specifies the input string as in unmarshalXMLStreamlogFileName - 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.
XMLRecordsetExceptionunmarshalOVLT(String, String)
for more details.
public void skipEntityInInputXML(java.lang.String publicId,
java.lang.String systemId)
publicId and systemId will not be resolved
while parsing the inputXML.
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.public java.lang.String[][] getSkipEntityInInputXML()
skipEntityInInputXML method.
null value is returned
if no previous call to
skipEntityInInputXML have been
made.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||