com.p6spy.engine.spy

Class P6PreparedStatement

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
protected boolean[]isString
protected StringpreparedQuery
protected PreparedStatementprepStmtPassthru
static intP6_GROW_MAX
static intP6_MAX_FIELDS
protected Object[]values
Constructor Summary
P6PreparedStatement(P6Factory factory, PreparedStatement statement, P6Connection conn, String query)
Method Summary
voidaddBatch()
voidclearParameters()
booleanexecute()
ResultSetexecuteQuery()
intexecuteUpdate()
StatementgetJDBC()
Returns the underlying JDBC object (in this case, a java.sql.PreparedStatement).
ResultSetMetaDatagetMetaData()
ParameterMetaDatagetParameterMetaData()
StringgetQueryFromPreparedStatement()
ResultSetgetResultSet()
intgetValuesLength()
protected voidgrowValues(int newMax)
protected voidinitValues()
voidsetArray(int p0, Array p1)
voidsetAsciiStream(int p0, InputStream p1, int p2)
voidsetBigDecimal(int p0, BigDecimal p1)
voidsetBinaryStream(int p0, InputStream p1, int p2)
voidsetBlob(int p0, Blob p1)
voidsetBoolean(int p0, boolean p1)
voidsetByte(int p0, byte p1)
voidsetBytes(int p0, byte[] p1)
voidsetCharacterStream(int p0, Reader p1, int p2)
voidsetClob(int p0, Clob p1)
voidsetDate(int p0, Date p1)
voidsetDate(int p0, Date p1, Calendar p2)
voidsetDouble(int p0, double p1)
voidsetFloat(int p0, float p1)
voidsetInt(int p0, int p1)
voidsetLong(int p0, long p1)
voidsetNull(int p0, int p1, String p2)
voidsetNull(int p0, int p1)
voidsetObject(int p0, Object p1, int p2, int p3)
voidsetObject(int p0, Object p1, int p2)
voidsetObject(int p0, Object p1)
protected voidsetObjectAsInt(int i, Object o)
protected voidsetObjectAsString(int i, Object o)
voidsetRef(int p0, Ref p1)
voidsetShort(int p0, short p1)
voidsetString(int p0, String p1)
voidsetTime(int p0, Time p1, Calendar p2)
voidsetTime(int p0, Time p1)
voidsetTimestamp(int p0, Timestamp p1, Calendar p2)
voidsetTimestamp(int p0, Timestamp p1)
voidsetUnicodeStream(int p0, InputStream p1, int p2)
voidsetURL(int p0, URL p1)

Field Detail

isString

protected boolean[] isString

preparedQuery

protected String preparedQuery

prepStmtPassthru

protected PreparedStatement prepStmtPassthru

P6_GROW_MAX

public static int P6_GROW_MAX

P6_MAX_FIELDS

public static final int P6_MAX_FIELDS

values

protected Object[] values

Constructor Detail

P6PreparedStatement

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

Method Detail

addBatch

public void addBatch()

clearParameters

public void clearParameters()

execute

public boolean execute()

executeQuery

public ResultSet executeQuery()

executeUpdate

public int executeUpdate()

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.

Returns: the wrapped JDBC object

getMetaData

public ResultSetMetaData getMetaData()

getParameterMetaData

public ParameterMetaData getParameterMetaData()

getQueryFromPreparedStatement

public final String getQueryFromPreparedStatement()

getResultSet

public ResultSet getResultSet()

getValuesLength

public int getValuesLength()

growValues

protected void growValues(int newMax)

initValues

protected void initValues()

setArray

public void setArray(int p0, Array p1)

setAsciiStream

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

setBigDecimal

public void setBigDecimal(int p0, BigDecimal p1)

setBinaryStream

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

setBlob

public void setBlob(int p0, Blob p1)

setBoolean

public void setBoolean(int p0, boolean p1)

setByte

public void setByte(int p0, byte p1)

setBytes

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

setCharacterStream

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

setClob

public void setClob(int p0, Clob p1)

setDate

public void setDate(int p0, Date p1)

setDate

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

setDouble

public void setDouble(int p0, double p1)

setFloat

public void setFloat(int p0, float p1)

setInt

public void setInt(int p0, int p1)

setLong

public void setLong(int p0, long p1)

setNull

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

setNull

public void setNull(int p0, int p1)

setObject

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

setObject

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

setObject

public void setObject(int p0, Object p1)

setObjectAsInt

protected void setObjectAsInt(int i, Object o)

setObjectAsString

protected void setObjectAsString(int i, Object o)

setRef

public void setRef(int p0, Ref p1)

setShort

public void setShort(int p0, short p1)

setString

public void setString(int p0, String p1)

setTime

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

setTime

public void setTime(int p0, Time p1)

setTimestamp

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

setTimestamp

public void setTimestamp(int p0, Timestamp p1)

setUnicodeStream

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

setURL

public void setURL(int p0, URL p1)