org.sourceforge.jxdbcon
Class AbstractPreparedStatement
java.lang.Object
|
+--org.sourceforge.jxdbcon.AbstractStatement
|
+--org.sourceforge.jxdbcon.AbstractPreparedStatement
- All Implemented Interfaces:
- PreparedStatement, Statement
- Direct Known Subclasses:
- AbstractCallableStatement, PGPreparedStatement
- public abstract class AbstractPreparedStatement
- extends AbstractStatement
- implements PreparedStatement
AbstractPreparedStatement implements generics of the PreparedStatement
interface.
An overriding class has to initialize the paramTypes/Context.
The setter functions implemented here delegate to their corresponding
methods in AbstractType.
TODO:
- Implement getParameterMetaData based on paramTypes.
- Version:
- $Revision: 1.9 $, $Date: 2002/03/16 01:26:07 $
- Author:
- Keve Müller
Method Summary |
void |
addBatch()
|
void |
clearParameters()
|
boolean |
execute()
Execute the statement. |
ResultSet |
executeQuery()
|
int |
executeUpdate()
|
ParameterMetaData |
getParameterMetaData()
|
void |
setArray(int parameterIndex,
Array val)
|
void |
setAsciiStream(int parameterIndex,
InputStream val,
int length)
|
void |
setBigDecimal(int parameterIndex,
BigDecimal val)
|
void |
setBinaryStream(int parameterIndex,
InputStream val,
int length)
|
void |
setBlob(int parameterIndex,
Blob val)
|
void |
setBoolean(int parameterIndex,
boolean val)
|
void |
setByte(int parameterIndex,
byte val)
|
void |
setBytes(int parameterIndex,
byte[] val)
|
void |
setCharacterStream(int parameterIndex,
Reader val,
int length)
|
void |
setClob(int parameterIndex,
Clob val)
|
void |
setDate(int parameterIndex,
Date val)
|
void |
setDate(int parameterIndex,
Date val,
Calendar cal)
|
void |
setDouble(int parameterIndex,
double val)
|
void |
setFloat(int parameterIndex,
float val)
|
void |
setInt(int parameterIndex,
int val)
|
void |
setLong(int parameterIndex,
long val)
|
void |
setNull(int parameterIndex,
int sqlType)
|
void |
setNull(int parameterIndex,
int sqlType,
String typeName)
|
void |
setObject(int parameterIndex,
Object val)
|
void |
setObject(int parameterIndex,
Object val,
int targetSqlType)
|
void |
setObject(int parameterIndex,
Object val,
int targetSqlType,
int scale)
|
void |
setRef(int parameterIndex,
Ref val)
|
void |
setShort(int parameterIndex,
short val)
|
void |
setString(int parameterIndex,
String val)
|
void |
setTime(int parameterIndex,
Time val)
|
void |
setTime(int parameterIndex,
Time val,
Calendar cal)
|
void |
setTimestamp(int parameterIndex,
Timestamp val)
|
void |
setTimestamp(int parameterIndex,
Timestamp val,
Calendar cal)
|
void |
setURL(int parameterIndex,
URL val)
|
Methods inherited from class org.sourceforge.jxdbcon.AbstractStatement |
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, finalize, getConnection, getCursorName, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
Methods inherited from interface java.sql.Statement |
addBatch, cancel, clearBatch, clearWarnings, close, 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 |
paramBuf
protected Object paramBuf
- The buffer to store the parameters in.
paramContext
protected ConversionContext paramContext
- The Context for converting to/form parameters.
paramSet
private BitSet paramSet
- A bitset that stores which parameters have been set.
paramTypes
protected AbstractType[] paramTypes
- The parameter types.
AbstractPreparedStatement
protected AbstractPreparedStatement(AbstractConnection conn,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
addBatch
public void addBatch()
throws SQLException
- Specified by:
addBatch
in interface PreparedStatement
SQLException
clearParameters
public final void clearParameters()
throws SQLException
- Specified by:
clearParameters
in interface PreparedStatement
SQLException
execute
public boolean execute()
throws SQLException
- Execute the statement.
This method checks whether all parameters are set.
Any overriding class should run this first and then do whatever
is needed to execute the query.
- Specified by:
execute
in interface PreparedStatement
SQLException
executeQuery
public final ResultSet executeQuery()
throws SQLException
- Specified by:
executeQuery
in interface PreparedStatement
SQLException
executeUpdate
public final int executeUpdate()
throws SQLException
- Specified by:
executeUpdate
in interface PreparedStatement
SQLException
getParameterMetaData
public ParameterMetaData getParameterMetaData()
throws SQLException
- Specified by:
getParameterMetaData
in interface PreparedStatement
SQLException
setArray
public final void setArray(int parameterIndex,
Array val)
throws SQLException
- Specified by:
setArray
in interface PreparedStatement
SQLException
setAsciiStream
public final void setAsciiStream(int parameterIndex,
InputStream val,
int length)
throws SQLException
- Specified by:
setAsciiStream
in interface PreparedStatement
SQLException
setBigDecimal
public final void setBigDecimal(int parameterIndex,
BigDecimal val)
throws SQLException
- Specified by:
setBigDecimal
in interface PreparedStatement
SQLException
setBinaryStream
public final void setBinaryStream(int parameterIndex,
InputStream val,
int length)
throws SQLException
- Specified by:
setBinaryStream
in interface PreparedStatement
SQLException
setBlob
public final void setBlob(int parameterIndex,
Blob val)
throws SQLException
- Specified by:
setBlob
in interface PreparedStatement
SQLException
setBoolean
public final void setBoolean(int parameterIndex,
boolean val)
throws SQLException
- Specified by:
setBoolean
in interface PreparedStatement
SQLException
setByte
public final void setByte(int parameterIndex,
byte val)
throws SQLException
- Specified by:
setByte
in interface PreparedStatement
SQLException
setBytes
public final void setBytes(int parameterIndex,
byte[] val)
throws SQLException
- Specified by:
setBytes
in interface PreparedStatement
SQLException
setCharacterStream
public final void setCharacterStream(int parameterIndex,
Reader val,
int length)
throws SQLException
- Specified by:
setCharacterStream
in interface PreparedStatement
SQLException
setClob
public final void setClob(int parameterIndex,
Clob val)
throws SQLException
- Specified by:
setClob
in interface PreparedStatement
SQLException
setDate
public final void setDate(int parameterIndex,
Date val)
throws SQLException
- Specified by:
setDate
in interface PreparedStatement
SQLException
setDate
public final void setDate(int parameterIndex,
Date val,
Calendar cal)
throws SQLException
- Specified by:
setDate
in interface PreparedStatement
SQLException
setDouble
public final void setDouble(int parameterIndex,
double val)
throws SQLException
- Specified by:
setDouble
in interface PreparedStatement
SQLException
setFloat
public final void setFloat(int parameterIndex,
float val)
throws SQLException
- Specified by:
setFloat
in interface PreparedStatement
SQLException
setInt
public final void setInt(int parameterIndex,
int val)
throws SQLException
- Specified by:
setInt
in interface PreparedStatement
SQLException
setLong
public final void setLong(int parameterIndex,
long val)
throws SQLException
- Specified by:
setLong
in interface PreparedStatement
SQLException
setNull
public final void setNull(int parameterIndex,
int sqlType)
throws SQLException
- Specified by:
setNull
in interface PreparedStatement
SQLException
setNull
public final void setNull(int parameterIndex,
int sqlType,
String typeName)
throws SQLException
- Specified by:
setNull
in interface PreparedStatement
SQLException
setObject
public final void setObject(int parameterIndex,
Object val)
throws SQLException
- Specified by:
setObject
in interface PreparedStatement
SQLException
setObject
public final void setObject(int parameterIndex,
Object val,
int targetSqlType)
throws SQLException
- Specified by:
setObject
in interface PreparedStatement
SQLException
setObject
public final void setObject(int parameterIndex,
Object val,
int targetSqlType,
int scale)
throws SQLException
- Specified by:
setObject
in interface PreparedStatement
SQLException
setRef
public final void setRef(int parameterIndex,
Ref val)
throws SQLException
- Specified by:
setRef
in interface PreparedStatement
SQLException
setShort
public final void setShort(int parameterIndex,
short val)
throws SQLException
- Specified by:
setShort
in interface PreparedStatement
SQLException
setString
public final void setString(int parameterIndex,
String val)
throws SQLException
- Specified by:
setString
in interface PreparedStatement
SQLException
setTime
public final void setTime(int parameterIndex,
Time val)
throws SQLException
- Specified by:
setTime
in interface PreparedStatement
SQLException
setTime
public final void setTime(int parameterIndex,
Time val,
Calendar cal)
throws SQLException
- Specified by:
setTime
in interface PreparedStatement
SQLException
setTimestamp
public final void setTimestamp(int parameterIndex,
Timestamp val)
throws SQLException
- Specified by:
setTimestamp
in interface PreparedStatement
SQLException
setTimestamp
public final void setTimestamp(int parameterIndex,
Timestamp val,
Calendar cal)
throws SQLException
- Specified by:
setTimestamp
in interface PreparedStatement
SQLException
setURL
public final void setURL(int parameterIndex,
URL val)
throws SQLException
- Specified by:
setURL
in interface PreparedStatement
SQLException
Copyright © 2001,2002 Keve Müller; see LICENSE file for details.