Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.jdbc
Class EmbedPreparedStatement  view EmbedPreparedStatement download EmbedPreparedStatement.java

java.lang.Object
  extended byorg.apache.derby.impl.jdbc.ConnectionChild
      extended byorg.apache.derby.impl.jdbc.EmbedStatement
          extended byorg.apache.derby.impl.jdbc.EmbedPreparedStatement
All Implemented Interfaces:
java.sql.PreparedStatement, java.sql.Statement
Direct Known Subclasses:
EmbedCallableStatement, EmbedPreparedStatement169, EmbedPreparedStatement20

public abstract class EmbedPreparedStatement
extends EmbedStatement
implements java.sql.PreparedStatement

EmbedPreparedStatement is a local JDBC statement.

Supports


Field Summary
private  org.apache.derby.iapi.sql.Activation activation
           
private  java.lang.String gcDuringGetMetaData
           
protected  org.apache.derby.iapi.sql.PreparedStatement preparedStatement
           
protected  java.sql.ResultSetMetaData rMetaData
           
 
Fields inherited from class org.apache.derby.impl.jdbc.EmbedStatement
active, batchStatements, CLOSE, cursorName, factory, forMetaData, lcc, localConn, MaxFieldSize, maxRows, NOCLOSE, results, resultSetConcurrency, resultSetHoldability, resultSetType, SQLText, updateCount
 
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
EmbedPreparedStatement(EmbedConnection conn, java.lang.String sql, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, int[] columnIndexes, java.lang.String[] columnNames)
           
 
Method Summary
 void addBatch()
          JDBC 2.0 Add a set of parameters to the batch.
 void addBatch(java.lang.String sql)
          This method adds a SQL statement to a SQL batch.
 void clearParameters()
          In general, parameter values remain in force for repeated use of a Statement.
protected  void closeActions()
          Additional close to close our activation.
protected  java.sql.SQLException dataTypeConversion(int column, java.lang.String sourceType)
           
 boolean execute()
          This method executes a prepared SQL query.
 boolean execute(java.lang.String sql)
          This method executes an arbitrary SQL statement of any time.
 boolean execute(java.lang.String sql, int autoGenKeys)
          JDBC 3.0 Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.
 boolean execute(java.lang.String sql, int[] columnIndexes)
          JDBC 3.0 Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
 boolean execute(java.lang.String sql, java.lang.String[] columnNames)
          JDBC 3.0 Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
protected  boolean executeBatchElement(java.lang.Object batchElement)
          Execute a single element of the batch.
 java.sql.ResultSet executeQuery()
          A prepared SQL query is executed and its ResultSet is returned.
 java.sql.ResultSet executeQuery(java.lang.String sql)
          This method executes the specified SQL SELECT statement and returns a (possibly empty) ResultSet with the results of the query.
protected  boolean executeStatement(org.apache.derby.iapi.sql.Activation a, boolean executeQuery, boolean executeUpdate)
          Execute the current statement.
 int executeUpdate()
          Execute a SQL INSERT, UPDATE or DELETE statement.
 int executeUpdate(java.lang.String sql)
          This method executes the specified SQL INSERT, UPDATE, or DELETE statement and returns the number of rows affected, which may be 0.
 int executeUpdate(java.lang.String sql, int autoGenKeys)
          JDBC 3.0 Execute the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.
 int executeUpdate(java.lang.String sql, int[] columnIndexes)
          JDBC 3.0 Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
 int executeUpdate(java.lang.String sql, java.lang.String[] columnNames)
          JDBC 3.0 Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
protected  void finalize()
          JDBC states that a Statement is closed when garbage collected.
 EmbedParameterSetMetaData getEmbedParameterSetMetaData()
          Immitate the function in JDBC 3.0 Retrieves the number, types and properties of this PreparedStatement object's parameters.
 java.sql.ResultSetMetaData getMetaData()
          JDBC 2.0 The number, types and properties of a ResultSet's columns are provided by the getMetaData method.
protected  int getParameterJDBCType(int parameterIndex)
          Get the target JDBC type for a parameter.
 org.apache.derby.iapi.sql.ParameterValueSet getParms()
          Get the ParameterValueSet from the activation
