org.webdocwf.util.xml
Class XmlPreparedStatement

java.lang.Object
  extended byorg.webdocwf.util.xml.XmlPreparedStatement
All Implemented Interfaces:
java.sql.PreparedStatement, java.sql.Statement

public class XmlPreparedStatement
extends java.lang.Object
implements java.sql.PreparedStatement

Class implements the JDBC PreparedStatement interface for the XmlJdbc driver.

Author:
Zoran Milakovic

Field Summary
static java.lang.String PREPARE_SEPARATOR
           
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
XmlPreparedStatement(XmlConnection connection, java.lang.String preparedSql)
           
 
Method Summary
 void addBatch()
           
 void addBatch(java.lang.String p0)
          Adds a feature to the Batch attribute of the XmlStatement object
 void cancel()
          Description of the Method
 void clearBatch()
          Description of the Method
 void clearParameters()
           
 void clearWarnings()
          Description of the Method
 void close()
          Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.
 boolean execute()
           
 boolean execute(java.lang.String sql)
          Description of the Method
 boolean execute(java.lang.String sql, int autoGeneratedKeys)
           
 boolean execute(java.lang.String sql, int[] columnIndexes)
           
 boolean execute(java.lang.String sql, java.lang.String[] columnNames)
           
 int[] executeBatch()
          Description of the Method
 java.sql.ResultSet executeQuery()
           
 java.sql.ResultSet executeQuery(java.lang.String sql)
           
 int executeUpdate()
           
 int executeUpdate(java.lang.String sql)
          Insert data into XML database
 int executeUpdate(java.lang.String sql, int autoGeneratedKeys)
           
 int executeUpdate(java.lang.String sql, int[] columnIndexes)
           
 int executeUpdate(java.lang.String sql, java.lang.String[] columnNames)
           
 java.sql.Connection getConnection()
          Gets the connection attribute of the XmlStatement object
 int getFetchDirection()
          Gets the fetchDirection attribute of the XmlStatement object
 int getFetchSize()
          Gets the fetchSize attribute of the XmlStatement object
 java.sql.ResultSet getGeneratedKeys()
           
 int getMaxFieldSize()
          Gets the maxFieldSize attribute of the XmlStatement object
 int getMaxRows()
          Gets the maxRows attribute of the XmlStatement object
 java.sql.ResultSetMetaData getMetaData()
           
 boolean getMoreResults()
          Gets the moreResults attribute of the XmlStatement object
 boolean getMoreResults(int current)
           
 java.sql.ParameterMetaData getParameterMetaData()
           
 int getQueryTimeout()
          Gets the queryTimeout attribute of the XmlStatement object
 java.sql.ResultSet getResultSet()
          Gets the resultSet attribute of the XmlStatement object
 int getResultSetConcurrency()
          Gets the resultSetConcurrency attribute of the XmlStatement object
 int getResultSetHoldability()
           
 int getResultSetType()
          Gets the resultSetType attribute of the XmlStatement object
 int getUpdateCount()
          Gets the updateCount attribute of the XmlStatement object
 java.sql.SQLWarning getWarnings()
          Gets the warnings attribute of the XmlStatement object
 void setArray(int i, java.sql.Array x)
           
 void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
           
 void setBigDecimal(int parameterIndex, java.math.BigDecimal value)
           
 void setBinaryStream(int parameterIndex, java.io.InputStream value, int length)
           
 void setBlob(int parameterIndex, java.sql.Blob value)
           
 void setBoolean(int parameterIndex, boolean value)
           
 void setByte(int parameterIndex, byte value)
           
 void setBytes(int parameterIndex, byte[] value)
           
 void setCharacterStream(int parameterIndex, java.io.Reader reader, int length)
           
 void setClob(int i, java.sql.Clob x)
           
 void setCursorName(java.lang.String p0)
          Sets the cursorName attribute of the XmlStatement object
 void setDate(int parameterIndex, java.sql.Date value)
           
 void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal)
           
 void setDouble(int parameterIndex, double value)
           
 void setEscapeProcessing(boolean p0)
          Sets the escapeProcessing attribute of the XmlStatement object
 void setFetchDirection(int p0)
          Sets the fetchDirection attribute of the XmlStatement object
 void setFetchSize(int p0)
          Sets the fetchSize attribute of the XmlStatement object
 void setFloat(int parameterIndex, float value)
           
 void setInt(int parameterIndex, int value)
           
 void setLong(int parameterIndex, long value)
           
 void setMaxFieldSize(int p0)
          Sets the maxFieldSize attribute of the XmlStatement object
 void setMaxRows(int p0)
          Sets the maxRows attribute of the XmlStatement object
 void setNull(int parameterIndex, int sqlType)
           
 void setNull(int paramIndex, int sqlType, java.lang.String typeName)
           
 void setObject(int parameterIndex, java.lang.Object x)
           
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType)
           
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale)
           
 void setQueryTimeout(int p0)
          Sets the queryTimeout attribute of the XmlStatement object
 void setRef(int i, java.sql.Ref x)
           
 void setShort(int parameterIndex, short value)
           
 void setString(int parameterIndex, java.lang.String value)
          Set String as parameter in sql statement.
 void setTime(int parameterIndex, java.sql.Time value)
           
 void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)
           
 void setTimestamp(int parameterIndex, java.sql.Timestamp value)
           
 void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal)
           
 void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length)
           
 void setURL(int parameterIndex, java.net.URL x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREPARE_SEPARATOR

public static java.lang.String PREPARE_SEPARATOR
Constructor Detail

XmlPreparedStatement

public XmlPreparedStatement(XmlConnection connection,
                            java.lang.String preparedSql)
Method Detail

setMaxFieldSize

public void setMaxFieldSize(int p0)
                     throws java.sql.SQLException
Sets the maxFieldSize attribute of the XmlStatement object

Specified by:
setMaxFieldSize in interface java.sql.Statement
Parameters:
p0 - The new maxFieldSize value
Throws:
java.sql.SQLException - Description of Exception
Since:

setMaxRows

public void setMaxRows(int p0)
                throws java.sql.SQLException
Sets the maxRows attribute of the XmlStatement object

Specified by:
setMaxRows in interface java.sql.Statement
Parameters:
p0 - The new maxRows value
Throws:
java.sql.SQLException - Description of Exception
Since:

setEscapeProcessing

public void setEscapeProcessing(boolean p0)
                         throws java.sql.SQLException
Sets the escapeProcessing attribute of the XmlStatement object

Specified by:
setEscapeProcessing in interface java.sql.Statement
Parameters:
p0 - The new escapeProcessing value
Throws:
java.sql.SQLException - Description of Exception
Since:

setQueryTimeout

public void setQueryTimeout(int p0)
                     throws java.sql.SQLException
Sets the queryTimeout attribute of the XmlStatement object

Specified by:
setQueryTimeout in interface java.sql.Statement
Parameters:
p0 - The new queryTimeout value
Throws:
java.sql.SQLException - Description of Exception
Since:

setCursorName

public void setCursorName(java.lang.String p0)
                   throws java.sql.SQLException
Sets the cursorName attribute of the XmlStatement object

Specified by:
setCursorName in interface java.sql.Statement
Parameters:
p0 - The new cursorName value
Throws:
java.sql.SQLException - Description of Exception
Since:

setFetchDirection

public void setFetchDirection(int p0)
                       throws java.sql.SQLException
Sets the fetchDirection attribute of the XmlStatement object

Specified by:
setFetchDirection in interface java.sql.Statement
Parameters:
p0 - The new fetchDirection value
Throws:
java.sql.SQLException - Description of Exception
Since:

setFetchSize

public void setFetchSize(int p0)
                  throws java.sql.SQLException
Sets the fetchSize attribute of the XmlStatement object

Specified by:
setFetchSize in interface java.sql.Statement
Parameters:
p0 - The new fetchSize value
Throws:
java.sql.SQLException - Description of Exception
Since:

getMaxFieldSize

public int getMaxFieldSize()
                    throws java.sql.SQLException
Gets the maxFieldSize attribute of the XmlStatement object

Specified by:
getMaxFieldSize in interface java.sql.Statement
Returns:
The maxFieldSize value
Throws:
java.sql.SQLException - Description of Exception
Since:

getMaxRows

public int getMaxRows()
               throws java.sql.SQLException
Gets the maxRows attribute of the XmlStatement object

Specified by:
getMaxRows in interface java.sql.Statement
Returns:
The maxRows value
Throws:
java.sql.SQLException - Description of Exception
Since:

getQueryTimeout

public int getQueryTimeout()
                    throws java.sql.SQLException
Gets the queryTimeout attribute of the XmlStatement object

Specified by:
getQueryTimeout in interface java.sql.Statement
Returns:
The queryTimeout value
Throws:
java.sql.SQLException - Description of Exception
Since:

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Gets the warnings attribute of the XmlStatement object

Specified by:
getWarnings in interface java.sql.Statement
Returns:
The warnings value
Throws:
java.sql.SQLException - Description of Exception
Since:

getResultSet

public java.sql.ResultSet getResultSet()
                                throws java.sql.SQLException
Gets the resultSet attribute of the XmlStatement object

Specified by:
getResultSet in interface java.sql.Statement
Returns:
The resultSet value
Throws:
java.sql.SQLException - Description of Exception
Since:

getUpdateCount

public int getUpdateCount()
                   throws java.sql.SQLException
Gets the updateCount attribute of the XmlStatement object

Specified by:
getUpdateCount in interface java.sql.Statement
Returns:
The updateCount value
Throws:
java.sql.SQLException - Description of Exception
Since:

getMoreResults

public boolean getMoreResults()
                       throws java.sql.SQLException
Gets the moreResults attribute of the XmlStatement object

Specified by:
getMoreResults in interface java.sql.Statement
Returns:
The moreResults value
Throws:
java.sql.SQLException - Description of Exception
Since:

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
Gets the fetchDirection attribute of the XmlStatement object

Specified by:
getFetchDirection in interface java.sql.Statement
Returns:
The fetchDirection value
Throws:
java.sql.SQLException - Description of Exception
Since:

getFetchSize

public int getFetchSize()
                 throws java.sql.SQLException
Gets the fetchSize attribute of the XmlStatement object

Specified by:
getFetchSize in interface java.sql.Statement
Returns:
The fetchSize value
Throws:
java.sql.SQLException - Description of Exception
Since:

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws java.sql.SQLException
Gets the resultSetConcurrency attribute of the XmlStatement object

Specified by:
getResultSetConcurrency in interface java.sql.Statement
Returns:
The resultSetConcurrency value
Throws:
java.sql.SQLException - Description of Exception
Since:

getResultSetType

public int getResultSetType()
                     throws java.sql.SQLException
Gets the resultSetType attribute of the XmlStatement object

Specified by:
getResultSetType in interface java.sql.Statement
Returns:
The resultSetType value
Throws:
java.sql.SQLException - Description of Exception
Since:

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Gets the connection attribute of the XmlStatement object

Specified by:
getConnection in interface java.sql.Statement
Returns:
The connection value
Throws:
java.sql.SQLException - Description of Exception
Since:

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String sql)
                                throws java.sql.SQLException
