com.caucho.db.jdbc
Class PreparedStatementImpl

java.lang.Object
  extended by com.caucho.db.jdbc.StatementImpl
      extended by com.caucho.db.jdbc.PreparedStatementImpl
All Implemented Interfaces:
java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper
Direct Known Subclasses:
CursorPreparedStatementImpl

public class PreparedStatementImpl
extends StatementImpl
implements java.sql.PreparedStatement

The JDBC statement implementation.


Field Summary
 
Fields inherited from class com.caucho.db.jdbc.StatementImpl
_conn, _db, _rs
 
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
 
Method Summary
 void addBatch()
           
 void clearParameters()
           
 boolean execute()
           
 java.sql.ResultSet executeQuery()
           
 int executeUpdate()
           
 java.sql.ResultSetMetaData getMetaData()
           
 java.sql.ParameterMetaData getParameterMetaData()
           
protected  Query getQuery()
           
 boolean isClosed()
           
 boolean isPoolable()
           
 boolean isWrapperFor(java.lang.Class<?> iface)
           
 void setArray(int parameter, java.sql.Array x)
           
 void setAsciiStream(int parameterIndex, java.io.InputStream x)
           
 void setAsciiStream(int parameter, java.io.InputStream is, int len)
           
 void setAsciiStream(int parameterIndex, java.io.InputStream x, long length)
           
 void setBigDecimal(int parameter, java.math.BigDecimal x)
           
 void setBinaryStream(int parameterIndex, java.io.InputStream is)
           
 void setBinaryStream(int parameter, java.io.InputStream is, int len)
           
 void setBinaryStream(int parameterIndex, java.io.InputStream is, long length)
           
 void setBlob(int parameter, java.sql.Blob x)
           
 void setBlob(int parameterIndex, java.io.InputStream inputStream)
           
 void setBlob(int parameterIndex, java.io.InputStream inputStream, long length)
           
 void setBoolean(int parameter, boolean x)
           
 void setByte(int parameter, byte x)
           
 void setBytes(int parameter, byte[] x)
           
 void setCharacterStream(int parameterIndex, java.io.Reader reader)
           
 void setCharacterStream(int parameter, java.io.Reader is, int len)
           
 void setCharacterStream(int parameterIndex, java.io.Reader reader, long length)
           
 void setClob(int parameter, java.sql.Clob x)
           
 void setClob(int parameterIndex, java.io.Reader reader)
           
 void setClob(int parameterIndex, java.io.Reader reader, long length)
           
 void setDate(int parameter, java.sql.Date x)
           
 void setDate(int parameter, java.sql.Date x, java.util.Calendar calendar)
           
 void setDouble(int parameter, double x)
           
 void setFloat(int parameter, float x)
           
 void setInt(int parameter, int x)
           
 void setLong(int parameter, long x)
           
 void setNCharacterStream(int parameterIndex, java.io.Reader value)
           
 void setNCharacterStream(int parameterIndex, java.io.Reader value, long length)
           
 void setNClob(int parameterIndex, java.sql.NClob value)
           
 void setNClob(int parameterIndex, java.io.Reader reader)
           
 void setNClob(int parameterIndex, java.io.Reader reader, long length)
           
 void setNString(int parameterIndex, java.lang.String value)
           
 void setNull(int parameter, int sqlType)
           
 void setNull(int parameter, int sqlType, java.lang.String typeName)
           
 void setObject(int parameter, java.lang.Object x)
           
 void setObject(int parameter, java.lang.Object x, int target)
           
 void setObject(int parameter, java.lang.Object x, int target, int scale)
           
 void setPoolable(boolean poolable)
           
 void setRef(int parameter, java.sql.Ref x)
           