protected  org.apache.derby.iapi.types.DataTypeDescriptor[] getTypes(int parameterIndex)
          Check the parameterINdex is in range and return the array of type descriptors.
protected  EmbedResultSetMetaData newEmbedResultSetMetaData(org.apache.derby.iapi.sql.ResultDescription resultDesc)
           
 void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
          We do this inefficiently and read it all in here.
 void setBinaryStream(int parameterIndex, java.io.InputStream x, int length)
          This method sets the specified parameter from the given Java binary InputStream value.
protected  void setBinaryStreamInternal(int parameterIndex, java.io.InputStream x, int length)
           
 void setBlob(int i, java.sql.Blob x)
          JDBC 2.0 Set a BLOB parameter.
 void setBoolean(int parameterIndex, boolean x)
          Set a parameter to a Java boolean value.
 void setByte(int parameterIndex, byte x)
          Set a parameter to a Java byte value.
 void setBytes(int parameterIndex, byte[] x)
          Set a parameter to a Java array of bytes.
 void setCharacterStream(int parameterIndex, java.io.Reader reader, int length)
          JDBC 2.0 When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader.
protected  void setCharacterStreamInternal(int parameterIndex, java.io.Reader reader, int length)
           
 void setClob(int i, java.sql.Clob x)
          JDBC 2.0 Set a CLOB parameter.
 void setDate(int parameterIndex, java.sql.Date x)
          Set a parameter to a java.sql.Date value.
 void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal)
          Set a parameter to a java.sql.Date value.
 void setDouble(int parameterIndex, double x)
          Set a parameter to a Java double value.
 void setFloat(int parameterIndex, float x)
          Set a parameter to a Java float value.
 void setInt(int parameterIndex, int x)
          Set a parameter to a Java int value.
 void setLong(int parameterIndex, long x)
          Set a parameter to a Java long value.
 void setNull(int parameterIndex, int sqlType)
          Set a parameter to SQL NULL.
 void setNull(int paramIndex, int sqlType, java.lang.String typeName)
          JDBC 2.0 Set null for user-named types and REF type parameters
 void setObject(int parameterIndex, java.lang.Object x)
          Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType)
          This method is like setObject above, but assumes a scale of zero.
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale)
          The interface says that the type of the Object parameter must be compatible with the type of the targetSqlType.
(package private)  boolean setObjectConvert(int parameterIndex, java.lang.Object x)
          Allow explict setObject conversions by sub-classes for classes not supported by this variant.
private  void setScale(int parameterIndex, int scale)
          Set the scale of a parameter.
 void setShort(int parameterIndex, short x)
          Set a parameter to a Java short value.
 void setString(int parameterIndex, java.lang.String x)
          Set a parameter to a Java String value.
 void setTime(int parameterIndex, java.sql.Time x)
          Set a parameter to a java.sql.Time value.
 void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)
          Set a parameter to a java.sql.Time value.
 void setTimestamp(int parameterIndex, java.sql.Timestamp x)
          Set a parameter to a java.sql.Timestamp value.
 void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal)
          Set a parameter to a java.sql.Timestamp value.
 void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length)
          Deprecated in JDBC 3.0
 void setURL(int parameterIndex, java.net.URL x)
          JDBC 3.0 Sets the designated parameter to the given java.net.URL value.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 void transferParameters(EmbedPreparedStatement newStatement)
           
 
Methods inherited from class org.apache.derby.impl.jdbc.EmbedStatement
cancel, checkExecStatus, checkIfInMiddleOfBatch, checkRequiresCallableStatement, checkStatus, clearBatch, clearResultSets, clearWarnings, close, commitIfAutoCommit, commitIfNeeded, execute, executeBatch, getCal, getConnection, getConnectionSynchronization, getContextManager, getDatabase, getEmbedConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getParameterValueSet, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getSQLText, getUpdateCount, getWarnings, getWarnings, handleException, handleException, needCommit, newSQLException, newSQLException, newSQLException, restoreContextStack, resultSetClosing, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, setupContextStack, transferBatch
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.sql.PreparedStatement
getParameterMetaData, setArray, setBigDecimal, setRef
 