Specified by:
executeQuery in interface java.sql.Statement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String sql)
                  throws java.sql.SQLException
Insert data into XML database

Specified by:
executeUpdate in interface java.sql.Statement
Parameters:
sql - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.sql.SQLException - Description of Exception
Since:

close

public void close()
           throws java.sql.SQLException
Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources.

Calling the method close on a Statement object that is already closed has no effect.

Note: A Statement object is automatically closed when it is garbage collected. When a Statement object is closed, its current ResultSet object, if one exists, is also closed.

Specified by:
close in interface java.sql.Statement
Throws:
java.sql.SQLException - if a database access error occurs

cancel

public void cancel()
            throws java.sql.SQLException
Description of the Method

Specified by:
cancel in interface java.sql.Statement
Throws:
java.sql.SQLException - Description of Exception
Since:

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Description of the Method

Specified by:
clearWarnings in interface java.sql.Statement
Throws:
java.sql.SQLException - Description of Exception
Since:

execute

public boolean execute(java.lang.String sql)
                throws java.sql.SQLException
Description of the Method

Specified by:
execute in interface java.sql.Statement
Parameters:
sql - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.sql.SQLException - Description of Exception
Since:

setString

public void setString(int parameterIndex,
                      java.lang.String value)
               throws java.sql.SQLException
