com.p6spy.engine.spy
Class P6PreparedStatement

java.lang.Object
  extended bycom.p6spy.engine.spy.P6Base
      extended bycom.p6spy.engine.spy.P6Statement
          extended bycom.p6spy.engine.spy.P6PreparedStatement
All Implemented Interfaces:
PreparedStatement, Statement
Direct Known Subclasses:
P6CallableStatement, P6LogPreparedStatement, P6OutagePreparedStatement

public class P6PreparedStatement
extends P6Statement
implements PreparedStatement


Field Summary
protected  boolean[] isString
           
protected static int P6_GROW_MAX
           
static int P6_MAX_FIELDS
           
protected  String preparedQuery
           
protected  PreparedStatement prepStmtPassthru
           
protected  Object[] values
           
 
Fields inherited from class com.p6spy.engine.spy.P6Statement
connection, passthru, statementQuery
 
Fields inherited from class com.p6spy.engine.spy.P6Base
factory
 
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
P6PreparedStatement(P6Factory factory, PreparedStatement statement, P6Connection conn, String query)
           
 
Method Summary
 void addBatch()
           
 void clearParameters()
           
 boolean execute()
           
 ResultSet executeQuery()
           
 int executeUpdate()
           
 Statement getJDBC()
          Returns the underlying JDBC object (in this case, a java.sql.PreparedStatement).
 ResultSetMetaData getMetaData()
           
 ParameterMetaData getParameterMetaData()
           
 String getQueryFromPreparedStatement()
           
 ResultSet getResultSet()
           
protected  void growValues(int newMax)
           
protected  void initValues()
           
 void setArray(int p0, Array p1)
           
 void setAsciiStream(int p0, InputStream p1, int p2)
           
 void setBigDecimal(int p0, BigDecimal p1)
           
 void setBinaryStream(int p0, InputStream p1, int p2)
           
 void setBlob(int p0, Blob p1)
           
 void setBoolean(int p0, boolean p1)
           
 void setByte(int p0, byte p1)
           
 void setBytes(int p0, byte[] p1)
           
 void setCharacterStream(int p0, Reader p1, int p2)
           
 void setClob(int p0, Clob p1)
           
 void setDate(int p0, Date p1)
           
 void setDate(int p0, Date p1, Calendar p2)
           
 void setDouble(int p0, double p1)
           
 void setFloat(int p0, float p1)
           
 void setInt(int p0, int p1)
           
 void setLong(int p0, long p1)
           
 void setNull(int p0, int p1)
           
 void setNull(int p0, int p1, String p2)
           
 void setObject(int p0, Object p1)
           
 void setObject(int p0, Object p1, int p2)
           
 void setObject(int p0, Object p1, int p2, int p3)
           
protected  void setObjectAsInt(int i, Object o)
           
protected  void setObjectAsString(int i, Object o)
           
 void setRef(int p0, Ref p1)
           
 void setShort(int p0, short p1)
           
 void setString(int p0, String p1)
           
 void setTime(int p0, Time p1)
           
 void setTime(int p0, Time p1, Calendar p2)
           
 void setTimestamp(int p0, Timestamp p1)
           
 void setTimestamp(int p0, Timestamp p1, Calendar p2)
           
 void setUnicodeStream(int p0, InputStream p1, int p2)
           
 void setURL(int p0, URL p1)
           
 
Methods inherited from class com.p6spy.engine.spy.P6Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
Methods inherited from class com.p6spy.engine.spy.P6Base
getP6Factory, setP6Factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Field Detail

P6_MAX_FIELDS

public static final int P6_MAX_FIELDS
See Also:
Constant Field Values

P6_GROW_MAX

protected static int P6_GROW_MAX

prepStmtPassthru

protected PreparedStatement prepStmtPassthru

preparedQuery

protected String preparedQuery

values

protected Object[] values

isString

protected boolean[] isString
Constructor Detail

P6PreparedStatement

public P6PreparedStatement(P6Factory factory,
                           PreparedStatement statement,
                           P6Connection conn,
                           String query)
Method Detail

initValues

protected void initValues()

addBatch

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

clearParameters

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

execute

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

executeQuery

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

executeUpdate

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

getMetaData

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

setArray

public void setArray(int p0,
                     Array p1)
              throws SQLException
Specified by:
setArray in interface PreparedStatement
Throws:
SQLException

setAsciiStream

public void setAsciiStream(int p0,
                           InputStream p1,
                           int p2)
                    throws SQLException
Specified by:
setAsciiStream in interface PreparedStatement
Throws:
SQLException

setBigDecimal

public void setBigDecimal(int p0,
                          BigDecimal p1)
                   throws SQLException
Specified by:
setBigDecimal in interface PreparedStatement
Throws:
SQLException

setBinaryStream

public void setBinaryStream(int p0,
                            InputStream p1,
                            int p2)
                     throws SQLException
Specified by:
setBinaryStream in interface PreparedStatement
Throws:
SQLException

setBlob

public void setBlob(int p0,
                    Blob p1)
             throws SQLException