Methods inherited from interface java.sql.Statement
cancel, clearBatch, clearWarnings, close, executeBatch, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Field Detail

rMetaData

protected java.sql.ResultSetMetaData rMetaData

gcDuringGetMetaData

private java.lang.String gcDuringGetMetaData

preparedStatement

protected org.apache.derby.iapi.sql.PreparedStatement preparedStatement

activation

private org.apache.derby.iapi.sql.Activation activation
Constructor Detail

EmbedPreparedStatement

public EmbedPreparedStatement(EmbedConnection conn,
                              java.lang.String sql,
                              boolean forMetaData,
                              int resultSetType,
                              int resultSetConcurrency,
                              int resultSetHoldability,
                              int autoGeneratedKeys,
                              int[] columnIndexes,
                              java.lang.String[] columnNames)
                       throws java.sql.SQLException
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
JDBC states that a Statement is closed when garbage collected.


execute

public final boolean execute(java.lang.String sql)
                      throws java.sql.SQLException
Description copied from interface: java.sql.Statement
This method executes an arbitrary SQL statement of any time. The methods getResultSet, getMoreResults and getUpdateCount retrieve the results.

Specified by:
execute in interface java.sql.Statement
Overrides:
execute in class EmbedStatement

execute

public final boolean execute(java.lang.String sql,
                             int autoGenKeys)
                      throws java.sql.SQLException
Description copied from class: EmbedStatement
JDBC 3.0 Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. The driver will ignore this signal if the SQL statement is not an INSERT statement.

Specified by:
execute in interface java.sql.Statement
Overrides:
execute in class EmbedStatement

execute

public final boolean execute(java.lang.String sql,
                             int[] columnIndexes)
                      throws java.sql.SQLException
Description copied from class: EmbedStatement
JDBC 3.0 Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the indexes of the columns in the target table that contain the auto-generated keys that should be made available. The driver will ignore the array if the given SQL statement is not an INSERT statement.

Specified by:
execute in interface java.sql.Statement
Overrides:
execute in class EmbedStatement

execute

public final boolean execute(java.lang.String sql,
                             java.lang.String[] columnNames)
                      throws java.sql.SQLException
Description copied from class: EmbedStatement
JDBC 3.0 Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the names of the columns in the target table that contain the auto-generated keys that should be made available. The driver will ignore the array if the given SQL statement is not an INSERT statement.

Specified by:
execute in interface java.sql.Statement
Overrides:
execute in class EmbedStatement

executeQuery

public final java.sql.ResultSet executeQuery(java.lang.String sql)
                                      throws java.sql.SQLException
Description copied from interface: java.sql.Statement
This method executes the specified SQL SELECT statement and returns a (possibly empty) ResultSet with the results of the query.

Specified by:
executeQuery in interface java.sql.Statement
Overrides:
executeQuery in class EmbedStatement

executeUpdate

public final int executeUpdate(java.lang.String sql)
                        throws java.sql.SQLException
Description copied from interface: java.sql.Statement
This method executes the specified SQL INSERT, UPDATE, or DELETE statement and returns the number of rows affected, which may be 0.

Specified by:
executeUpdate in interface java.sql.Statement
Overrides:
executeUpdate in class EmbedStatement

executeUpdate

public final int executeUpdate(java.lang.String sql,
                               int autoGenKeys)
                        throws java.sql.SQLException
Description copied from class: EmbedStatement
JDBC 3.0 Execute the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.

Specified by:
executeUpdate in interface java.sql.Statement
Overrides:
executeUpdate in class EmbedStatement

executeUpdate

public final int executeUpdate(java.lang.String sql,
                               int[] columnIndexes)
                        throws java.sql.SQLException
Description copied from class: EmbedStatement
JDBC 3.0 Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. The driver will ignore the array if the SQL statement is not an INSERT statement

Specified by:
executeUpdate in interface java.sql.Statement
Overrides:
executeUpdate in class EmbedStatement

executeUpdate

public final int executeUpdate(java.lang.String sql,
                               java.lang.String[] columnNames)
                        throws java.sql.SQLException