Set String as parameter in sql statement.

Specified by:
setString in interface java.sql.PreparedStatement
Parameters:
parameterIndex -
value -
Throws:
java.sql.SQLException

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            java.io.InputStream value,
                            int length)
                     throws java.sql.SQLException
Specified by:
setBinaryStream in interface java.sql.PreparedStatement
Parameters:
parameterIndex -
value -
Throws:
java.sql.SQLException

setBytes

public void setBytes(int parameterIndex,
                     byte[] value)
              throws java.sql.SQLException
Specified by:
setBytes in interface java.sql.PreparedStatement
Parameters:
parameterIndex -
value -
Throws:
java.sql.SQLException

setBlob

public void setBlob(int parameterIndex,
                    java.sql.Blob value)
             throws java.sql.SQLException
Specified by:
setBlob in interface java.sql.PreparedStatement
Parameters:
parameterIndex -
value -
Throws:
java.sql.SQLException

addBatch

public void addBatch(java.lang.String p0)
              throws java.sql.SQLException
Adds a feature to the Batch attribute of the XmlStatement object

Specified by:
addBatch in interface java.sql.Statement
Parameters:
p0 - The feature to be added to the Batch attribute
Throws:
java.sql.SQLException - Description of Exception
Since:

clearBatch

public void clearBatch()
                throws java.sql.SQLException