Specified by:
setBlob in interface PreparedStatement
Throws:
SQLException

setBoolean

public void setBoolean(int p0,
                       boolean p1)
                throws SQLException
Specified by:
setBoolean in interface PreparedStatement
Throws:
SQLException

setByte

public void setByte(int p0,
                    byte p1)
             throws SQLException
Specified by:
setByte in interface PreparedStatement
Throws:
SQLException

setBytes

public void setBytes(int p0,
                     byte[] p1)
              throws SQLException
Specified by:
setBytes in interface PreparedStatement
Throws:
SQLException

setCharacterStream

public void setCharacterStream(int p0,
                               Reader p1,
                               int p2)
                        throws SQLException
Specified by:
setCharacterStream in interface PreparedStatement
Throws:
SQLException

setClob

public void setClob(int p0,
                    Clob p1)
             throws SQLException
Specified by:
setClob in interface PreparedStatement
Throws:
SQLException

setDate

public void setDate(int p0,
                    Date p1)
             throws SQLException
Specified by:
setDate in interface PreparedStatement
Throws:
SQLException

setDate

public void setDate(int p0,
                    Date p1,
                    Calendar p2)
             throws SQLException
Specified by:
setDate in interface PreparedStatement
Throws:
SQLException

setDouble

public void setDouble(int p0,
                      double p1)
               throws SQLException
Specified by:
setDouble in interface PreparedStatement
Throws:
SQLException

setFloat

public void setFloat(int p0,
                     float p1)
              throws SQLException
Specified by:
setFloat in interface PreparedStatement
Throws:
SQLException

setInt

public void setInt(int p0,
                   int p1)
            throws SQLException
Specified by:
setInt in interface PreparedStatement
Throws:
SQLException

setLong

public void setLong(int p0,
                    long p1)
             throws SQLException
Specified by:
setLong in interface PreparedStatement
Throws:
SQLException

setNull

public void setNull(int p0,
                    int p1,
                    String p2)
             throws SQLException
Specified by:
setNull in interface PreparedStatement
Throws:
SQLException

setNull

public void setNull(int p0,
                    int p1)
             throws SQLException
Specified by:
setNull in interface PreparedStatement
Throws:
SQLException

setObject

public void setObject(int p0,
                      Object p1,
                      int p2,
                      int p3)
               throws SQLException
Specified by:
setObject in interface PreparedStatement
Throws:
SQLException

setObject

public void setObject(int p0,
                      Object p1,
                      int p2)
               throws SQLException
Specified by:
setObject in interface PreparedStatement
Throws:
SQLException

setObject

public void setObject(int p0,
                      Object p1)
               throws SQLException
Specified by:
setObject in interface PreparedStatement
Throws:
SQLException

setRef

public void setRef(int p0,
                   Ref p1)
            throws SQLException
Specified by:
setRef in interface PreparedStatement
Throws:
SQLException

setShort

public void setShort(int p0,
                     short p1)
              throws SQLException
Specified by:
setShort in interface PreparedStatement
Throws:
SQLException

setString

public void setString(int p0,
                      String p1)
               throws SQLException
Specified by:
setString in interface PreparedStatement
Throws:
SQLException

setTime

public void setTime(int p0,
                    Time p1,
                    Calendar p2)
             throws SQLException
Specified by:
setTime in interface PreparedStatement
Throws:
SQLException

setTime

public void setTime(int p0,
                    Time p1)
             throws SQLException
Specified by:
setTime in interface PreparedStatement
Throws:
SQLException

setTimestamp

public void setTimestamp(int p0,
                         Timestamp p1,
                         Calendar p2)
                  throws SQLException
Specified by:
setTimestamp in interface PreparedStatement
Throws:
SQLException

setTimestamp

public void setTimestamp(int p0,
                         Timestamp p1)
                  throws SQLException
Specified by:
setTimestamp in interface PreparedStatement
Throws:
SQLException

setUnicodeStream

public void setUnicodeStream(int p0,
                             InputStream p1,
                             int p2)
                      throws SQLException
Specified by:
setUnicodeStream in interface PreparedStatement
Throws:
SQLException

getResultSet

public ResultSet getResultSet()
                       throws SQLException
Specified by:
getResultSet in interface Statement
Overrides:
getResultSet in class P6Statement
Throws:
SQLException

getQueryFromPreparedStatement

public final String getQueryFromPreparedStatement()

growValues

protected void growValues(int newMax)

setObjectAsString

protected void setObjectAsString(int i,
                                 Object o)

setObjectAsInt

protected void setObjectAsInt(int i,
                              Object o)

setURL

public void setURL(int p0,
                   URL p1)
            throws SQLException
Specified by:
setURL in interface PreparedStatement
Throws:
SQLException

getParameterMetaData

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

getJDBC

public Statement getJDBC()
Returns the underlying JDBC object (in this case, a java.sql.PreparedStatement).

The returned object is a java.sql.Statement due to inheritance reasons, so you'll need to cast appropriately.

Overrides:
getJDBC in class P6Statement
Returns:
the wrapped JDBC object