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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
appendInfo
(StringBuffer buf) void
cancel()
void
void
void
close()
void
boolean
boolean
boolean
boolean
boolean
int[]
executeQuery
(String str) protected ResultSet
executeQuery
(String sql, boolean wrap) Execute the query, with the option of not wrapping it in aDelegatingResultSet
, which is the default.int
executeUpdate
(String str) int
executeUpdate
(String s, int i) int
executeUpdate
(String s, int[] ia) int
executeUpdate
(String s, String[] sa) Return the wrapped statement.int
int
Return the base underlying data store statement.int
int
boolean
boolean
getMoreResults
(int i) int
protected ResultSet
getResultSet
(boolean wrap) Get the last result set, with the option of not wrapping it in aDelegatingResultSet
, which is the default.int
int
int
int
int
hashCode()
void
initialize
(Statement stmnt, Connection conn) boolean
isClosed()
boolean
boolean
boolean
isWrapperFor
(Class<?> iface) void
setCursorName
(String str) void
setEscapeProcessing
(boolean bool) void
setFetchDirection
(int i) void
setFetchSize
(int i) void
setMaxFieldSize
(int i) void
setMaxRows
(int i) void
setPoolable
(boolean b) void
setQueryTimeout
(int i) toString()
<T> T
protected ResultSet
wrapResult
(ResultSet rs, boolean wrap) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
executeQuery
in 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:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceStatement
- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSize
in interfaceStatement
- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSize
in interfaceStatement
- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRows
in interfaceStatement
- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRows
in interfaceStatement
- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessing
in interfaceStatement
- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeout
in interfaceStatement
- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeout
in interfaceStatement
- Throws:
SQLException
-
cancel
- Specified by:
cancel
in interfaceStatement
- Throws:
SQLException
-
getWarnings
- Specified by:
getWarnings
in interfaceStatement
- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarnings
in interfaceStatement
- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorName
in interfaceStatement
- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSet
in 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:
getUpdateCount
in interfaceStatement
- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirection
in interfaceStatement
- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirection
in interfaceStatement
- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSize
in interfaceStatement
- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSize
in interfaceStatement
- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrency
in interfaceStatement
- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetType
in interfaceStatement
- Throws:
SQLException
-
addBatch
- Specified by:
addBatch
in interfaceStatement
- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatch
in interfaceStatement
- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatch
in interfaceStatement
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceStatement
- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeys
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldability
in interfaceStatement
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isClosed
- Specified by:
isClosed
in interfaceStatement
- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolable
in interfaceStatement
- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolable
in interfaceStatement
- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletion
in interfaceStatement
- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletion
in interfaceStatement
- Throws:
SQLException
-