com.p6spy.engine.spy

Class P6PreparedStatement

Implemented Interfaces:
PreparedStatement, Statement
Known Direct Subclasses:
P6CallableStatement, P6LogPreparedStatement, P6OutagePreparedStatement

public class P6PreparedStatement
extends P6Statement
implements PreparedStatement

Description: JDBC Driver Extension implementing PreparedStatement. $Author: bradleydot $ $Revision: 1.8 $ $Date: 2003/08/06 18:35:18 $ $Id: P6PreparedStatement.java,v 1.8 2003/08/06 18:35:18 bradleydot Exp $ $Source: /cvsroot/p6spy/p6spy/com/p6spy/engine/spy/P6PreparedStatement.java,v $ $Log: P6PreparedStatement.java,v $ Revision 1.8 2003/08/06 18:35:18 bradleydot Minor changes so TestCallable will work: added getValuesLength method and set P6_Grow_Max as public static. Also changed setURL so that it is registered in values array. Revision 1.7 2003/06/20 20:31:37 aarvesen fix for bug 161: null result sets Revision 1.6 2003/06/05 20:10:00 aarvesen bradley 'dot' johnson (bradley@irongrid.com) added in dynamic array allocation Revision 1.5 2003/06/03 19:20:25 cheechq removed unused imports Revision 1.4 2003/01/03 20:33:43 aarvesen Added getJDBC() method to return the underlying jdbc object. Revision 1.3 2002/12/06 22:42:47 aarvesen New factory registration in the constructor. jdk 1.4 Revision 1.2 2002/10/06 18:23:25 jeffgoke no message Revision 1.1 2002/05/24 07:31:13 jeffgoke version 1 rewrite Revision 1.8 2002/05/18 06:39:52 jeffgoke Peter Laird added Outage detection. Added junit tests for outage detection. Fixed multi-driver tests. Revision 1.7 2002/05/16 04:58:40 jeffgoke Viktor Szathmary added multi-driver support. Rewrote P6SpyOptions to be easier to manage. Fixed several bugs. Revision 1.6 2002/04/21 06:15:34 jeffgoke added test cases, fixed batch bugs Revision 1.5 2002/04/18 06:54:39 jeffgoke added batch statement logging support Revision 1.4 2002/04/15 05:13:32 jeffgoke Simon Sadedin added timing support. Fixed bug where batch execute was not getting logged. Added result set timing. Updated the log format to include categories, and updated options to control the categories. Updated documentation. Revision 1.3 2002/04/11 04:18:03 jeffgoke fixed bug where callable & prepared were not passing their ancestors the correct constructor information Revision 1.2 2002/04/10 04:24:26 jeffgoke added support for callable statements and fixed numerous bugs that allowed the real class to be returned Revision 1.1.1.1 2002/04/07 04:52:25 jeffgoke no message Revision 1.2 2001-08-05 09:16:04-05 andy final version on the website Revision 1.1 2001-08-02 07:52:43-05 andy <> Revision 1.0 2001-08-02 06:37:42-05 andy Initial revision

Field Summary

static int
P6_GROW_MAX
static int
P6_MAX_FIELDS
protected boolean[]
isString
protected PreparedStatement
prepStmtPassthru
protected String
preparedQuery
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

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()
int
getValuesLength()
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
setURL(int p0, URL p1)
void
setUnicodeStream(int p0, InputStream p1, int p2)

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, getJDBC, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout

Methods inherited from class com.p6spy.engine.spy.P6Base

getP6Factory, setP6Factory

Field Details

P6_GROW_MAX

public static int P6_GROW_MAX


P6_MAX_FIELDS

public static final int P6_MAX_FIELDS

Field Value:
32


isString

protected boolean[] isString


prepStmtPassthru

protected PreparedStatement prepStmtPassthru


preparedQuery

protected String preparedQuery


values

protected Object[] values

Constructor Details

P6PreparedStatement

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

Method Details

addBatch

public void addBatch()
            throws SQLException


clearParameters

public void clearParameters()
            throws SQLException


execute

public boolean execute()
            throws SQLException


executeQuery

public ResultSet executeQuery()
            throws SQLException


executeUpdate

public int executeUpdate()
            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 interface P6Statement

Returns:
the wrapped JDBC object


getMetaData

public ResultSetMetaData getMetaData()
            throws SQLException


getParameterMetaData

public ParameterMetaData getParameterMetaData()
            throws SQLException


getQueryFromPreparedStatement

public final String getQueryFromPreparedStatement()


getResultSet

public ResultSet getResultSet()
            throws SQLException
Overrides:
getResultSet in interface P6Statement


getValuesLength

public int getValuesLength()


growValues

protected void growValues(int newMax)


initValues

protected void initValues()


setArray

public void setArray(int p0,
                     Array p1)
            throws SQLException


setAsciiStream

public void setAsciiStream(int p0,
                           InputStream p1,
                           int p2)
            throws SQLException


setBigDecimal

public void setBigDecimal(int p0,
                          BigDecimal p1)
            throws SQLException


setBinaryStream

public void setBinaryStream(int p0,
                            InputStream p1,
                            int p2)
            throws SQLException


setBlob

public void setBlob(int p0,
                    Blob p1)
            throws SQLException


setBoolean

public void setBoolean(int p0,
                       boolean p1)
            throws SQLException


setByte

public void setByte(int p0,
                    byte p1)
            throws SQLException


setBytes

public void setBytes(int p0,
                     byte[] p1)
            throws SQLException


setCharacterStream

public void setCharacterStream(int p0,
                               Reader p1,
                               int p2)
            throws SQLException


setClob

public void setClob(int p0,
                    Clob p1)
            throws SQLException


setDate

public void setDate(int p0,
                    Date p1)
            throws SQLException


setDate

public void setDate(int p0,
                    Date p1,
                    Calendar p2)
            throws SQLException


setDouble

public void setDouble(int p0,
                      double p1)
            throws SQLException


setFloat

public void setFloat(int p0,
                     float p1)
            throws SQLException


setInt

public void setInt(int p0,
                   int p1)
            throws SQLException


setLong

public void setLong(int p0,
                    long p1)
            throws SQLException


setNull

public void setNull(int p0,
                    int p1)
            throws SQLException


setNull

public void setNull(int p0,
                    int p1,
                    String p2)
            throws SQLException


setObject

public void setObject(int p0,
                      Object p1)
            throws SQLException


setObject

public void setObject(int p0,
                      Object p1,
                      int p2)
            throws SQLException


setObject

public void setObject(int p0,
                      Object p1,
                      int p2,
                      int p3)
            throws SQLException


setObjectAsInt

protected void setObjectAsInt(int i,
                              Object o)


setObjectAsString

protected void setObjectAsString(int i,
                                 Object o)


setRef

public void setRef(int p0,
                   Ref p1)
            throws SQLException


setShort

public void setShort(int p0,
                     short p1)
            throws SQLException


setString

public void setString(int p0,
                      String p1)
            throws SQLException


setTime

public void setTime(int p0,
                    Time p1)
            throws SQLException


setTime

public void setTime(int p0,
                    Time p1,
                    Calendar p2)
            throws SQLException


setTimestamp

public void setTimestamp(int p0,
                         Timestamp p1)
            throws SQLException


setTimestamp

public void setTimestamp(int p0,
                         Timestamp p1,
                         Calendar p2)
            throws SQLException


setURL

public void setURL(int p0,
                   URL p1)
            throws SQLException


setUnicodeStream

public void setUnicodeStream(int p0,
                             InputStream p1,
                             int p2)
            throws SQLException