Description of the Method

Specified by:
clearBatch in interface java.sql.Statement
Throws:
java.sql.SQLException - Description of Exception
Since:

executeBatch

public int[] executeBatch()
                   throws java.sql.SQLException
Description of the Method

Specified by:
executeBatch in interface java.sql.Statement
Returns:
Description of the Returned Value
Throws:
java.sql.SQLException - Description of Exception
Since:

getMoreResults

public boolean getMoreResults(int current)
                       throws java.sql.SQLException
Specified by:
getMoreResults in interface java.sql.Statement
Throws:
java.sql.SQLException

getGeneratedKeys

public java.sql.ResultSet getGeneratedKeys()
                                    throws java.sql.SQLException
Specified by:
getGeneratedKeys in interface java.sql.Statement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String sql,
                         int autoGeneratedKeys)
                  throws java.sql.SQLException
Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String sql,
                         int[] columnIndexes)
                  throws java.sql.SQLException
Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String sql,
                         java.lang.String[] columnNames)
                  throws java.sql.SQLException
Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String sql,
                       int autoGeneratedKeys)
                throws java.sql.SQLException
Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String sql,
                       int[] columnIndexes)
                throws java.sql.SQLException
Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String sql,
                       java.lang.String[] columnNames)
                throws java.sql.SQLException
Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException

getResultSetHoldability

public int getResultSetHoldability()
                            throws java.sql.SQLException
