Class NewProxyStatement
- All Implemented Interfaces:
C3P0ProxyStatement, ProxyResultSetDetachable, AutoCloseable, Statement, Wrapper
-
Field Summary
FieldsFields inherited from interface C3P0ProxyStatement
RAW_STATEMENTFields inherited from interface Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidcancel()final voidfinal voidfinal voidclose()final voidvoidfinal StringenquoteIdentifier(String a, boolean b) final Stringfinal Stringfinal booleanfinal booleanfinal booleanfinal booleanfinal int[]final long[]final longfinal longexecuteLargeUpdate(String a, int b) final longexecuteLargeUpdate(String a, int[] b) final longexecuteLargeUpdate(String a, String[] b) final ResultSetfinal intfinal intexecuteUpdate(String a, int b) final intexecuteUpdate(String a, int[] b) final intexecuteUpdate(String a, String[] b) final Connectionfinal intfinal intfinal ResultSetfinal longfinal longfinal intfinal intfinal booleanfinal booleangetMoreResults(int a) final intfinal ResultSetfinal intfinal intfinal intfinal intfinal SQLWarningfinal booleanisClosed()final booleanfinal booleanfinal booleanfinal booleanrawStatementOperation(Method m, Object target, Object[] args) Allows one to work with the unproxied, raw vendor-provided Statement .final voidfinal voidsetEscapeProcessing(boolean a) final voidsetFetchDirection(int a) final voidsetFetchSize(int a) final voidsetLargeMaxRows(long a) final voidsetMaxFieldSize(int a) final voidsetMaxRows(int a) final voidsetPoolable(boolean a) final voidsetQueryTimeout(int a) toString()final Object
-
Field Details
-
inner
-
-
Method Details
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin 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
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeysin interfaceStatement- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldabilityin interfaceStatement- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolablein interfaceStatement- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletionin interfaceStatement- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletionin interfaceStatement- Throws:
SQLException
-
getLargeUpdateCount
- Specified by:
getLargeUpdateCountin interfaceStatement- Throws:
SQLException
-
setLargeMaxRows
- Specified by:
setLargeMaxRowsin interfaceStatement- Throws:
SQLException
-
getLargeMaxRows
- Specified by:
getLargeMaxRowsin interfaceStatement- Throws:
SQLException
-
executeLargeBatch
- Specified by:
executeLargeBatchin interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
enquoteLiteral
- Specified by:
enquoteLiteralin interfaceStatement- Throws:
SQLException
-
enquoteIdentifier
- Specified by:
enquoteIdentifierin interfaceStatement- Throws:
SQLException
-
isSimpleIdentifier
- Specified by:
isSimpleIdentifierin interfaceStatement- Throws:
SQLException
-
enquoteNCharLiteral
- Specified by:
enquoteNCharLiteralin interfaceStatement- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
cancel
- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolablein interfaceStatement- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
toString
-
detachProxyResultSet
- Specified by:
detachProxyResultSetin interfaceProxyResultSetDetachable
-
rawStatementOperation
public Object rawStatementOperation(Method m, Object target, Object[] args) throws IllegalAccessException, InvocationTargetException, SQLException Description copied from interface:C3P0ProxyStatementAllows one to work with the unproxied, raw vendor-provided Statement . Some database companies never got over the "common interfaces mean no more vendor lock-in!" thing, and offer non-standard API on their Statements. This method permits you to "pierce" the connection-pooling layer to call non-standard methods on the original Statement, or to pass the original Statement to functions that are not implementation neutral.
To use this functionality, you'll need to cast a Statement retrieved from a c3p0-provided Connection to a C3P0ProxyStatement.
This method works by making a reflective call of method
mon Objecttarget(which may be null for static methods), passing and argument listargs. For the method target, or for any argument, you may substitute the special tokenC3P0ProxyStatement.RAW_STATEMENTAny ResultSets returned by the operation will be proxied and c3p0-managed, meaning that these resources will be automatically closed if the user does not close them first when this Statement is closed or checked into the statement cache. Any other resources returned by the operation are the user's responsibility to clean up!
If you have turned statement pooling on, incautious use of this method can corrupt the PreparedStatement cache, by breaking the invariant that all cached PreparedStatements should be equivalent to a PreparedStatement newly created with the same arguments to prepareStatement(...) or prepareCall(...). If your vendor supplies API that allows you to modify the state or configuration of a Statement in some nonstandard way, and you do not undo this modification prior to closing the Statement or the Connection that prepared it, future preparers of the same Statement may or may not see your modification, depending on your use of the cache. Thus, it is inadvisable to use this method to call nonstandard mutators on PreparedStatements if statement pooling is turned on..
- Specified by:
rawStatementOperationin interfaceC3P0ProxyStatement- Throws:
IllegalAccessExceptionInvocationTargetExceptionSQLException
-