Package org.apache.openjpa.lib.jdbc
Class DelegatingPreparedStatement
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement
- All Implemented Interfaces:
AutoCloseable,PreparedStatement,Statement,Wrapper,Closeable
- Direct Known Subclasses:
LoggingConnectionDecorator.LoggingConnection.LoggingPreparedStatement,PostgresDictionary.PostgresPreparedStatement
Wrapper around an existing statement. Subclasses can override the
methods whose behavior they mean to change. The
equals and
hashCode methods pass through to the base underlying data
store statement.- Author:
- Abe White
-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch()voidprotected voidappendInfo(StringBuffer buf) voidcancel()voidvoidvoidvoidclose()voidbooleanbooleanexecute()booleanbooleanbooleanbooleanint[]protected ResultSetexecuteQuery(boolean wrap) Execute the query, with the option of not wrapping it in aDelegatingResultSet, which is the default.executeQuery(String str) protected ResultSetexecuteQuery(String sql, boolean wrap) Execute the query, with the option of not wrapping it in aDelegatingResultSet, which is the default.intintexecuteUpdate(String str) intexecuteUpdate(String s, int i) intexecuteUpdate(String s, int[] ia) intexecuteUpdate(String s, String[] sa) Return the wrapped statement.intintReturn the base underlying data store statement.intintbooleanbooleangetMoreResults(int i) intprotected ResultSetgetResultSet(boolean wrap) Get the last result set, with the option of not wrapping it in aDelegatingResultSet, which is the default.intintintintinthashCode()voidinitialize(PreparedStatement stmnt, Connection conn) booleanisClosed()booleanbooleanbooleanisWrapperFor(Class<?> iface) voidvoidsetAsciiStream(int parameterIndex, InputStream x) voidsetAsciiStream(int i1, InputStream is, int i2) voidsetAsciiStream(int parameterIndex, InputStream x, long length) voidsetBigDecimal(int i, BigDecimal bd) voidsetBinaryStream(int parameterIndex, InputStream x) voidsetBinaryStream(int i1, InputStream is, int i2) voidsetBinaryStream(int parameterIndex, InputStream x, long length) voidsetBlob(int parameterIndex, InputStream inputStream) voidsetBlob(int parameterIndex, InputStream inputStream, long length) voidvoidsetBoolean(int i, boolean b) voidsetByte(int i, byte b) voidsetBytes(int i, byte[] b) voidsetCharacterStream(int parameterIndex, Reader reader) voidsetCharacterStream(int i1, Reader r, int i2) voidsetCharacterStream(int parameterIndex, Reader reader, long length) voidvoidvoidvoidsetCursorName(String str) voidvoidvoidsetDouble(int i, double d) voidsetEscapeProcessing(boolean bool) voidsetFetchDirection(int i) voidsetFetchSize(int i) voidsetFloat(int i, float f) voidsetInt(int i1, int i2) voidsetLong(int i, long l) voidsetMaxFieldSize(int i) voidsetMaxRows(int i) voidsetNCharacterStream(int parameterIndex, Reader value) voidsetNCharacterStream(int parameterIndex, Reader value, long length) voidvoidvoidvoidsetNString(int parameterIndex, String value) voidsetNull(int i1, int i2) voidvoidvoidvoidvoidsetPoolable(boolean poolable) voidsetQueryTimeout(int i) voidvoidvoidsetShort(int i, short s) voidvoidvoidvoidvoidsetTimestamp(int i, Timestamp t) voidsetTimestamp(int i, Timestamp t, Calendar c) voidsetUnicodeStream(int i1, InputStream is, int i2) Deprecated.voidtoString()<T> Tprotected ResultSetwrapResult(ResultSet rs, boolean wrap) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.PreparedStatement
executeLargeUpdate, setObject, setObjectMethods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, isSimpleIdentifier, setLargeMaxRows
-
Constructor Details
-
DelegatingPreparedStatement
-
-
Method Details
-
initialize
-
wrapResult
-
getDelegate
Return the wrapped statement. -
getInnermostDelegate
Return the base underlying data store statement. -
hashCode
public int hashCode() -
equals
-
toString
-
appendInfo
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeQuery
Execute the query, with the option of not wrapping it in aDelegatingResultSet, which is the default.- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
cancel
- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getResultSet
Get the last result set, with the option of not wrapping it in aDelegatingResultSet, which is the default.- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceStatement- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceStatement- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceStatement- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrencyin interfaceStatement- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetTypein interfaceStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLException
-
executeQuery
Execute the query, with the option of not wrapping it in aDelegatingResultSet, which is the default.- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setBoolean
- Specified by:
setBooleanin interfacePreparedStatement- Throws:
SQLException
-
setByte
- Specified by:
setBytein interfacePreparedStatement- Throws:
SQLException
-
setShort
- Specified by:
setShortin interfacePreparedStatement- Throws:
SQLException
-
setInt
- Specified by:
setIntin interfacePreparedStatement- Throws:
SQLException
-
setLong
- Specified by:
setLongin interfacePreparedStatement- Throws:
SQLException
-
setFloat
- Specified by:
setFloatin interfacePreparedStatement- Throws:
SQLException
-
setDouble
- Specified by:
setDoublein interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLException
-
setString
- Specified by:
setStringin interfacePreparedStatement- Throws:
SQLException
-
setBytes
- Specified by:
setBytesin interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setUnicodeStream
Deprecated.- Specified by:
setUnicodeStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
clearParameters
- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfacePreparedStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setRef
- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setArray
- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaDatain interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeysin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldabilityin interfaceStatement- Throws:
SQLException
-
setURL
- Specified by:
setURLin interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaData
- Specified by:
getParameterMetaDatain interfacePreparedStatement- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNClob
- Specified by:
setNClobin interfacePreparedStatement- Throws:
SQLException
-
setNString
- Specified by:
setNStringin interfacePreparedStatement- Throws:
SQLException
-
setRowId
- Specified by:
setRowIdin interfacePreparedStatement- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXMLin interfacePreparedStatement- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceStatement- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolablein interfaceStatement- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolablein interfaceStatement- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletionin interfaceStatement- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletionin interfaceStatement- Throws:
SQLException
-