Package com.spotfire.ws.im.ds.sql
Class PreparedStatementWrapper
- java.lang.Object
-
- com.spotfire.ws.im.ds.sql.StatementWrapper
-
- com.spotfire.ws.im.ds.sql.PreparedStatementWrapper
-
- All Implemented Interfaces:
AutoCloseable
,PreparedStatement
,Statement
,Wrapper
public class PreparedStatementWrapper extends StatementWrapper implements PreparedStatement
Use this class for creating wrapper classes around thePreparedStatement
interface. The subclass can override the methods that need to show a different behavior than the wrapped object.- Since:
- 3.0
- Author:
- Magnus Rylander
- See Also:
SQLRuntime.prepareUpdate(java.lang.String)
,SQLRuntime.prepareQuery(java.lang.String)
-
-
Field Summary
-
Fields inherited from class com.spotfire.ws.im.ds.sql.StatementWrapper
m_stmt
-
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
-
-
Constructor Summary
Constructors Constructor Description PreparedStatementWrapper(PreparedStatement stmt)
Creates a newPreparedStatementWrapper
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addBatch()
void
clearParameters()
boolean
execute()
ResultSet
executeQuery()
int
executeUpdate()
ResultSetMetaData
getMetaData()
ParameterMetaData
getParameterMetaData()
void
setArray(int idx, Array x)
void
setAsciiStream(int parameterIndex, InputStream x)
void
setAsciiStream(int idx, InputStream x, int length)
void
setAsciiStream(int parameterIndex, InputStream x, long length)
void
setBigDecimal(int idx, BigDecimal x)
void
setBinaryStream(int parameterIndex, InputStream x)
void
setBinaryStream(int idx, InputStream x, int length)
void
setBinaryStream(int parameterIndex, InputStream x, long length)
void
setBlob(int parameterIndex, InputStream inputStream)
void
setBlob(int parameterIndex, InputStream inputStream, long length)
void
setBlob(int idx, Blob x)
void
setBoolean(int idx, boolean x)
void
setByte(int idx, byte x)
void
setBytes(int idx, byte[] x)
void
setCharacterStream(int parameterIndex, Reader x)
void
setCharacterStream(int idx, Reader reader, int length)
void
setCharacterStream(int parameterIndex, Reader x, long length)
void
setClob(int parameterIndex, Reader reader)
void
setClob(int parameterIndex, Reader reader, long length)
void
setClob(int idx, Clob x)
void
setDate(int idx, Date x)
void
setDate(int idx, Date x, Calendar cal)
void
setDouble(int idx, double x)
void
setFloat(int idx, float x)
void
setInt(int idx, int x)
void
setLong(int idx, long x)
void
setNCharacterStream(int parameterIndex, Reader x)
void
setNCharacterStream(int parameterIndex, Reader x, long length)
void
setNClob(int parameterIndex, Reader reader)
void
setNClob(int parameterIndex, Reader reader, long length)
void
setNClob(int parameterIndex, NClob value)
void
setNString(int parameterIndex, String value)
void
setNull(int idx, int sqlType)
void
setNull(int idx, int sqlType, String typeName)
void
setObject(int idx, Object x)
void
setObject(int idx, Object x, int targetSqlType)
void
setObject(int idx, Object x, int targetSqlType, int scale)
void
setRef(int idx, Ref x)
void
setRowId(int parameterIndex, RowId x)
void
setShort(int idx, short x)
void
setSQLXML(int parameterIndex, SQLXML xmlObject)
void
setString(int idx, String x)
void
setTime(int idx, Time x)
void
setTime(int idx, Time x, Calendar cal)
void
setTimestamp(int idx, Timestamp x)
void
setTimestamp(int idx, Timestamp x, Calendar cal)
void
setUnicodeStream(int idx, InputStream x, int length)
Deprecated.deprecatedvoid
setURL(int parameterIndex, URL x)
-
Methods inherited from class com.spotfire.ws.im.ds.sql.StatementWrapper
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, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
-
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, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Constructor Detail
-
PreparedStatementWrapper
public PreparedStatementWrapper(PreparedStatement stmt)
Creates a newPreparedStatementWrapper
instance.- Parameters:
stmt
- thePreparedStatement
to be wrapped- Since:
- 3.0
-
-
Method Detail
-
executeQuery
public ResultSet executeQuery() throws SQLException
- Specified by:
executeQuery
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
executeUpdate
public int executeUpdate() throws SQLException
- Specified by:
executeUpdate
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNull
public void setNull(int idx, int sqlType) throws SQLException
- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBoolean
public void setBoolean(int idx, boolean x) throws SQLException
- Specified by:
setBoolean
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setByte
public void setByte(int idx, byte x) throws SQLException
- Specified by:
setByte
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setShort
public void setShort(int idx, short x) throws SQLException
- Specified by:
setShort
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setInt
public void setInt(int idx, int x) throws SQLException
- Specified by:
setInt
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setLong
public void setLong(int idx, long x) throws SQLException
- Specified by:
setLong
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setFloat
public void setFloat(int idx, float x) throws SQLException
- Specified by:
setFloat
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setDouble
public void setDouble(int idx, double x) throws SQLException
- Specified by:
setDouble
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBigDecimal
public void setBigDecimal(int idx, BigDecimal x) throws SQLException
- Specified by:
setBigDecimal
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setString
public void setString(int idx, String x) throws SQLException
- Specified by:
setString
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBytes
public void setBytes(int idx, byte[] x) throws SQLException
- Specified by:
setBytes
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setDate
public void setDate(int idx, Date x) throws SQLException
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setTime
public void setTime(int idx, Time x) throws SQLException
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setTimestamp
public void setTimestamp(int idx, Timestamp x) throws SQLException
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setAsciiStream
public void setAsciiStream(int idx, InputStream x, int length) throws SQLException
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setUnicodeStream
@Deprecated public void setUnicodeStream(int idx, InputStream x, int length) throws SQLException
Deprecated.deprecated- Specified by:
setUnicodeStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBinaryStream
public void setBinaryStream(int idx, InputStream x, int length) throws SQLException
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
clearParameters
public void clearParameters() throws SQLException
- Specified by:
clearParameters
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setObject
public void setObject(int idx, Object x, int targetSqlType, int scale) throws SQLException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setObject
public void setObject(int idx, Object x, int targetSqlType) throws SQLException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setObject
public void setObject(int idx, Object x) throws SQLException
- Specified by:
setObject
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
execute
public boolean execute() throws SQLException
- Specified by:
execute
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
addBatch
public void addBatch() throws SQLException
- Specified by:
addBatch
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setCharacterStream
public void setCharacterStream(int idx, Reader reader, int length) throws SQLException
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setRef
public void setRef(int idx, Ref x) throws SQLException
- Specified by:
setRef
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBlob
public void setBlob(int idx, Blob x) throws SQLException
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setClob
public void setClob(int idx, Clob x) throws SQLException
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setArray
public void setArray(int idx, Array x) throws SQLException
- Specified by:
setArray
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
- Specified by:
getMetaData
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setDate
public void setDate(int idx, Date x, Calendar cal) throws SQLException
- Specified by:
setDate
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setTime
public void setTime(int idx, Time x, Calendar cal) throws SQLException
- Specified by:
setTime
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setTimestamp
public void setTimestamp(int idx, Timestamp x, Calendar cal) throws SQLException
- Specified by:
setTimestamp
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNull
public void setNull(int idx, int sqlType, String typeName) throws SQLException
- Specified by:
setNull
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setURL
public void setURL(int parameterIndex, URL x) throws SQLException
- Specified by:
setURL
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
getParameterMetaData
public ParameterMetaData getParameterMetaData() throws SQLException
- Specified by:
getParameterMetaData
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setAsciiStream
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
- Specified by:
setAsciiStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBinaryStream
public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
- Specified by:
setBinaryStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBlob
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setBlob
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
- Specified by:
setBlob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader x) throws SQLException
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setCharacterStream
public void setCharacterStream(int parameterIndex, Reader x, long length) throws SQLException
- Specified by:
setCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setClob
public void setClob(int parameterIndex, Reader reader) throws SQLException
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setClob
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
- Specified by:
setClob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNClob
public void setNClob(int parameterIndex, NClob value) throws SQLException
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNClob
public void setNClob(int parameterIndex, Reader reader) throws SQLException
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNClob
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
- Specified by:
setNClob
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNString
public void setNString(int parameterIndex, String value) throws SQLException
- Specified by:
setNString
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, Reader x) throws SQLException
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, Reader x, long length) throws SQLException
- Specified by:
setNCharacterStream
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setRowId
public void setRowId(int parameterIndex, RowId x) throws SQLException
- Specified by:
setRowId
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
setSQLXML
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
- Specified by:
setSQLXML
in interfacePreparedStatement
- Throws:
SQLException
- Since:
- 3.0
-
-