Description copied from class: EmbedStatement
JDBC 3.0 Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. The driver will ignore the array if the SQL statement is not an INSERT statement

Specified by:
executeUpdate in interface java.sql.Statement
Overrides:
executeUpdate in class EmbedStatement

addBatch

public final void addBatch(java.lang.String sql)
                    throws java.sql.SQLException
Description copied from interface: java.sql.Statement
This method adds a SQL statement to a SQL batch. A driver is not required to implement this method.

Specified by:
addBatch in interface java.sql.Statement
Overrides:
addBatch in class EmbedStatement

closeActions

protected void closeActions()
                     throws java.sql.SQLException
Additional close to close our activation.

Overrides:
closeActions in class EmbedStatement

executeQuery

public final java.sql.ResultSet executeQuery()
                                      throws java.sql.SQLException
A prepared SQL query is executed and its ResultSet is returned.

Specified by:
executeQuery in interface java.sql.PreparedStatement

executeUpdate

public final int executeUpdate()
                        throws java.sql.SQLException
Execute a SQL INSERT, UPDATE or DELETE statement. In addition, SQL statements that return nothing such as SQL DDL statements can be executed.

Specified by:
executeUpdate in interface java.sql.PreparedStatement

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws java.sql.SQLException
Set a parameter to SQL NULL.

Note: You must specify the parameter's SQL type.

Specified by:
setNull in interface java.sql.PreparedStatement

setBoolean

public void setBoolean(int parameterIndex,
                       boolean x)
                throws java.sql.SQLException
Set a parameter to a Java boolean value. According to the JDBC API spec, the driver converts this to a SQL BIT value when it sends it to the database. But we don't have to do this, since the database engine supports a boolean type.

Specified by:
setBoolean in interface java.sql.PreparedStatement

setByte

public void setByte(int parameterIndex,
                    byte x)
             throws java.sql.SQLException
Set a parameter to a Java byte value. The driver converts this to a SQL TINYINT value when it sends it to the database.

Specified by:
setByte in interface java.sql.PreparedStatement

setShort

public void setShort(int parameterIndex,
                     short x)
              throws java.sql.SQLException
Set a parameter to a Java short value. The driver converts this to a SQL SMALLINT value when it sends it to the database.

Specified by:
setShort in interface java.sql.PreparedStatement

setInt

public void setInt(int parameterIndex,
                   int x)
            throws java.sql.SQLException
Set a parameter to a Java int value. The driver converts this to a SQL INTEGER value when it sends it to the database.

Specified by:
setInt in interface java.sql.PreparedStatement

setLong

public void setLong(int parameterIndex,
                    long x)
             throws java.sql.SQLException
Set a parameter to a Java long value. The driver converts this to a SQL BIGINT value when it sends it to the database.

Specified by:
setLong in interface java.sql.PreparedStatement

setFloat

public void setFloat(int parameterIndex,
                     float x)
              throws java.sql.SQLException
Set a parameter to a Java float value. The driver converts this to a SQL FLOAT value when it sends it to the database.

Specified by:
setFloat in interface java.sql.PreparedStatement

setDouble

public void setDouble(int parameterIndex,
                      double x)
               throws java.sql.SQLException
Set a parameter to a Java double value. The driver converts this to a SQL DOUBLE value when it sends it to the database.

Specified by:
setDouble in interface java.sql.PreparedStatement

setString

public void setString(int parameterIndex,
                      java.lang.String x)
               throws java.sql.SQLException
Set a parameter to a Java String value. The driver converts this to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments size relative to the driver's limits on VARCHARs) when it sends it to the database.

Specified by:
setString in interface java.sql.PreparedStatement

setBytes

public void setBytes(int parameterIndex,
                     byte[] x)
              throws java.sql.SQLException
Set a parameter to a Java array of bytes. The driver converts this to a SQL VARBINARY or LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARYs) when it sends it to the database.

Specified by:
setBytes in interface java.sql.PreparedStatement

setDate

public void setDate(int parameterIndex,
                    java.sql.Date x)
             throws java.sql.SQLException
Set a parameter to a java.sql.Date value. The driver converts this to a SQL DATE value when it sends it to the database.

