| java.lang.Object com.internetcds.jdbc.tds.Statement com.internetcds.jdbc.tds.PreparedStatement_base
All known Subclasses: com.internetcds.jdbc.tds.PreparedStatement_2_0, com.internetcds.jdbc.tds.CallableStatement_base,
PreparedStatement_base | public class PreparedStatement_base extends com.internetcds.jdbc.tds.Statement implements PreparedStatementHelper(Code) | | A SQL statement is pre-compiled and stored in a
PreparedStatement object. This object can then be used to
efficiently execute this statement multiple times.
Note: The setXXX methods for setting IN parameter values
must specify types that are compatible with the defined SQL type of
the input parameter. For instance, if the IN parameter has SQL type
Integer then setInt should be used.
If arbitrary parameter type conversions are required then the
setObject method should be used with a target SQL type.
author: Craig Spannring author: The FreeTDS project version: $Id: PreparedStatement_base.java,v 1.2 2007-10-19 13:21:40 sinisa Exp $ See Also: Connection.prepareStatement See Also: ResultSet |
Method Summary | |
protected void | NotImplemented() | public void | clearParameters() In general, parameter values remain in force for repeated use of a
Statement. | public void | dropAllProcedures() | public boolean | execute() Some prepared statements return multiple results; the execute
method handles these complex statements as well as the simpler
form of statements handled by executeQuery and executeUpdate. | protected boolean | executeCall(String name, ParameterListItem[] formalParameterList, ParameterListItem[] actualParameterList) | public java.sql.ResultSet | executeQuery() A prepared SQL query is executed and its ResultSet is returned. | public int | executeUpdate() Execute a SQL INSERT, UPDATE or DELETE statement. | public static void | main(String args) | public void | setAsciiStream(int parameterIndex, java.io.InputStream x, int length) When a very large ASCII value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream. | public void | setBigDecimal(int parameterIndex, BigDecimal x) Set a parameter to a java.lang.BigDecimal value. | public void | setBinaryStream(int parameterIndex, java.io.InputStream x, int length) When a very large binary value is input to a LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream. | public void | setBoolean(int parameterIndex, boolean x) Set a parameter to a Java boolean value. | public void | setByte(int index, byte x) Set a parameter to a Java byte value. | public void | setBytes(int parameterIndex, byte x) Set a parameter to a Java array of bytes. | public void | setDate(int parameterIndex, java.sql.Date value) Set a parameter to a java.sql.Date value. | public void | setDouble(int parameterIndex, double value) Set a parameter to a Java double value. | public void | setFloat(int parameterIndex, float value) Set a parameter to a Java float value. | public void | setInt(int index, int value) Set a parameter to a Java int value. | public void | setLong(int parameterIndex, long value) Set a parameter to a Java long value. | public void | setNull(int index, int type) Set a parameter to SQL NULL. | public void | setObject(int parameterIndex, Object x) Set the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
The JDBC specification specifies a standard mapping from
Java Object types to SQL types. | public void | setObject(int parameterIndex, Object x, int targetSqlType) This method is like setObject above, but assumes a scale of zero. | public void | setObject(int parameterIndex, Object x, int targetSqlType, int scale) Set the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
The given Java object will be converted to the targetSqlType
before being sent to the database.
Note that this method may be used to pass datatabase-
specific abstract data types. | public void | setShort(int index, short value) Set a parameter to a Java short value. | public void | setString(int index, String str) Set a parameter to a Java String value. | public void | setTime(int parameterIndex, java.sql.Time x) Set a parameter to a java.sql.Time value. | public void | setTimestamp(int index, java.sql.Timestamp value) Set a parameter to a java.sql.Timestamp value. | public void | setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream. |
clearParameters | public void clearParameters() throws SQLException(Code) | | In general, parameter values remain in force for repeated use of a
Statement. Setting a parameter value automatically clears its
previous value. However, in some cases it is useful to immediately
release the resources used by the current parameter values; this can
be done by calling clearParameters.
exception: SQLException - if a database-access error occurs. |
dropAllProcedures | public void dropAllProcedures()(Code) | | |
execute | public boolean execute() throws SQLException(Code) | | Some prepared statements return multiple results; the execute
method handles these complex statements as well as the simpler
form of statements handled by executeQuery and executeUpdate.
exception: SQLException - if a database-access error occurs. See Also: Statement.execute |
executeQuery | public java.sql.ResultSet executeQuery() throws SQLException(Code) | | A prepared SQL query is executed and its ResultSet is returned.
a ResultSet that contains the data produced by thequery; never null exception: SQLException - if a database-access error occurs. |
executeUpdate | public int executeUpdate() throws SQLException(Code) | | Execute a SQL INSERT, UPDATE or DELETE statement. In addition,
SQL statements that return nothing such as SQL DDL statements
can be executed.
either the row count for INSERT, UPDATE or DELETE; or 0for SQL statements that return nothing exception: SQLException - if a database-access error occurs. |
setAsciiStream | public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code) | | When a very large ASCII value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream. JDBC will read the data from the stream
as needed, until it reaches end-of-file. The JDBC driver will
do any necessary conversion from ASCII to the database char format.
Note: This stream object can either be a standard
Java stream object or your own subclass that implements the
standard interface.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the java input stream which contains the ASCII parameter value Parameters: length - the number of bytes in the stream exception: SQLException - if a database-access error occurs. |
setBigDecimal | public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException(Code) | | Set a parameter to a java.lang.BigDecimal value.
The driver converts this to a SQL NUMERIC value when
it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setBinaryStream | public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code) | | When a very large binary value is input to a LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream. JDBC will read the data from the stream
as needed, until it reaches end-of-file.
Note: This stream object can either be a standard
Java stream object or your own subclass that implements the
standard interface.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the java input stream which contains the binary parameter value Parameters: length - the number of bytes in the stream exception: SQLException - if a database-access error occurs. |
setBoolean | public void setBoolean(int parameterIndex, boolean x) throws SQLException(Code) | | Set a parameter to a Java boolean value. The driver converts this
to a SQL BIT value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setByte | public void setByte(int index, byte x) throws SQLException(Code) | | Set a parameter to a Java byte value. The driver converts this
to a SQL TINYINT value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setBytes | public void setBytes(int parameterIndex, byte x) throws SQLException(Code) | | Set a parameter to a Java array of bytes. The driver converts
this to a SQL VARBINARY or LONGVARBINARY (depending on the
argument's size relative to the driver's limits on VARBINARYs)
when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setDate | public void setDate(int parameterIndex, java.sql.Date value) throws SQLException(Code) | | Set a parameter to a java.sql.Date value. The driver converts this
to a SQL DATE value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setDouble | public void setDouble(int parameterIndex, double value) throws SQLException(Code) | | Set a parameter to a Java double value. The driver converts this
to a SQL DOUBLE value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setFloat | public void setFloat(int parameterIndex, float value) throws SQLException(Code) | | Set a parameter to a Java float value. The driver converts this
to a SQL FLOAT value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setInt | public void setInt(int index, int value) throws SQLException(Code) | | Set a parameter to a Java int value. The driver converts this
to a SQL INTEGER value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setLong | public void setLong(int parameterIndex, long value) throws SQLException(Code) | | Set a parameter to a Java long value. The driver converts this
to a SQL BIGINT value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setNull | public void setNull(int index, int type) throws SQLException(Code) | | Set a parameter to SQL NULL.
Note: You must specify the parameter's SQL type.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: sqlType - SQL type code defined by java.sql.Types exception: SQLException - if a database-access error occurs. |
setObject | public void setObject(int parameterIndex, Object x) throws SQLException(Code) | | Set the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
The JDBC specification specifies a standard mapping from
Java Object types to SQL types. The given argument java object
will be converted to the corresponding SQL type before being
sent to the database.
Note that this method may be used to pass datatabase
specific abstract data types, by using a Driver specific Java
type.
Parameters: parameterIndex - The first parameter is 1, the second is 2, ... Parameters: x - The object containing the input parameter value exception: SQLException - if a database-access error occurs. |
setObject | public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException(Code) | | This method is like setObject above, but assumes a scale of zero.
exception: SQLException - if a database-access error occurs. |
setObject | public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException(Code) | | Set the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
The given Java object will be converted to the targetSqlType
before being sent to the database.
Note that this method may be used to pass datatabase-
specific abstract data types. This is done by using a Driver-
specific Java type and using a targetSqlType of
java.sql.types.OTHER.
Parameters: parameterIndex - The first parameter is 1, the second is 2, ... Parameters: x - The object containing the input parameter value Parameters: targetSqlType - The SQL type (as defined in java.sql.Types) to besent to the database. The scale argument may further qualify this type. Parameters: scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC typesthis is the number of digits after the decimal. For all othertypes this value will be ignored, exception: SQLException - if a database-access error occurs. See Also: Types |
setShort | public void setShort(int index, short value) throws SQLException(Code) | | Set a parameter to a Java short value. The driver converts this
to a SQL SMALLINT value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setString | public void setString(int index, String str) throws SQLException(Code) | | Set a parameter to a Java String value. The driver converts this
to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments
size relative to the driver's limits on VARCHARs) when it sends
it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setTime | public void setTime(int parameterIndex, java.sql.Time x) throws SQLException(Code) | | Set a parameter to a java.sql.Time value. The driver converts this
to a SQL TIME value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setTimestamp | public void setTimestamp(int index, java.sql.Timestamp value) throws SQLException(Code) | | Set a parameter to a java.sql.Timestamp value. The driver
converts this to a SQL TIMESTAMP value when it sends it to the
database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setUnicodeStream | public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code) | | When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream. JDBC will read the data from the stream
as needed, until it reaches end-of-file. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard
Java stream object or your own subclass that implements the
standard interface.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the java input stream which contains theUNICODE parameter value Parameters: length - the number of bytes in the stream exception: SQLException - if a database-access error occurs. |
Methods inherited from com.internetcds.jdbc.tds.Statement | public void addBatch(String sql) throws SQLException(Code)(Java Doc) public void cancel() throws SQLException(Code)(Java Doc) public void clearBatch() throws SQLException(Code)(Java Doc) public void clearWarnings() throws SQLException(Code)(Java Doc) public void close() throws SQLException(Code)(Java Doc) protected void closeResults() throws java.sql.SQLException(Code)(Java Doc) public void commit() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)(Java Doc) public boolean execute(String sql) throws SQLException(Code)(Java Doc) public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc) public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc) public boolean execute(String sql, String[] columnNames) throws SQLException(Code)(Java Doc) public int[] executeBatch() throws SQLException(Code)(Java Doc) public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public java.sql.Connection getConnection() throws SQLException(Code)(Java Doc) public int getFetchDirection() throws SQLException(Code)(Java Doc) public int getFetchSize() throws SQLException(Code)(Java Doc) public ResultSet getGeneratedKeys() throws SQLException(Code)(Java Doc) public int getMaxFieldSize() throws SQLException(Code)(Java Doc) public int getMaxRows() throws SQLException(Code)(Java Doc) public boolean getMoreResults() throws SQLException(Code)(Java Doc) public boolean getMoreResults(int current) throws SQLException(Code)(Java Doc) public int getQueryTimeout() throws SQLException(Code)(Java Doc) public java.sql.ResultSet getResultSet() throws SQLException(Code)(Java Doc) public int getResultSetConcurrency() throws SQLException(Code)(Java Doc) public int getResultSetHoldability() throws SQLException(Code)(Java Doc) public int getResultSetType() throws SQLException(Code)(Java Doc) public int getUpdateCount() throws SQLException(Code)(Java Doc) public SQLWarning getWarnings() throws SQLException(Code)(Java Doc) public boolean isClosed()(Code)(Java Doc) public boolean isPoolable() throws SQLException(Code)(Java Doc) public boolean isWrapperFor(Class> iface) throws SQLException(Code)(Java Doc) public static void main(String args) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, SQLException(Code)(Java Doc) public void rollback() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)(Java Doc) public void setCursorName(String name) throws SQLException(Code)(Java Doc) public void setEscapeProcessing(boolean enable) throws SQLException(Code)(Java Doc) public void setFetchDirection(int direction) throws SQLException(Code)(Java Doc) public void setFetchSize(int rows) throws SQLException(Code)(Java Doc) public void setMaxFieldSize(int max) throws SQLException(Code)(Java Doc) public void setMaxRows(int max) throws SQLException(Code)(Java Doc) public void setPoolable(boolean poolable) throws SQLException(Code)(Java Doc) public void setQueryTimeout(int seconds) throws SQLException(Code)(Java Doc) protected void startResultSet() throws SQLException(Code)(Java Doc) public T unwrap(Class<T> iface) throws SQLException(Code)(Java Doc)
|
|
|