类 PreparedStatementWrapper
- java.lang.Object
-
- com.mysql.cj.jdbc.StatementWrapper
-
- com.mysql.cj.jdbc.PreparedStatementWrapper
-
- 所有已实现的接口:
AutoCloseable,PreparedStatement,Statement,Wrapper
- 直接已知子类:
CallableStatementWrapper
public class PreparedStatementWrapper extends StatementWrapper implements PreparedStatement
Wraps prepared statements so that errors can be reported correctly to ConnectionEventListeners.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ExceptionInterceptorexceptionInterceptorprotected MysqlPooledConnectionpooledConnectionprotected Map<Class<?>,Object>unwrappedInterfaces-
从类继承的字段 com.mysql.cj.jdbc.StatementWrapper
wrappedConn, wrappedStmt
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 voidaddBatch()protected voidcheckAndFireConnectionError(SQLException sqlEx)Fires connection error event if required, before re-throwing exceptionvoidclearParameters()voidclose()booleanexecute()longexecuteLargeUpdate()ResultSetexecuteQuery()intexecuteUpdate()protected static PreparedStatementWrappergetInstance(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap)ResultSetMetaDatagetMetaData()ParameterMetaDatagetParameterMetaData()booleanisWrapperFor(Class<?> iface)voidsetArray(int parameterIndex, Array x)voidsetAsciiStream(int parameterIndex, InputStream x)voidsetAsciiStream(int parameterIndex, InputStream x, int length)voidsetAsciiStream(int parameterIndex, InputStream x, long length)voidsetBigDecimal(int parameterIndex, BigDecimal x)voidsetBinaryStream(int parameterIndex, InputStream x)voidsetBinaryStream(int parameterIndex, InputStream x, int length)voidsetBinaryStream(int parameterIndex, InputStream x, long length)voidsetBlob(int parameterIndex, InputStream inputStream)voidsetBlob(int parameterIndex, InputStream inputStream, long length)voidsetBlob(int parameterIndex, Blob x)voidsetBoolean(int parameterIndex, boolean x)voidsetByte(int parameterIndex, byte x)voidsetBytes(int parameterIndex, byte[] x)voidsetCharacterStream(int parameterIndex, Reader reader)voidsetCharacterStream(int parameterIndex, Reader reader, int length)voidsetCharacterStream(int parameterIndex, Reader reader, long length)voidsetClob(int parameterIndex, Reader reader)voidsetClob(int parameterIndex, Reader reader, long length)voidsetClob(int parameterIndex, Clob x)voidsetDate(int parameterIndex, Date x)voidsetDate(int parameterIndex, Date x, Calendar cal)voidsetDouble(int parameterIndex, double x)voidsetFloat(int parameterIndex, float x)voidsetInt(int parameterIndex, int x)voidsetLong(int parameterIndex, long x)voidsetNCharacterStream(int parameterIndex, Reader value)voidsetNCharacterStream(int parameterIndex, Reader value, long length)voidsetNClob(int parameterIndex, Reader reader)voidsetNClob(int parameterIndex, Reader reader, long length)voidsetNClob(int parameterIndex, NClob value)voidsetNString(int parameterIndex, String value)voidsetNull(int parameterIndex, int sqlType)voidsetNull(int parameterIndex, int sqlType, String typeName)voidsetObject(int parameterIndex, Object x)voidsetObject(int parameterIndex, Object x, int targetSqlType)voidsetObject(int parameterIndex, Object x, int targetSqlType, int scale)voidsetObject(int parameterIndex, Object x, SQLType targetSqlType)voidsetObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)voidsetRef(int parameterIndex, Ref x)voidsetRowId(int parameterIndex, RowId x)voidsetShort(int parameterIndex, short x)voidsetSQLXML(int parameterIndex, SQLXML xmlObject)voidsetString(int parameterIndex, String x)voidsetTime(int parameterIndex, Time x)voidsetTime(int parameterIndex, Time x, Calendar cal)voidsetTimestamp(int parameterIndex, Timestamp x)voidsetTimestamp(int parameterIndex, Timestamp x, Calendar cal)voidsetUnicodeStream(int parameterIndex, InputStream x, int length)已过时。voidsetURL(int parameterIndex, URL x)StringtoString()<T> Tunwrap(Class<T> iface)-
从类继承的方法 com.mysql.cj.jdbc.StatementWrapper
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, enableStreamingResults, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getInstance, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
-
-
-
字段详细资料
-
pooledConnection
protected MysqlPooledConnection pooledConnection
-
exceptionInterceptor
protected ExceptionInterceptor exceptionInterceptor
-
-
方法详细资料
-
getInstance
protected static PreparedStatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) throws SQLException
- 抛出:
SQLException
-
setArray
public void setArray(int parameterIndex, Array x) throws SQLException- 指定者:
setArray在接口中PreparedStatement- 抛出:
SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException- 指定者:
setAsciiStream在接口中PreparedStatement- 抛出:
SQLException
-
setBigDecimal
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException- 指定者:
setBigDecimal在接口中PreparedStatement- 抛出:
SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException- 指定者:
setBinaryStream在接口中PreparedStatement- 抛出:
SQLException
-
setBlob
public void setBlob(int parameterIndex, Blob x) throws SQLException- 指定者:
setBlob在接口中PreparedStatement- 抛出:
SQLException
-
setBoolean
public void setBoolean(int parameterIndex, boolean x) throws SQLException- 指定者:
setBoolean在接口中PreparedStatement- 抛出:
SQLException
-
setByte
public void setByte(int parameterIndex, byte x) throws SQLException- 指定者:
setByte在接口中PreparedStatement- 抛出:
SQLException
-
setBytes
public void setBytes(int parameterIndex, byte[] x) throws SQLException- 指定者:
setBytes在接口中PreparedStatement- 抛出:
SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException- 指定者:
setCharacterStream在接口中PreparedStatement- 抛出:
SQLException
-
setClob
public void setClob(int parameterIndex, Clob x) throws SQLException- 指定者:
setClob在接口中PreparedStatement- 抛出:
SQLException
-
setDate
public void setDate(int parameterIndex, Date x) throws SQLException- 指定者:
setDate在接口中PreparedStatement- 抛出:
SQLException
-
setDate
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException- 指定者:
setDate在接口中PreparedStatement- 抛出:
SQLException
-
setDouble
public void setDouble(int parameterIndex, double x) throws SQLException- 指定者:
setDouble在接口中PreparedStatement- 抛出:
SQLException
-
setFloat
public void setFloat(int parameterIndex, float x) throws SQLException- 指定者:
setFloat在接口中PreparedStatement- 抛出:
SQLException
-
setInt
public void setInt(int parameterIndex, int x) throws SQLException- 指定者:
setInt在接口中PreparedStatement- 抛出:
SQLException
-
setLong
public void setLong(int parameterIndex, long x) throws SQLException- 指定者:
setLong在接口中PreparedStatement- 抛出:
SQLException
-
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
- 指定者:
getMetaData在接口中PreparedStatement- 抛出:
SQLException
-
setNull
public void setNull(int parameterIndex, int sqlType) throws SQLException- 指定者:
setNull在接口中PreparedStatement- 抛出:
SQLException
-
setNull
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException- 指定者:
setNull在接口中PreparedStatement- 抛出:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x) throws SQLException- 指定者:
setObject在接口中PreparedStatement- 抛出:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException- 指定者:
setObject在接口中PreparedStatement- 抛出:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException- 指定者:
setObject在接口中PreparedStatement- 抛出:
SQLException
-
getParameterMetaData
public ParameterMetaData getParameterMetaData() throws SQLException
- 指定者:
getParameterMetaData在接口中PreparedStatement- 抛出:
SQLException
-
setRef
public void setRef(int parameterIndex, Ref x) throws SQLException- 指定者:
setRef在接口中PreparedStatement- 抛出:
SQLException
-
setShort
public void setShort(int parameterIndex, short x) throws SQLException- 指定者:
setShort在接口中PreparedStatement- 抛出:
SQLException
-
setString
public void setString(int parameterIndex, String x) throws SQLException- 指定者:
setString在接口中PreparedStatement- 抛出:
SQLException
-
setTime
public void setTime(int parameterIndex, Time x) throws SQLException- 指定者:
setTime在接口中PreparedStatement- 抛出:
SQLException
-
setTime
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException- 指定者:
setTime在接口中PreparedStatement- 抛出:
SQLException
-
setTimestamp
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException- 指定者:
setTimestamp在接口中PreparedStatement- 抛出:
SQLException
-
setTimestamp
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException- 指定者:
setTimestamp在接口中PreparedStatement- 抛出:
SQLException
-
setURL
public void setURL(int parameterIndex, URL x) throws SQLException- 指定者:
setURL在接口中PreparedStatement- 抛出:
SQLException
-
setUnicodeStream
@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
已过时。- 指定者:
setUnicodeStream在接口中PreparedStatement- 抛出:
SQLException
-
addBatch
public void addBatch() throws SQLException- 指定者:
addBatch在接口中PreparedStatement- 抛出:
SQLException
-
clearParameters
public void clearParameters() throws SQLException- 指定者:
clearParameters在接口中PreparedStatement- 抛出:
SQLException
-
execute
public boolean execute() throws SQLException- 指定者:
execute在接口中PreparedStatement- 抛出:
SQLException
-
executeQuery
public ResultSet executeQuery() throws SQLException
- 指定者:
executeQuery在接口中PreparedStatement- 抛出:
SQLException
-
executeUpdate
public int executeUpdate() throws SQLException- 指定者:
executeUpdate在接口中PreparedStatement- 抛出:
SQLException
-
setRowId
public void setRowId(int parameterIndex, RowId x) throws SQLException- 指定者:
setRowId在接口中PreparedStatement- 抛出:
SQLException
-
setNString
public void setNString(int parameterIndex, String value) throws SQLException- 指定者:
setNString在接口中PreparedStatement- 抛出:
SQLException
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException- 指定者:
setNCharacterStream在接口中PreparedStatement- 抛出:
SQLException
-
setNClob
public void setNClob(int parameterIndex, NClob value) throws SQLException- 指定者:
setNClob在接口中PreparedStatement- 抛出:
SQLException
-
setClob
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException- 指定者:
setClob在接口中PreparedStatement- 抛出:
SQLException
-
setBlob
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException- 指定者:
setBlob在接口中PreparedStatement- 抛出:
SQLException
-
setNClob
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException- 指定者:
setNClob在接口中PreparedStatement- 抛出:
SQLException
-
setSQLXML
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException- 指定者:
setSQLXML在接口中PreparedStatement- 抛出:
SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException- 指定者:
setAsciiStream在接口中PreparedStatement- 抛出:
SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException- 指定者:
setBinaryStream在接口中PreparedStatement- 抛出:
SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException- 指定者:
setCharacterStream在接口中PreparedStatement- 抛出:
SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException- 指定者:
setAsciiStream在接口中PreparedStatement- 抛出:
SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException- 指定者:
setBinaryStream在接口中PreparedStatement- 抛出:
SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException- 指定者:
setCharacterStream在接口中PreparedStatement- 抛出:
SQLException
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException- 指定者:
setNCharacterStream在接口中PreparedStatement- 抛出:
SQLException
-
setClob
public void setClob(int parameterIndex, Reader reader) throws SQLException- 指定者:
setClob在接口中PreparedStatement- 抛出:
SQLException
-
setBlob
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException- 指定者:
setBlob在接口中PreparedStatement- 抛出:
SQLException
-
setNClob
public void setNClob(int parameterIndex, Reader reader) throws SQLException- 指定者:
setNClob在接口中PreparedStatement- 抛出:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- 指定者:
isWrapperFor在接口中Wrapper- 覆盖:
isWrapperFor在类中StatementWrapper- 抛出:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- 指定者:
unwrap在接口中Wrapper- 覆盖:
unwrap在类中StatementWrapper- 抛出:
SQLException
-
close
public void close() throws SQLException- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Statement- 覆盖:
close在类中StatementWrapper- 抛出:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate() throws SQLException- 指定者:
executeLargeUpdate在接口中PreparedStatement- 抛出:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException- 指定者:
setObject在接口中PreparedStatement- 抛出:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException- 指定者:
setObject在接口中PreparedStatement- 抛出:
SQLException
-
checkAndFireConnectionError
protected void checkAndFireConnectionError(SQLException sqlEx) throws SQLException
Fires connection error event if required, before re-throwing exception- 参数:
sqlEx- the SQLException that has occurred- 抛出:
SQLException- (rethrown)
-
-