Package org.apache.openjpa.lib.jdbc
Class DelegatingStatement
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingStatement
- All Implemented Interfaces:
AutoCloseable,Statement,Wrapper,Closeable
- Direct Known Subclasses:
LoggingConnectionDecorator.LoggingConnection.LoggingStatement
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 TypeMethodDescriptionvoidprotected voidappendInfo(StringBuffer buf) voidcancel()voidvoidvoidclose()voidbooleanbooleanbooleanbooleanbooleanint[]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.intexecuteUpdate(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(Statement stmnt, Connection conn) booleanisClosed()booleanbooleanbooleanisWrapperFor(Class<?> iface) voidsetCursorName(String str) voidsetEscapeProcessing(boolean bool) voidsetFetchDirection(int i) voidsetFetchSize(int i) voidsetMaxFieldSize(int i) voidsetMaxRows(int i) voidsetPoolable(boolean b) voidsetQueryTimeout(int i) toString()<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.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, isSimpleIdentifier, setLargeMaxRows
-
Constructor Details
-
DelegatingStatement
-
-
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
-
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
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceStatement- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolablein interfaceStatement- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolablein interfaceStatement- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletionin interfaceStatement- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletionin interfaceStatement- Throws:
SQLException
-