protected  void setResultSet(java.sql.ResultSet rs)
           
 void setRowId(int parameterIndex, java.sql.RowId x)
           
 void setShort(int parameter, short x)
           
 void setSQLXML(int parameterIndex, java.sql.SQLXML xmlObject)
           
 void setString(int parameter, java.lang.String x)
           
 void setTime(int parameter, java.sql.Time x)
           
 void setTime(int parameter, java.sql.Time x, java.util.Calendar calendar)
           
 void setTimestamp(int parameter, java.sql.Timestamp x)
           
 void setTimestamp(int parameter, java.sql.Timestamp x, java.util.Calendar calendar)
           
 void setUnicodeStream(int parameter, java.io.InputStream is, int len)
           
 void setURL(int foo, java.net.URL url)
           
<T> T
unwrap(java.lang.Class<T> iface)
           
 
Methods inherited from class com.caucho.db.jdbc.StatementImpl
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getConnectionImpl, getDatabase, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryContext, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, init, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Method Detail

getQuery

protected Query getQuery()

setResultSet

protected void setResultSet(java.sql.ResultSet rs)

getMetaData

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

clearParameters

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

setNull

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

setNull

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

setBoolean

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

setByte

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

setShort

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

setInt

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

setLong

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

setFloat

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

setDouble

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

setBigDecimal

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

setString

public void setString(int parameter,
                      java.lang.String x)
               throws java.sql.SQLException
Specified by:
setString in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setBytes

public void setBytes(int parameter,
                     byte[] x)
              throws java.sql.SQLException
Specified by:
setBytes in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setDate

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

setDate

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

setTime

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

setTime

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

setTimestamp

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

setTimestamp

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

setAsciiStream

public void setAsciiStream(int parameter,
                           java.io.InputStream is,
                           int len)
                    throws java.sql.SQLException
Specified by:
setAsciiStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setUnicodeStream

public void setUnicodeStream(int parameter,
                             java.io.InputStream is,
                             int len)
                      throws java.sql.SQLException
Specified by:
setUnicodeStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setBinaryStream

public void setBinaryStream(int parameter,
                            java.io.InputStream is,
                            int len)
                     throws java.sql.SQLException
Specified by:
setBinaryStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setCharacterStream

public void setCharacterStream(int parameter,
                               java.io.Reader is,
                               int len)
                        throws java.sql.SQLException
Specified by:
setCharacterStream in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setObject

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

setObject

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

setObject

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

setRef

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

setBlob

public void setBlob(int parameter,
                    java.sql.Blob x)
             throws java.sql.SQLException
Specified by:
setBlob in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setClob

public void setClob(int parameter,
                    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 parameter,
                     java.sql.Array x)
              throws java.sql.SQLException
Specified by:
setArray 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

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

execute

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

setURL

public void setURL(int foo,
                   java.net.URL url)
Specified by:
setURL in interface java.sql.PreparedStatement

getParameterMetaData

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

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Specified by:
isClosed in interface java.sql.Statement
Overrides:
isClosed in class StatementImpl
Throws:
java.sql.SQLException

setPoolable

public void setPoolable(boolean poolable)
                 throws java.sql.SQLException
Specified by:
setPoolable in interface java.sql.Statement
Overrides:
setPoolable in class StatementImpl
Throws:
java.sql.SQLException

isPoolable

public boolean isPoolable()
                   throws java.sql.SQLException
Specified by:
isPoolable in interface java.sql.Statement
Overrides:
isPoolable in class StatementImpl
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Overrides:
unwrap in class StatementImpl
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Overrides:
isWrapperFor in class StatementImpl
Throws:
java.sql.SQLException

setRowId

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

setNString

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

setNCharacterStream

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

setNClob

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

setClob

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

setBlob

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

setNClob

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

setSQLXML

public void setSQLXML(int parameterIndex,
                      java.sql.SQLXML xmlObject)
               throws java.sql.SQLException
Specified by:
setSQLXML in interface java.sql.PreparedStatement
Throws:
java.sql.SQLException

setAsciiStream

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

setBinaryStream

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

setCharacterStream

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

setAsciiStream

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

setBinaryStream

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

setCharacterStream

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

setNCharacterStream

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

setClob

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

setBlob

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

setNClob

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