Package net.sourceforge.jtds.jdbcx.proxy
Class PreparedStatementProxy
java.lang.Object
net.sourceforge.jtds.jdbcx.proxy.StatementProxy
net.sourceforge.jtds.jdbcx.proxy.PreparedStatementProxy
- All Implemented Interfaces:
AutoCloseable
,PreparedStatement
,Statement
,Wrapper
- Direct Known Subclasses:
CallableStatementProxy
This class would be better implemented as a java.lang.reflect.Proxy. However, this
feature was not added until 1.3 and reflection performance was not improved until 1.4.
Since the driver still needs to be compatible with 1.2 and 1.3 this class is used
to delegate the calls to a prepared statement with minimal overhead.
- Version:
- $Id: PreparedStatementProxy.java,v 1.3.4.3 2009-12-30 08:45:34 ickzon Exp $
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionPreparedStatementProxy
(ConnectionProxy connection, JtdsPreparedStatement preparedStatement) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatch()
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.boolean
execute()
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.int
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.boolean
isClosed()
boolean
boolean
isWrapperFor
(Class arg0) void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setAsciiStream
(int parameterIndex, InputStream x) void
setAsciiStream
(int parameterIndex, InputStream x, int length) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setAsciiStream
(int parameterIndex, InputStream x, long length) void
setBigDecimal
(int parameterIndex, BigDecimal x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setBinaryStream
(int parameterIndex, InputStream x) void
setBinaryStream
(int parameterIndex, InputStream x, int length) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setBinaryStream
(int parameterIndex, InputStream x, long length) void
setBlob
(int parameterIndex, InputStream inputStream) void
setBlob
(int parameterIndex, InputStream inputStream, long length) void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setBoolean
(int parameterIndex, boolean x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setByte
(int parameterIndex, byte x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setBytes
(int parameterIndex, byte[] x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setCharacterStream
(int parameterIndex, Reader reader) void
setCharacterStream
(int parameterIndex, Reader x, int length) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setCharacterStream
(int parameterIndex, Reader reader, long length) void
void
void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setDouble
(int parameterIndex, double x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setFloat
(int parameterIndex, float x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setInt
(int parameterIndex, int x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setLong
(int parameterIndex, long x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setNCharacterStream
(int parameterIndex, Reader value) void
setNCharacterStream
(int parameterIndex, Reader value, long length) void
void
void
void
setNString
(int parameterIndex, String value) void
setNull
(int parameterIndex, int sqlType) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setPoolable
(boolean poolable) void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
void
setShort
(int parameterIndex, short x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setTimestamp
(int parameterIndex, Timestamp x) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setTimestamp
(int parameterIndex, Timestamp x, Calendar cal) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
setUnicodeStream
(int parameterIndex, InputStream x, int length) Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.void
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.Methods inherited from class net.sourceforge.jtds.jdbcx.proxy.StatementProxy
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, 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, isCloseOnCompletion, processSQLException, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, validateConnection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.PreparedStatement
executeLargeUpdate, setObject, setObject
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, 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, isCloseOnCompletion, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setQueryTimeout
-
Field Details
-
_preparedStatement
-
-
Constructor Details
-
PreparedStatementProxy
PreparedStatementProxy(ConnectionProxy connection, JtdsPreparedStatement preparedStatement)
-
-
Method Details
-
executeQuery
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
executeQuery
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
executeUpdate
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
executeUpdate
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setNull
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setBoolean
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setBoolean
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setByte
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setByte
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setShort
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setShort
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setInt
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setInt
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setLong
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setLong
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setFloat
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setFloat
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setDouble
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setDouble
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setBigDecimal
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setBigDecimal
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setString
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setString
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setBytes
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setBytes
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setDate
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setTime
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setTimestamp
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setAsciiStream
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setUnicodeStream
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setUnicodeStream
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setBinaryStream
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
clearParameters
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
clearParameters
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setObject
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setObject
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setObject
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
execute
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
execute
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
addBatch
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
addBatch
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setCharacterStream
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setRef
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setRef
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setBlob
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setClob
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setArray
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setArray
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
getMetaData
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
getMetaData
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setDate
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setTime
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setTimestamp
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setNull
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setURL
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
setURL
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
getParameterMetaData
Delgates calls to the prepared statement; SQLExceptions thrown from the prepared statement will cause an event to be fired on the connection pool listeners.- Specified by:
getParameterMetaData
in interfacePreparedStatement
- Throws:
SQLException
- if an error occurs
-
setAsciiStream
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setBlob
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setClob
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNCharacterStream
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNClob
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
-
setNString
- Specified by:
setNString
in interfacePreparedStatement
- Throws:
SQLException
-
setRowId
- Specified by:
setRowId
in interfacePreparedStatement
- Throws:
SQLException
-
setSQLXML
- Specified by:
setSQLXML
in interfacePreparedStatement
- Throws:
SQLException
-
isClosed
- Specified by:
isClosed
in interfaceStatement
- Overrides:
isClosed
in classStatementProxy
- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolable
in interfaceStatement
- Overrides:
isPoolable
in classStatementProxy
- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolable
in interfaceStatement
- Overrides:
setPoolable
in classStatementProxy
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Overrides:
isWrapperFor
in classStatementProxy
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Overrides:
unwrap
in classStatementProxy
- Throws:
SQLException
-