Package org.jboss.jca.adapters.jdbc
Class WrappedPreparedStatement
- java.lang.Object
-
- org.jboss.jca.adapters.jdbc.JBossWrapper
-
- org.jboss.jca.adapters.jdbc.WrappedStatement
-
- org.jboss.jca.adapters.jdbc.WrappedPreparedStatement
-
- All Implemented Interfaces:
Serializable,AutoCloseable,PreparedStatement,Statement,Wrapper,StatementAccess
- Direct Known Subclasses:
WrappedCallableStatement,WrappedPreparedStatementJDK7,WrappedPreparedStatementJDK8
public abstract class WrappedPreparedStatement extends WrappedStatement implements PreparedStatement
A wrapper for a prepared statement.- Author:
- David Jencks, Adrian Brock, Jesper Pedersen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jboss.jca.adapters.jdbc.WrappedStatement
defaultFetchSize, doLocking, jndiName, spy, spyLogger, spyLoggingCategory
-
Fields inherited from class org.jboss.jca.adapters.jdbc.JBossWrapper
bundle
-
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
Constructors Modifier Constructor Description WrappedPreparedStatement(WrappedConnection lc, PreparedStatement ps, boolean spy, String jndiName, boolean doLocking)ConstructorprotectedWrappedPreparedStatement(WrappedConnection lc, PreparedStatement ps, boolean spy, String jndiName, boolean doLocking, String spyLoggingCategory)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBatch()voidclearParameters()booleanexecute()ResultSetexecuteQuery()intexecuteUpdate()ResultSetMetaDatagetMetaData()ParameterMetaDatagetParameterMetaData()PreparedStatementgetUnderlyingStatement()Get the underlying statementprotected PreparedStatementgetWrappedObject()Get the wrapped statementvoidsetArray(int parameterIndex, Array value)voidsetAsciiStream(int parameterIndex, InputStream x)voidsetAsciiStream(int parameterIndex, InputStream stream, int length)Deprecated.voidsetAsciiStream(int parameterIndex, InputStream x, long length)voidsetBigDecimal(int parameterIndex, BigDecimal value)voidsetBinaryStream(int parameterIndex, InputStream x)voidsetBinaryStream(int parameterIndex, InputStream stream, int length)voidsetBinaryStream(int parameterIndex, InputStream x, long length)voidsetBlob(int parameterIndex, InputStream inputStream)voidsetBlob(int parameterIndex, InputStream inputStream, long length)voidsetBlob(int parameterIndex, Blob value)voidsetBoolean(int parameterIndex, boolean value)voidsetByte(int parameterIndex, byte value)voidsetBytes(int parameterIndex, byte[] value)voidsetCharacterStream(int parameterIndex, Reader reader)voidsetCharacterStream(int parameterIndex, Reader reader, int length)voidsetCharacterStream(int parameterIndex, Reader reader, long length)voidsetClob(int parameterIndex, Reader reader)voidsetClob(int parameterIndex, Reader reader, long length)voidsetClob(int parameterIndex, Clob value)voidsetDate(int parameterIndex, Date value)voidsetDate(int parameterIndex, Date value, Calendar calendar)voidsetDouble(int parameterIndex, double value)voidsetFloat(int parameterIndex, float value)voidsetInt(int parameterIndex, int value)voidsetLong(int parameterIndex, long value)voidsetNCharacterStream(int parameterIndex, Reader value)voidsetNCharacterStream(int parameterIndex, Reader value, long length)voidsetNClob(int parameterIndex, Reader reader)voidsetNClob(int parameterIndex, Reader reader, long length)voidsetNClob(int parameterIndex, NClob value)voidsetNString(int parameterIndex, String value)voidsetNull(int parameterIndex, int sqlType)voidsetNull(int parameterIndex, int sqlType, String typeName)voidsetObject(int parameterIndex, Object value)voidsetObject(int parameterIndex, Object value, int sqlType)voidsetObject(int parameterIndex, Object value, int sqlType, int scale)voidsetRef(int parameterIndex, Ref value)voidsetRowId(int parameterIndex, RowId x)voidsetShort(int parameterIndex, short value)voidsetSQLXML(int parameterIndex, SQLXML xmlObject)voidsetString(int parameterIndex, String value)voidsetTime(int parameterIndex, Time value)voidsetTime(int parameterIndex, Time value, Calendar calendar)voidsetTimestamp(int parameterIndex, Timestamp value)voidsetTimestamp(int parameterIndex, Timestamp value, Calendar calendar)voidsetUnicodeStream(int parameterIndex, InputStream stream, int length)Deprecated.voidsetURL(int parameterIndex, URL value)-
Methods inherited from class org.jboss.jca.adapters.jdbc.WrappedStatement
addBatch, cancel, checkConfiguredQueryTimeout, checkException, checkState, checkTransaction, checkTransactionActive, clearBatch, clearWarnings, close, closeOnCompletion, closeResultSets, 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, internalClose, isClosed, isCloseOnCompletion, isPoolable, lock, registerResultSet, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unlock, unregisterResultSet, wrapResultSet
-
Methods inherited from class org.jboss.jca.adapters.jdbc.JBossWrapper
isWrapperFor, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.PreparedStatement
executeLargeUpdate, setObject, setObject
-
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Constructor Detail
-
WrappedPreparedStatement
public WrappedPreparedStatement(WrappedConnection lc, PreparedStatement ps, boolean spy, String jndiName, boolean doLocking)
Constructor- Parameters:
lc- The connectionps- The prepared statementspy- The spy valuejndiName- The jndi namedoLocking- Do locking
-
WrappedPreparedStatement
protected WrappedPreparedStatement(WrappedConnection lc, PreparedStatement ps, boolean spy, String jndiName, boolean doLocking, String spyLoggingCategory)
Constructor- Parameters:
lc- The connectionps- The prepared statementspy- The spy valuejndiName- The jndi namedoLocking- Do lockingspyLoggingCategory- The spy logging category
-
-
Method Detail
-
getUnderlyingStatement
public PreparedStatement getUnderlyingStatement() throws SQLException
Get the underlying statement- Specified by:
getUnderlyingStatementin interfaceStatementAccess- Overrides:
getUnderlyingStatementin classWrappedStatement- Returns:
- the underlying statement
- Throws:
SQLException- when already closed
-
setBoolean
public void setBoolean(int parameterIndex, boolean value) throws SQLException- Specified by:
setBooleanin interfacePreparedStatement- Throws:
SQLException
-
setByte
public void setByte(int parameterIndex, byte value) throws SQLException- Specified by:
setBytein interfacePreparedStatement- Throws:
SQLException
-
setShort
public void setShort(int parameterIndex, short value) throws SQLException- Specified by:
setShortin interfacePreparedStatement- Throws:
SQLException
-
setInt
public void setInt(int parameterIndex, int value) throws SQLException- Specified by:
setIntin interfacePreparedStatement- Throws:
SQLException
-
setLong
public void setLong(int parameterIndex, long value) throws SQLException- Specified by:
setLongin interfacePreparedStatement- Throws:
SQLException
-
setFloat
public void setFloat(int parameterIndex, float value) throws SQLException- Specified by:
setFloatin interfacePreparedStatement- Throws:
SQLException
-
setDouble
public void setDouble(int parameterIndex, double value) throws SQLException- Specified by:
setDoublein interfacePreparedStatement- Throws:
SQLException
-
setURL
public void setURL(int parameterIndex, URL value) throws SQLException- Specified by:
setURLin interfacePreparedStatement- Throws:
SQLException
-
setTime
public void setTime(int parameterIndex, Time value) throws SQLException- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTime
public void setTime(int parameterIndex, Time value, Calendar calendar) throws SQLException- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
execute
public boolean execute() throws SQLException- Specified by:
executein interfacePreparedStatement- Throws:
SQLException
-
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
- Specified by:
getMetaDatain interfacePreparedStatement- Throws:
SQLException
-
executeQuery
public ResultSet executeQuery() throws SQLException
- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLException
-
executeUpdate
public int executeUpdate() throws SQLException- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLException
-
addBatch
public void addBatch() throws SQLException- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
setNull
public void setNull(int parameterIndex, int sqlType) throws SQLException- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setNull
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
public void setBigDecimal(int parameterIndex, BigDecimal value) throws SQLException- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLException
-
setString
public void setString(int parameterIndex, String value) throws SQLException- Specified by:
setStringin interfacePreparedStatement- Throws:
SQLException
-
setBytes
public void setBytes(int parameterIndex, byte[] value) throws SQLException- Specified by:
setBytesin interfacePreparedStatement- Throws:
SQLException
-
setDate
public void setDate(int parameterIndex, Date value) throws SQLException- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setDate
public void setDate(int parameterIndex, Date value, Calendar calendar) throws SQLException- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
public void setTimestamp(int parameterIndex, Timestamp value) throws SQLException- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
public void setTimestamp(int parameterIndex, Timestamp value, Calendar calendar) throws SQLException- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
@Deprecated public void setAsciiStream(int parameterIndex, InputStream stream, int length) throws SQLException
Deprecated.- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setUnicodeStream
@Deprecated public void setUnicodeStream(int parameterIndex, InputStream stream, int length) throws SQLException
Deprecated.- Specified by:
setUnicodeStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream stream, int length) throws SQLException- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
clearParameters
public void clearParameters() throws SQLException- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object value, int sqlType, int scale) throws SQLException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object value, int sqlType) throws SQLException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object value) throws SQLException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setRef
public void setRef(int parameterIndex, Ref value) throws SQLException- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
setBlob
public void setBlob(int parameterIndex, Blob value) throws SQLException- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setClob
public void setClob(int parameterIndex, Clob value) throws SQLException- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setArray
public void setArray(int parameterIndex, Array value) throws SQLException- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaData
public ParameterMetaData getParameterMetaData() throws SQLException
- Specified by:
getParameterMetaDatain interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setBlob
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setBlob
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setClob
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setClob
public void setClob(int parameterIndex, Reader reader) throws SQLException- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNClob
public void setNClob(int parameterIndex, NClob value) throws SQLException- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
public void setNClob(int parameterIndex, Reader reader) throws SQLException- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNString
public void setNString(int parameterIndex, String value) throws SQLException- Specified by:
setNStringin interfacePreparedStatement- Throws:
SQLException
-
setRowId
public void setRowId(int parameterIndex, RowId x) throws SQLException- Specified by:
setRowIdin interfacePreparedStatement- Throws:
SQLException
-
setSQLXML
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException- Specified by:
setSQLXMLin interfacePreparedStatement- Throws:
SQLException
-
getWrappedObject
protected PreparedStatement getWrappedObject() throws SQLException
Get the wrapped statement- Overrides:
getWrappedObjectin classWrappedStatement- Returns:
- The result
- Throws:
SQLException- Thrown if an error occurs
-
-