Specified by:
setDate in interface java.sql.PreparedStatement

setTime

public void setTime(int parameterIndex,
                    java.sql.Time x)
             throws java.sql.SQLException
Set a parameter to a java.sql.Time value. The driver converts this to a SQL TIME value when it sends it to the database.

Specified by:
setTime in interface java.sql.PreparedStatement

setTimestamp

public void setTimestamp(int parameterIndex,
                         java.sql.Timestamp x)
                  throws java.sql.SQLException
Set a parameter to a java.sql.Timestamp value. The driver converts this to a SQL TIMESTAMP value when it sends it to the database.

Specified by:
setTimestamp in interface java.sql.PreparedStatement

setAsciiStream

public final void setAsciiStream(int parameterIndex,
                                 java.io.InputStream x,
                                 int length)
                          throws java.sql.SQLException
We do this inefficiently and read it all in here. The target type is assumed to be a String.

Specified by:
setAsciiStream in interface java.sql.PreparedStatement

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             java.io.InputStream x,
                             int length)
                      throws java.sql.SQLException
Deprecated in JDBC 3.0

Specified by:
setUnicodeStream in interface java.sql.PreparedStatement

setCharacterStream

public final void setCharacterStream(int parameterIndex,
                                     java.io.Reader reader,
                                     int length)
                              throws java.sql.SQLException
JDBC 2.0 When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Specified by:
setCharacterStream in interface java.sql.PreparedStatement

setCharacterStreamInternal

protected void setCharacterStreamInternal(int parameterIndex,
                                          java.io.Reader reader,
                                          int length)
                                   throws java.sql.SQLException

setBinaryStream

public final void setBinaryStream(int parameterIndex,
                                  java.io.InputStream x,
                                  int length)
                           throws java.sql.SQLException
Description copied from interface: java.sql.PreparedStatement
This method sets the specified parameter from the given Java binary InputStream value.

Specified by:
setBinaryStream in interface java.sql.PreparedStatement

setBinaryStreamInternal

protected void setBinaryStreamInternal(int parameterIndex,
                                       java.io.InputStream x,
                                       int length)
                                throws java.sql.SQLException

setNull

public void setNull(int paramIndex,
                    int sqlType,
                    java.lang.String typeName)
             throws java.sql.SQLException
JDBC 2.0 Set null for user-named types and REF type parameters

Specified by:
setNull in interface java.sql.PreparedStatement

addBatch

public void addBatch()
              throws java.sql.SQLException
JDBC 2.0 Add a set of parameters to the batch.

Specified by:
addBatch in interface java.sql.PreparedStatement

executeBatchElement

protected boolean executeBatchElement(java.lang.Object batchElement)
                               throws java.sql.SQLException,
                                      org.apache.derby.iapi.error.StandardException
Description copied from class: EmbedStatement
Execute a single element of the batch. Overridden by EmbedPreparedStatement

Overrides:
executeBatchElement in class EmbedStatement

clearParameters

public void clearParameters()
                     throws java.sql.SQLException

In general, parameter values remain in force for repeated use of a Statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.

Specified by:
clearParameters in interface java.sql.PreparedStatement

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException
JDBC 2.0 The number, types and properties of a ResultSet's columns are provided by the getMetaData method.

Specified by:
getMetaData in interface java.sql.PreparedStatement

setObject

public final void setObject(int parameterIndex,
                            java.lang.Object x,
                            int targetSqlType,
                            int scale)
                     throws java.sql.SQLException
The interface says that the type of the Object parameter must be compatible with the type of the targetSqlType. We check that, and if it flies, we expect the underlying engine to do the required conversion once we pass in the value using its type. So, an Integer converting to a CHAR is done via setInteger() support on the underlying CHAR type.

If x is null, it won't tell us its type, so we pass it on to setNull

Specified by:
setObject in interface java.sql.PreparedStatement

setObject

public final void setObject(int parameterIndex,
                            java.lang.Object x,
                            int targetSqlType)
                     throws java.sql.SQLException
This method is like setObject above, but assumes a scale of zero.

Specified by:
setObject in interface java.sql.PreparedStatement

setObject