Specified by:
getResultSetHoldability in interface java.sql.Statement
Throws:
java.sql.SQLException

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException
Specified by:
executeQuery in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Specified by:
executeUpdate in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws java.sql.SQLException
Specified by:
setNull in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setBoolean

public void setBoolean(int parameterIndex,
                       boolean value)
                throws java.sql.SQLException
Specified by:
setBoolean in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setByte

public void setByte(int parameterIndex,
                    byte value)
             throws java.sql.SQLException
Specified by:
setByte in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setShort

public void setShort(int parameterIndex,
                     short value)
              throws java.sql.SQLException
Specified by:
setShort in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setInt

public void setInt(int parameterIndex,
                   int value)
            throws java.sql.SQLException
Specified by:
setInt in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setLong

public void setLong(int parameterIndex,
                    long value)
             throws java.sql.SQLException
Specified by:
setLong in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setFloat

public void setFloat(int parameterIndex,
                     float value)
              throws java.sql.SQLException
Specified by:
setFloat in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setDouble

public void setDouble(int parameterIndex,
                      double value)
               throws java.sql.SQLException
Specified by:
setDouble in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          java.math.BigDecimal value)
                   throws java.sql.SQLException
Specified by:
setBigDecimal in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setDate

public void setDate(int parameterIndex,
                    java.sql.Date value)
             throws java.sql.SQLException
Specified by:
setDate in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setTime

public void setTime(int parameterIndex,
                    java.sql.Time value)
             throws java.sql.SQLException
Specified by:
setTime in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int parameterIndex,
                         java.sql.Timestamp value)
                  throws java.sql.SQLException
Specified by:
setTimestamp in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           java.io.InputStream x,
                           int length)
                    throws java.sql.SQLException
Specified by:
setAsciiStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             java.io.InputStream x,
                             int length)
                      throws java.sql.SQLException
Specified by:
setUnicodeStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

clearParameters

public void clearParameters()
                     throws java.sql.SQLException
Specified by:
clearParameters in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x,
                      int targetSqlType,
                      int scale)
               throws java.sql.SQLException
Specified by:
setObject in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x,
                      int targetSqlType)
               throws java.sql.SQLException
Specified by:
setObject in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x)
               throws java.sql.SQLException
Specified by:
setObject in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

execute

public boolean execute()
                throws java.sql.SQLException
Specified by:
execute in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

addBatch

public void addBatch()
              throws java.sql.SQLException
Specified by:
addBatch in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setCharacterStream

public void setCharacterStream(int parameterIndex,
                               java.io.Reader reader,
                               int length)
                        throws java.sql.SQLException
Specified by:
setCharacterStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setRef

public void setRef(int i,
                   java.sql.Ref x)
            throws java.sql.SQLException
Specified by:
setRef in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setClob

public void setClob(int i,
                    java.sql.Clob x)
             throws java.sql.SQLException
Specified by:
setClob in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setArray

public void setArray(int i,
                     java.sql.Array x)
              throws java.sql.SQLException
Specified by:
setArray in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException
Specified by:
getMetaData in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setDate

public void setDate(int parameterIndex,
                    java.sql.Date x,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Specified by:
setDate in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setTime

public void setTime(int parameterIndex,
                    java.sql.Time x,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Specified by:
setTime in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int parameterIndex,
                         java.sql.Timestamp x,
                         java.util.Calendar cal)
                  throws java.sql.SQLException
Specified by:
setTimestamp in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setNull

public void setNull(int paramIndex,
                    int sqlType,
                    java.lang.String typeName)
             throws java.sql.SQLException
Specified by:
setNull in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setURL

public void setURL(int parameterIndex,
                   java.net.URL x)
            throws java.sql.SQLException
Specified by:
setURL in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

getParameterMetaData

public java.sql.ParameterMetaData getParameterMetaData()
                                                throws java.sql.SQLException
Specified by:
getParameterMetaData in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException


Copyright © 2002-2007 Together - the Workgroup. All Rights Reserved.