com.mysql.jdbc.jdbc2.optional
Class JDBC4PreparedStatementWrapper
java.lang.Object
com.mysql.jdbc.jdbc2.optional.StatementWrapper
com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper
com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper
- All Implemented Interfaces:
- java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper
public class JDBC4PreparedStatementWrapper
- extends PreparedStatementWrapper
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 |
setAsciiStream(int parameterIndex,
java.io.InputStream x)
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length)
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x)
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length)
|
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream)
|
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length)
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader)
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
long length)
|
void |
setClob(int parameterIndex,
java.io.Reader reader)
|
void |
setClob(int parameterIndex,
java.io.Reader reader,
long length)
|
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value)
|
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value,
long length)
|
void |
setNClob(int parameterIndex,
java.sql.NClob value)
|
void |
setNClob(int parameterIndex,
java.io.Reader reader)
|
void |
setNClob(int parameterIndex,
java.io.Reader reader,
long length)
|
void |
setNString(int parameterIndex,
java.lang.String value)
|
void |
setPoolable(boolean poolable)
|
void |
setRowId(int parameterIndex,
java.sql.RowId x)
|
void |
setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject)
|
|
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.PreparedStatementWrapper |
addBatch, clearParameters, execute, executeQuery, executeUpdate, getInstance, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
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 |
Methods inherited from interface java.sql.Statement |
addBatch, cancel, clearBatch, clearWarnings, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
pooledConnection
protected MysqlPooledConnection pooledConnection
unwrappedInterfaces
protected java.util.Map unwrappedInterfaces
JDBC4PreparedStatementWrapper
public JDBC4PreparedStatementWrapper(ConnectionWrapper c,
MysqlPooledConnection conn,
java.sql.PreparedStatement 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
setRowId
public void setRowId(int parameterIndex,
java.sql.RowId x)
throws java.sql.SQLException
- Specified by:
setRowId
in interface java.sql.PreparedStatement
- Overrides:
setRowId
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setNClob
public void setNClob(int parameterIndex,
java.sql.NClob value)
throws java.sql.SQLException
- Specified by:
setNClob
in interface java.sql.PreparedStatement
- Overrides:
setNClob
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setSQLXML
public void setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject)
throws java.sql.SQLException
- Specified by:
setSQLXML
in interface java.sql.PreparedStatement
- Overrides:
setSQLXML
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setNString
public void setNString(int parameterIndex,
java.lang.String value)
throws java.sql.SQLException
- Specified by:
setNString
in interface java.sql.PreparedStatement
- Overrides:
setNString
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setNCharacterStream
public void setNCharacterStream(int parameterIndex,
java.io.Reader value,
long length)
throws java.sql.SQLException
- Specified by:
setNCharacterStream
in interface java.sql.PreparedStatement
- Overrides:
setNCharacterStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setClob
public void setClob(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
- Specified by:
setClob
in interface java.sql.PreparedStatement
- Overrides:
setClob
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setBlob
public void setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length)
throws java.sql.SQLException
- Specified by:
setBlob
in interface java.sql.PreparedStatement
- Overrides:
setBlob
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setNClob
public void setNClob(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
- Specified by:
setNClob
in interface java.sql.PreparedStatement
- Overrides:
setNClob
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setAsciiStream
public void setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length)
throws java.sql.SQLException
- Specified by:
setAsciiStream
in interface java.sql.PreparedStatement
- Overrides:
setAsciiStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setBinaryStream
public void setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length)
throws java.sql.SQLException
- Specified by:
setBinaryStream
in interface java.sql.PreparedStatement
- Overrides:
setBinaryStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setCharacterStream
public void setCharacterStream(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
- Specified by:
setCharacterStream
in interface java.sql.PreparedStatement
- Overrides:
setCharacterStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setAsciiStream
public void setAsciiStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
- Specified by:
setAsciiStream
in interface java.sql.PreparedStatement
- Overrides:
setAsciiStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setBinaryStream
public void setBinaryStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
- Specified by:
setBinaryStream
in interface java.sql.PreparedStatement
- Overrides:
setBinaryStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setCharacterStream
public void setCharacterStream(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
- Specified by:
setCharacterStream
in interface java.sql.PreparedStatement
- Overrides:
setCharacterStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setNCharacterStream
public void setNCharacterStream(int parameterIndex,
java.io.Reader value)
throws java.sql.SQLException
- Specified by:
setNCharacterStream
in interface java.sql.PreparedStatement
- Overrides:
setNCharacterStream
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setClob
public void setClob(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
- Specified by:
setClob
in interface java.sql.PreparedStatement
- Overrides:
setClob
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setBlob
public void setBlob(int parameterIndex,
java.io.InputStream inputStream)
throws java.sql.SQLException
- Specified by:
setBlob
in interface java.sql.PreparedStatement
- Overrides:
setBlob
in class PreparedStatementWrapper
- Throws:
java.sql.SQLException
setNClob
public void setNClob(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
- Specified by:
setNClob
in interface java.sql.PreparedStatement
- Overrides:
setNClob
in class PreparedStatementWrapper
- 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 PreparedStatementWrapper
- 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 PreparedStatementWrapper
- 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)