public class ExtendedPreparedStatement extends ExtendedStatement implements PreparedStatement
Designed so that it can be cached by the PooledConnection. It additionally notes any Exceptions that occur and this is used to ensure bad connections are removed from the connection pool.
pooledConnection, pstmtCLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Constructor and Description |
|---|
ExtendedPreparedStatement(PooledConnection pooledConnection,
PreparedStatement pstmt,
String sql,
String cacheKey)
Create a wrapped PreparedStatement that can be cached.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch()
Add the last binding for batch execution.
|
void |
clearParameters()
Clear parameters.
|
void |
close()
Returns the PreparedStatement back into the cache.
|
void |
closeDestroy()
Fully close the underlying PreparedStatement.
|
boolean |
execute()
execute the statement.
|
ResultSet |
executeQuery()
Execute teh query.
|
int |
executeUpdate()
Execute the dml statement.
|
String |
getCacheKey()
Return the key used to cache this on the Connection.
|
PreparedStatement |
getDelegate() |
ResultSetMetaData |
getMetaData()
Return the MetaData for the query.
|
ParameterMetaData |
getParameterMetaData()
Standard PreparedStatement method execution.
|
String |
getSql()
Return the SQL used to create this PreparedStatement.
|
void |
setArray(int i,
Array x)
Standard PreparedStatement method execution.
|
void |
setAsciiStream(int parameterIndex,
InputStream x,
int length)
Standard PreparedStatement method execution.
|
void |
setBigDecimal(int parameterIndex,
BigDecimal x)
Standard PreparedStatement method execution.
|
void |
setBinaryStream(int parameterIndex,
InputStream x,
int length)
Standard PreparedStatement method execution.
|
void |
setBlob(int i,
Blob x)
Standard PreparedStatement method execution.
|
void |
setBoolean(int parameterIndex,
boolean x)
Standard PreparedStatement method execution.
|
void |
setByte(int parameterIndex,
byte x)
Standard PreparedStatement method execution.
|
void |
setBytes(int parameterIndex,
byte[] x)
Standard PreparedStatement method execution.
|
void |
setCharacterStream(int parameterIndex,
Reader reader,
int length)
Standard PreparedStatement method execution.
|
void |
setClob(int i,
Clob x)
Standard PreparedStatement method execution.
|
void |
setDate(int parameterIndex,
Date x)
Standard PreparedStatement method execution.
|
void |
setDate(int parameterIndex,
Date x,
Calendar cal)
Standard PreparedStatement method execution.
|
void |
setDouble(int parameterIndex,
double x)
Standard PreparedStatement method execution.
|
void |
setFloat(int parameterIndex,
float x)
Standard PreparedStatement method execution.
|
void |
setInt(int parameterIndex,
int x)
Standard PreparedStatement method execution.
|
void |
setLong(int parameterIndex,
long x)
Standard PreparedStatement method execution.
|
void |
setNull(int parameterIndex,
int sqlType)
Standard PreparedStatement method execution.
|
void |
setNull(int paramIndex,
int sqlType,
String typeName)
Standard PreparedStatement method execution.
|
void |
setObject(int parameterIndex,
Object x)
Standard PreparedStatement method execution.
|
void |
setObject(int parameterIndex,
Object x,
int targetSqlType)
Standard PreparedStatement method execution.
|
void |
setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
Standard PreparedStatement method execution.
|
void |
setRef(int i,
Ref x)
Standard PreparedStatement method execution.
|
void |
setShort(int parameterIndex,
short x)
Standard PreparedStatement method execution.
|
void |
setString(int parameterIndex,
String x)
Standard PreparedStatement method execution.
|
void |
setTime(int parameterIndex,
Time x)
Standard PreparedStatement method execution.
|
void |
setTime(int parameterIndex,
Time x,
Calendar cal)
Standard PreparedStatement method execution.
|
void |
setTimestamp(int parameterIndex,
Timestamp x)
Standard PreparedStatement method execution.
|
void |
setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
Standard PreparedStatement method execution.
|
void |
setUnicodeStream(int parameterIndex,
InputStream x,
int length)
Deprecated.
|
void |
setURL(int parameterIndex,
URL x)
Standard PreparedStatement method execution.
|
addBatch, cancel, clearBatch, clearWarnings, 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, setQueryTimeoutcloseOnCompletion, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setPoolable, setRowId, setSQLXML, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setRowId, setSQLXMLaddBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, 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, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutisWrapperFor, unwrappublic ExtendedPreparedStatement(PooledConnection pooledConnection, PreparedStatement pstmt, String sql, String cacheKey)
public PreparedStatement getDelegate()
public String getCacheKey()
public String getSql()
public void closeDestroy()
throws SQLException
SQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface Statementclose in class ExtendedStatementSQLExceptionpublic void addBatch()
throws SQLException
addBatch in interface PreparedStatementaddBatch in class PreparedStatementDelegatorSQLExceptionpublic void clearParameters()
throws SQLException
clearParameters in interface PreparedStatementclearParameters in class PreparedStatementDelegatorSQLExceptionpublic boolean execute()
throws SQLException
execute in interface PreparedStatementexecute in class PreparedStatementDelegatorSQLExceptionpublic ResultSet executeQuery() throws SQLException
executeQuery in interface PreparedStatementexecuteQuery in class PreparedStatementDelegatorSQLExceptionpublic int executeUpdate()
throws SQLException
executeUpdate in interface PreparedStatementexecuteUpdate in class PreparedStatementDelegatorSQLExceptionpublic ResultSetMetaData getMetaData() throws SQLException
getMetaData in interface PreparedStatementgetMetaData in class PreparedStatementDelegatorSQLExceptionpublic ParameterMetaData getParameterMetaData() throws SQLException
getParameterMetaData in interface PreparedStatementgetParameterMetaData in class PreparedStatementDelegatorSQLExceptionpublic void setArray(int i,
Array x)
throws SQLException
setArray in interface PreparedStatementsetArray in class PreparedStatementDelegatorSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setAsciiStream in interface PreparedStatementsetAsciiStream in class PreparedStatementDelegatorSQLExceptionpublic void setBigDecimal(int parameterIndex,
BigDecimal x)
throws SQLException
setBigDecimal in interface PreparedStatementsetBigDecimal in class PreparedStatementDelegatorSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setBinaryStream in interface PreparedStatementsetBinaryStream in class PreparedStatementDelegatorSQLExceptionpublic void setBlob(int i,
Blob x)
throws SQLException
setBlob in interface PreparedStatementsetBlob in class PreparedStatementDelegatorSQLExceptionpublic void setBoolean(int parameterIndex,
boolean x)
throws SQLException
setBoolean in interface PreparedStatementsetBoolean in class PreparedStatementDelegatorSQLExceptionpublic void setByte(int parameterIndex,
byte x)
throws SQLException
setByte in interface PreparedStatementsetByte in class PreparedStatementDelegatorSQLExceptionpublic void setBytes(int parameterIndex,
byte[] x)
throws SQLException
setBytes in interface PreparedStatementsetBytes in class PreparedStatementDelegatorSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
int length)
throws SQLException
setCharacterStream in interface PreparedStatementsetCharacterStream in class PreparedStatementDelegatorSQLExceptionpublic void setClob(int i,
Clob x)
throws SQLException
setClob in interface PreparedStatementsetClob in class PreparedStatementDelegatorSQLExceptionpublic void setDate(int parameterIndex,
Date x)
throws SQLException
setDate in interface PreparedStatementsetDate in class PreparedStatementDelegatorSQLExceptionpublic void setDate(int parameterIndex,
Date x,
Calendar cal)
throws SQLException
setDate in interface PreparedStatementsetDate in class PreparedStatementDelegatorSQLExceptionpublic void setDouble(int parameterIndex,
double x)
throws SQLException
setDouble in interface PreparedStatementsetDouble in class PreparedStatementDelegatorSQLExceptionpublic void setFloat(int parameterIndex,
float x)
throws SQLException
setFloat in interface PreparedStatementsetFloat in class PreparedStatementDelegatorSQLExceptionpublic void setInt(int parameterIndex,
int x)
throws SQLException
setInt in interface PreparedStatementsetInt in class PreparedStatementDelegatorSQLExceptionpublic void setLong(int parameterIndex,
long x)
throws SQLException
setLong in interface PreparedStatementsetLong in class PreparedStatementDelegatorSQLExceptionpublic void setNull(int parameterIndex,
int sqlType)
throws SQLException
setNull in interface PreparedStatementsetNull in class PreparedStatementDelegatorSQLExceptionpublic void setNull(int paramIndex,
int sqlType,
String typeName)
throws SQLException
setNull in interface PreparedStatementsetNull in class PreparedStatementDelegatorSQLExceptionpublic void setObject(int parameterIndex,
Object x)
throws SQLException
setObject in interface PreparedStatementsetObject in class PreparedStatementDelegatorSQLExceptionpublic void setObject(int parameterIndex,
Object x,
int targetSqlType)
throws SQLException
setObject in interface PreparedStatementsetObject in class PreparedStatementDelegatorSQLExceptionpublic void setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
setObject in interface PreparedStatementsetObject in class PreparedStatementDelegatorSQLExceptionpublic void setRef(int i,
Ref x)
throws SQLException
setRef in interface PreparedStatementsetRef in class PreparedStatementDelegatorSQLExceptionpublic void setShort(int parameterIndex,
short x)
throws SQLException
setShort in interface PreparedStatementsetShort in class PreparedStatementDelegatorSQLExceptionpublic void setString(int parameterIndex,
String x)
throws SQLException
setString in interface PreparedStatementsetString in class PreparedStatementDelegatorSQLExceptionpublic void setTime(int parameterIndex,
Time x)
throws SQLException
setTime in interface PreparedStatementsetTime in class PreparedStatementDelegatorSQLExceptionpublic void setTime(int parameterIndex,
Time x,
Calendar cal)
throws SQLException
setTime in interface PreparedStatementsetTime in class PreparedStatementDelegatorSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp x)
throws SQLException
setTimestamp in interface PreparedStatementsetTimestamp in class PreparedStatementDelegatorSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
throws SQLException
setTimestamp in interface PreparedStatementsetTimestamp in class PreparedStatementDelegatorSQLExceptionpublic void setUnicodeStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setUnicodeStream in interface PreparedStatementsetUnicodeStream in class PreparedStatementDelegatorSQLExceptionpublic void setURL(int parameterIndex,
URL x)
throws SQLException
setURL in interface PreparedStatementsetURL in class PreparedStatementDelegatorSQLExceptionCopyright © 2014. All Rights Reserved.