Class LogicalPreparedStatement
java.lang.Object
org.apache.derby.client.am.LogicalStatementEntity
org.apache.derby.client.am.LogicalPreparedStatement
- All Implemented Interfaces:
AutoCloseable, PreparedStatement, Statement, Wrapper
- Direct Known Subclasses:
LogicalCallableStatement, LogicalPreparedStatement42
A wrapper class for a physical Derby prepared statement.
The idea behind the logical prepared statement is to allow reuse of the
physical prepared statement. In general the logical entity will forward all
calls to the physical entity. A few methods have special implementations, the
most important one being LogicalStatementEntity.close(). Each method will check that the
logical statement is still open before the call is forwarded to the
underlying physical statement.
- See Also:
-
Field Summary
Fields inherited from interface Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsConstructorDescriptionLogicalPreparedStatement(PreparedStatement physicalPs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor) Creates a new logical prepared statement. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch()voidvoidcancel()voidvoidvoidbooleanexecute()booleanbooleanbooleanbooleanint[]long/////////////////////////////////////////////////////////////executeQuery(String sql) intintexecuteUpdate(String sql) intexecuteUpdate(String sql, int autoGeneratedKeys) intexecuteUpdate(String sql, int[] columnIndexes) intexecuteUpdate(String sql, String[] columnNames) intintintintbooleanbooleangetMoreResults(int current) intintintintintbooleanisClosed()booleanvoidvoidsetAsciiStream(int arg0, InputStream arg1) voidsetAsciiStream(int parameterIndex, InputStream x, int length) voidsetAsciiStream(int arg0, InputStream arg1, long arg2) voidsetBigDecimal(int parameterIndex, BigDecimal x) voidsetBinaryStream(int arg0, InputStream arg1) voidsetBinaryStream(int parameterIndex, InputStream x, int length) voidsetBinaryStream(int arg0, InputStream arg1, long arg2) voidsetBlob(int arg0, InputStream arg1) voidsetBlob(int arg0, InputStream arg1, long arg2) voidvoidsetBoolean(int parameterIndex, boolean x) voidsetByte(int parameterIndex, byte x) voidsetBytes(int parameterIndex, byte[] x) voidsetCharacterStream(int arg0, Reader arg1) voidsetCharacterStream(int parameterIndex, Reader reader, int length) voidsetCharacterStream(int arg0, Reader arg1, long arg2) voidvoidvoidvoidsetCursorName(String name) voidvoidvoidsetDouble(int parameterIndex, double x) voidsetEscapeProcessing(boolean enable) voidsetFetchDirection(int direction) voidsetFetchSize(int rows) voidsetFloat(int parameterIndex, float x) voidsetInt(int parameterIndex, int x) voidsetLong(int parameterIndex, long x) voidsetMaxFieldSize(int max) voidsetMaxRows(int max) voidsetNCharacterStream(int arg0, Reader arg1) voidsetNCharacterStream(int arg0, Reader arg1, long arg2) voidvoidvoidvoidsetNString(int arg0, String arg1) voidsetNull(int parameterIndex, int sqlType) voidvoidvoidvoidvoidsetPoolable(boolean arg0) voidsetQueryTimeout(int seconds) voidvoid/////////////////////////////////////////////////////////////voidsetShort(int parameterIndex, short x) voidvoidvoidvoidvoidsetTimestamp(int parameterIndex, Timestamp x) voidsetTimestamp(int parameterIndex, Timestamp x, Calendar cal) voidsetUnicodeStream(int parameterIndex, InputStream x, int length) Deprecated.voidMethods inherited from class LogicalStatementEntity
close, closeOnCompletion, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, getPhysCs, getPhysPs, isCloseOnCompletion, isLogicalEntityClosed, isWrapperFor, setLargeMaxRows, unwrapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PreparedStatement
setObject, setObjectMethods inherited from interface Statement
close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, isCloseOnCompletion, isSimpleIdentifier, setLargeMaxRowsMethods inherited from interface Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
LogicalPreparedStatement
public LogicalPreparedStatement(PreparedStatement physicalPs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor) Creates a new logical prepared statement.- Parameters:
physicalPs- underlying physical statementstmtKey- key for the physical statementcacheInteractor- creating statement cache interactor- Throws:
IllegalArgumentException- ifcacheisnull
-
-
Method Details
-
executeUpdate
- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
clearParameters
- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfacePreparedStatement- Throws:
SQLException
-
setByte
- Specified by:
setBytein interfacePreparedStatement- Throws:
SQLException
-
setDouble
- Specified by:
setDoublein interfacePreparedStatement- Throws:
SQLException
-
setFloat
- Specified by:
setFloatin interfacePreparedStatement- Throws:
SQLException
-
setInt
- Specified by:
setIntin interfacePreparedStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setLong
- Specified by:
setLongin interfacePreparedStatement- Throws:
SQLException
-
setShort
- Specified by:
setShortin interfacePreparedStatement- Throws:
SQLException
-
setBoolean
- Specified by:
setBooleanin interfacePreparedStatement- Throws:
SQLException
-
setBytes
- Specified by:
setBytesin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setUnicodeStream
@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException Deprecated.- Specified by:
setUnicodeStreamin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException - Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setString
- Specified by:
setStringin interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLException
-
setURL
- Specified by:
setURLin interfacePreparedStatement- Throws:
SQLException
-
setArray
- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaData
- Specified by:
getParameterMetaDatain interfacePreparedStatement- Throws:
SQLException
-
setRef
- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaDatain interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceStatement- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrencyin interfaceStatement- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldabilityin interfaceStatement- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetTypein interfaceStatement- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
cancel
- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeysin interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
setRowId
/////////////////////////////////////////////////////////////- Specified by:
setRowIdin interfacePreparedStatement- Throws:
SQLException
-
setNString
- Specified by:
setNStringin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXMLin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceStatement- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolablein interfaceStatement- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolablein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
/////////////////////////////////////////////////////////////- Specified by:
executeLargeUpdatein interfacePreparedStatement- Throws:
SQLException
-