public final void setObject(int parameterIndex,
                            java.lang.Object x)
                     throws java.sql.SQLException

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.

Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type.

Specified by:
setObject in interface java.sql.PreparedStatement

setObjectConvert

boolean setObjectConvert(int parameterIndex,
                         java.lang.Object x)
                   throws java.sql.SQLException
Allow explict setObject conversions by sub-classes for classes not supported by this variant. E.g. BigDecimal This top-level implementation always returns false.


execute

public final boolean execute()
                      throws java.sql.SQLException
Description copied from interface: java.sql.PreparedStatement
This method executes a prepared SQL query. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.

Specified by:
execute in interface java.sql.PreparedStatement

setDate

public final void setDate(int parameterIndex,
                          java.sql.Date x,
                          java.util.Calendar cal)
                   throws java.sql.SQLException
Set a parameter to a java.sql.Date value. The driver converts this to a SQL DATE value when it sends it to the database.

Specified by:
setDate in interface java.sql.PreparedStatement

setTime

public final void setTime(int parameterIndex,
                          java.sql.Time x,
                          java.util.Calendar cal)
                   throws java.sql.SQLException
Set a parameter to a java.sql.Time value. The driver converts this to a SQL TIME value when it sends it to the database.

Specified by:
setTime in interface java.sql.PreparedStatement

setTimestamp

public final void setTimestamp(int parameterIndex,
                               java.sql.Timestamp x,
                               java.util.Calendar cal)
                        throws java.sql.SQLException
Set a parameter to a java.sql.Timestamp value. The driver converts this to a SQL TIMESTAMP value when it sends it to the database.

Specified by:
setTimestamp in interface java.sql.PreparedStatement

setBlob

public void setBlob(int i,
                    java.sql.Blob x)
             throws java.sql.SQLException
JDBC 2.0 Set a BLOB parameter.

Specified by:
setBlob in interface java.sql.PreparedStatement

setClob

public void setClob(int i,
                    java.sql.Clob x)
             throws java.sql.SQLException
JDBC 2.0 Set a CLOB parameter.

Specified by:
setClob in interface java.sql.PreparedStatement

getParms

public final org.apache.derby.iapi.sql.ParameterValueSet getParms()
Get the ParameterValueSet from the activation


getTypes

protected final org.apache.derby.iapi.types.DataTypeDescriptor[] getTypes(int parameterIndex)
                                                                   throws java.sql.SQLException
Check the parameterINdex is in range and return the array of type descriptors.


getParameterJDBCType

protected int getParameterJDBCType(int parameterIndex)
                            throws java.sql.SQLException
Get the target JDBC type for a parameter. Will throw exceptions if the parameter index is out of range


setScale

private void setScale(int parameterIndex,
                      int scale)
               throws java.sql.SQLException
Set the scale of a parameter.


getEmbedParameterSetMetaData

public EmbedParameterSetMetaData getEmbedParameterSetMetaData()
                                                       throws java.sql.SQLException
Immitate the function in JDBC 3.0 Retrieves the number, types and properties of this PreparedStatement object's parameters.


setURL

public final void setURL(int parameterIndex,
                         java.net.URL x)
                  throws java.sql.SQLException
JDBC 3.0 Sets the designated parameter to the given java.net.URL value. The driver converts this to an SQL DATALINK value when it sends it to the database.

Specified by:
setURL in interface java.sql.PreparedStatement

newEmbedResultSetMetaData

protected EmbedResultSetMetaData newEmbedResultSetMetaData(org.apache.derby.iapi.sql.ResultDescription resultDesc)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


transferParameters

public void transferParameters(EmbedPreparedStatement newStatement)
                        throws java.sql.SQLException

executeStatement

protected boolean executeStatement(org.apache.derby.iapi.sql.Activation a,
                                   boolean executeQuery,
                                   boolean executeUpdate)
                            throws java.sql.SQLException
Description copied from class: EmbedStatement
Execute the current statement.

Overrides:
executeStatement in class EmbedStatement

dataTypeConversion

protected final java.sql.SQLException dataTypeConversion(int column,
                                                         java.lang.String sourceType)
                                                  throws java.sql.SQLException