Download Stylus Studio - The World's Best XML Development Environment!


com.ddtek.jxtr
Class JXTRUpdate

java.lang.Object
  |
  +--com.ddtek.jxtr.JXTRBase
        |
        +--com.ddtek.jxtr.JXTRUpdateBase
              |
              +--com.ddtek.jxtr.JXTRUpdate

public class JXTRUpdate
extends JXTRUpdateBase

Updates one or multiple database tables using data from an XML input document and a jXTransformer write statement string.


Field Summary
 
Fields inherited from class com.ddtek.jxtr.JXTRBase
BINARY_AS_BASE64, BINARY_AS_HEX, TIMESTAMP_AS_ISO8601, TIMESTAMP_AS_ODBC
 
Constructor Summary
JXTRUpdate(java.sql.Connection con, java.lang.String jxtrStat)
          Creates a new JXTRUpdate statement.
 
Method Summary
 void close()
          Closes database prepared statement(s).
 int[][] executeUpdate()
          Executes the jXTransformer write statement.
 void setDOM(int paramIx, org.w3c.dom.Document doc)
          Sets the XML input document from a DOM document.
 void setDOM(int paramIx, org.w3c.dom.Node node)
          Sets the XML input document from a DOM node.
 void setJDOM(int paramIx, org.jdom.Element element)
          Sets the XML input document from a JDOM element.
 void setReader(int paramIx, java.io.Reader reader)
          Sets the XML input document from a I/O reader.
 void setSAX(int paramIx, org.xml.sax.InputSource input)
          Sets the XML input document from a SAX input source.
 
Methods inherited from class com.ddtek.jxtr.JXTRUpdateBase
getBatchSize, getBinaryEncoding, getNullRepresentationValue, getTimestampEncoding, getUseNullReplacementWithNullRepresentation, setBatchSize, setBigDecimal, setBinaryEncoding, setBoolean, setByte, setBytes, setDate, setDouble, setFloat, setInt, setLong, setNull, setNullReplacementValue, setNullRepresentationValue, setObject, setObject, setObject, setShort, setString, setTime, setTimestamp, setTimestampEncoding, setUseNullReplacementWithNullRepresentation
 
Methods inherited from class com.ddtek.jxtr.JXTRBase
clearWarnings, getPreparedStatementCloseBehaviour, getWarnings, setPreparedStatementCloseBehaviour, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JXTRUpdate

public JXTRUpdate(java.sql.Connection con,
                  java.lang.String jxtrStat)
           throws JXTRException
Creates a new JXTRUpdate statement.

Parameters:
con - The JDBC connection.
jxtrStat - jXTransformer write statement string (either Insert, Update, or Delete statement).
Throws:
java.lang.IllegalArgumentException - if con or jxtrSql is NULL.
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
See Also:
JXTRException
Method Detail

close

public void close()
           throws JXTRException
Description copied from class: JXTRBase
Closes database prepared statement(s).

Specified by:
close in class JXTRBase
Throws:
JXTRException - if an error occured during closing of resources or database statement(s).

executeUpdate

public int[][] executeUpdate()
                      throws JXTRException,
                             JXTRUpdateException
Executes the jXTransformer write statement.

Returns:
a 2D array of update counts. The order of the int[] elements in the returned array correspond to the database tables. The database tables are ordered according to the order they were specified in the jXTransformer write statement. The order of the int elements in the returned array correspond to the update of each set of row column values in the XML row pattern. The int elements in the returned array are the same as the int elements returned by java.sql.Statement#executeBatch().
Throws:
JXTRException - Refer to the JXTRException class for more information about possible error conditions.
JXTRUpdateException - Refer to the JXTRUpdateException class for more information about possible error conditions and retrieving update counts.
See Also:
java.sql.Statement#executeBatch().

setDOM

public void setDOM(int paramIx,
                   org.w3c.dom.Document doc)
Sets the XML input document from a DOM document. This method can only be used for setting the value of the url parameter in the xml_document clause.

Parameters:
paramIx - Index of parameter to set (1 based).
doc - The DOM document node that contains the XML input.
Throws:
java.lang.IllegalArgumentException - if node is NULL.

setDOM

public void setDOM(int paramIx,
                   org.w3c.dom.Node node)
Sets the XML input document from a DOM node. This method can only be used for setting the value of the url parameter in the xml_document clause.

Parameters:
paramIx - Index of parameter to set (1 based).
node - The DOM node that contains the XML input.
Throws:
java.lang.IllegalArgumentException - if node is NULL.

setSAX

public void setSAX(int paramIx,
                   org.xml.sax.InputSource input)
Sets the XML input document from a SAX input source. This method can only be used for setting the value of the url parameter in the xml_document clause.

Parameters:
paramIx - Index of parameter to set (1 based).
input - The SAX input source that contains the XML input.
Throws:
java.lang.IllegalArgumentException - if input is null.

setJDOM

public void setJDOM(int paramIx,
                    org.jdom.Element element)
Sets the XML input document from a JDOM element. This method can only be used for setting the value of the url parameter in the xml_document clause.

Parameters:
paramIx - Index of parameter to set (1 based).
element - The JDOM element that contains the XML input.
Throws:
java.lang.IllegalArgumentException - if element is NULL.

setReader

public void setReader(int paramIx,
                      java.io.Reader reader)
Sets the XML input document from a I/O reader. This method can only be used for setting the value of the url parameter in the xml_document clause.

Parameters:
paramIx - Index of parameter to set (1 based).
reader - The I/O reader that contains the XML input.
Throws:
java.lang.IllegalArgumentException - if reader is null.


Stylus Studio features SQL/XML tools for building XML views of relational data.