com.mysql.jdbc.jdbc2.optional
Class JDBC4StatementWrapper
java.lang.Object
com.mysql.jdbc.jdbc2.optional.StatementWrapper
com.mysql.jdbc.jdbc2.optional.JDBC4StatementWrapper
- All Implemented Interfaces:
- java.sql.Statement, java.sql.Wrapper
public class JDBC4StatementWrapper
- extends StatementWrapper
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 |
Method Summary |
protected void |
checkAndFireConnectionError(java.sql.SQLException sqlEx)
Fires connection error event if required, before re-throwing exception |
void |
close()
|
boolean |
isClosed()
|
boolean |
isPoolable()
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
Returns true if this either implements the interface argument or is
directly or indirectly a wrapper for an object that does. |
void |
setPoolable(boolean poolable)
|
|
unwrap(java.lang.Class<T> iface)
Returns an object that implements the given interface to allow access to
non-standard methods, or standard methods not exposed by the proxy. |
Methods inherited from class com.mysql.jdbc.jdbc2.optional.StatementWrapper |
addBatch, cancel, clearBatch, clearWarnings, enableStreamingResults, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getInstance, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pooledConnection
protected MysqlPooledConnection pooledConnection
unwrappedInterfaces
protected java.util.Map unwrappedInterfaces
JDBC4StatementWrapper
public JDBC4StatementWrapper(ConnectionWrapper c,
MysqlPooledConnection conn,
java.sql.Statement toWrap)
close
public void close()
throws java.sql.SQLException
- Specified by:
close
in interface java.sql.Statement
- Overrides:
close
in class StatementWrapper
- Throws:
java.sql.SQLException
isClosed
public boolean isClosed()
throws java.sql.SQLException
- Specified by:
isClosed
in interface java.sql.Statement
- Overrides:
isClosed
in class StatementWrapper
- Throws:
java.sql.SQLException
setPoolable
public void setPoolable(boolean poolable)
throws java.sql.SQLException
- Specified by:
setPoolable
in interface java.sql.Statement
- Overrides:
setPoolable
in class StatementWrapper
- Throws:
java.sql.SQLException
isPoolable
public boolean isPoolable()
throws java.sql.SQLException
- Specified by:
isPoolable
in interface java.sql.Statement
- Overrides:
isPoolable
in class StatementWrapper
- Throws:
java.sql.SQLException
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
- Returns true if this either implements the interface argument or is
directly or indirectly a wrapper for an object that does. Returns false
otherwise. If this implements the interface then return true, else if
this is a wrapper then return the result of recursively calling
isWrapperFor
on the wrapped object. If this does not
implement the interface and is not a wrapper, return false. This method
should be implemented as a low-cost operation compared to
unwrap
so that callers can use this method to avoid
expensive unwrap
calls that may fail. If this method
returns true then calling unwrap
with the same argument
should succeed.
- Specified by:
isWrapperFor
in interface java.sql.Wrapper
- Overrides:
isWrapperFor
in class StatementWrapper
- Parameters:
interfaces
- a Class defining an interface.
- Returns:
- true if this implements the interface or directly or indirectly
wraps an object that does.
- Throws:
java.sql.SQLException
- if an error occurs while determining whether this is a
wrapper for an object with the given interface.- Since:
- 1.6
unwrap
public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
- Returns an object that implements the given interface to allow access to
non-standard methods, or standard methods not exposed by the proxy. The
result may be either the object found to implement the interface or a
proxy for that object. If the receiver implements the interface then that
is the object. If the receiver is a wrapper and the wrapped object
implements the interface then that is the object. Otherwise the object is
the result of calling
unwrap
recursively on the wrapped
object. If the receiver is not a wrapper and does not implement the
interface, then an SQLException
is thrown.
- Specified by:
unwrap
in interface java.sql.Wrapper
- Overrides:
unwrap
in class StatementWrapper
- Parameters:
iface
- A Class defining an interface that the result must implement.
- Returns:
- an object that implements the interface. May be a proxy for the
actual implementing object.
- Throws:
java.sql.SQLException
- If no object found that implements the interface- Since:
- 1.6
checkAndFireConnectionError
protected void checkAndFireConnectionError(java.sql.SQLException sqlEx)
throws java.sql.SQLException
- Fires connection error event if required, before re-throwing exception
- Parameters:
sqlEx
- the SQLException that has ocurred
- Throws:
java.sql.SQLException
- (rethrown)