Top Description Fields Constructors Methods
org.hsqldb.jdbc

public Class JDBCPreparedStatement

extends JDBCStatementBase
implements PreparedStatement
Class Inheritance
All Implemented Interfaces
java.sql.PreparedStatement, java.sql.Statement, java.lang.AutoCloseable, java.sql.Wrapper
Known Direct Subclasses
org.hsqldb.jdbc.JDBCCallableStatement
Imports
java.io.IOException, .InputStream, .InputStreamReader, .Reader, .Serializable, .StringWriter, java.math.BigDecimal, java.sql.Array, .BatchUpdateException, .Blob, .Clob, .Connection, .DatabaseMetaData, .Date, .JDBCType, .NClob, .ParameterMetaData, .PreparedStatement, .Ref, .ResultSet, .ResultSetMetaData, .RowId, .SQLException, .SQLFeatureNotSupportedException, .SQLTimeoutException, .SQLType, .SQLWarning, .SQLXML, .Time, .Timestamp, java.util.ArrayList, .Arrays, .BitSet, .Calendar, .UUID, org.hsqldb.HsqlException, .SchemaObject, .SessionInterface, .StatementTypes, org.hsqldb.error.ErrorCode, org.hsqldb.lib.CharArrayWriter, .CountdownInputStream, .HsqlByteArrayOutputStream, .StringConverter, org.hsqldb.navigator.RowSetNavigator, org.hsqldb.result.Result, .ResultConstants, .ResultLob, .ResultMetaData, .ResultProperties, org.hsqldb.types.BinaryData, .BinaryUUIDType, .BlobDataID, .BlobInputStream, .ClobDataID, .ClobInputStream, .DateTimeType, .JavaObjectData, .JavaObjectDataInternal, .Type, .Types

An object that represents a precompiled SQL statement.

A SQL statement is precompiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

Note

The setter methods (setShort, setString, and so on) 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 the method setInt should be used.

If arbitrary parameter type conversions are required, the method setObject should be used with a target SQL type.

In the following example of setting a parameter, con represents an active connection:

BigDecimal sal = new BigDecimal("153833.00");
  PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES
                                    SET SALARY = ? WHERE ID = ?");
  pstmt.setBigDecimal(1, sal);
  pstmt.setInt(2, 110592);

HSQLDB-Specific Information:

From version 2.0, the implementation meets the JDBC specification requirement that any existing ResultSet is closed when execute() or executeQuery() methods are called. The connection property close_result=true is required for this behaviour.

JDBCPreparedStatement objects are backed by a true compiled parametric representation. Hence, there are now significant performance gains to be had by using a JDBCPreparedStatement object in preference to a JDBCStatement object when a short-running SQL statement is to be executed more than once.

When it can be otherwise avoided, it should be considered poor practice to fully prepare (construct), parameterize, execute, fetch and close a JDBCParameterMetaData object for each execution cycle. Indeed, because the prepare and execute phases both represent a round-trip to the engine, this practice is likely to be noticeably less performant for short-running statements (and possibly even orders of magnitude less performant over network connections for short-running statements) than the equivalent process using JDBCStatement objects, albeit far more convenient, less error prone and certainly much less resource-intensive, especially when large binary and character values are involved, due to the optimized parameterization facility.

Instead, when developing an application that is not totally oriented toward the execution of ad hoc SQL, it is recommended to expend some effort toward identifying the SQL statements that are good candidates for regular reuse and adapting the structure of the application accordingly. Often, this is done by recording the text of candidate SQL statements in an application resource object (which has the nice side-benefit of isolating and hiding differences in SQL dialects across different drivers) and caching for possible reuse the PreparedStatement objects derived from the recorded text.

Starting with 2.0, when built under a JDBC 4 environment, statement caching can be transparently enabled or disabled on a statement-by-statement basis by invoking setPoolable(true | false), respectively, upon Statement objects of interest.

Multi thread use:

A PreparedStatement object is stateful and should not normally be shared by multiple threads. If it has to be shared, the calls to set the parameters, calls to add batch statements, the execute call and any post-execute calls should be made within a block synchronized on the PreparedStatement Object.

(fredt@users)
(campbell-burnet@users)

Authors
Campbell Burnet (campbell-burnet@users dot sourceforge.net), Fred Toussi (fredt@users dot sourceforge.net)
Since
JDK 1.1, HSQLDB 1.9.0
Version
2.7.3
See Also
JDBCConnection#prepareStatement, JDBCResultSet

Field Summary

Modifier and TypeField and Description
protected boolean
hasLOBs

Has one or more CLOB / BLOB type parameters.

protected boolean
isBatch

Is in batch mode.

protected final boolean
isResult

Is part of a Result.

protected ResultMetaData
parameterMetaData

Description of parameter metadata.

protected byte[]
parameterModes

The (IN, IN OUT, or OUT) modes of parameters

protected boolean[]
parameterSet

Flags for bound variables.

protected Type[]
parameterTypes

The SQL types of the parameters.

protected Object[]
parameterValues

The parameter values for the next non-batch execution.

protected ParameterMetaData
pmd

This object's one and only ParameterMetaData object.

pack-priv boolean
protected ResultMetaData
resultMetaData

Description of result set metadata.

protected JDBCResultSetMetaData
resultSetMetaData

This object's one and one ResultSetMetaData object.

protected SessionInterface
session

The session attribute of the connection

protected String
sql

The SQL character sequence that this object represents.

protected long
statementID

ID of the statement.

protected int
statementRetType

Statement type - whether it generates a row update count or a result set.

protected long[]
streamLengths

Lengths for streams.

Inherited from org.hsqldb.jdbc.JDBCStatementBase:
batchResultOutCLOSE_ALL_RESULTSCLOSE_CURRENT_RESULTconnectionconnectionIncarnationcurrentResultSeterrorResultEXECUTE_FAILEDfetchDirectionfetchSizegeneratedResultgeneratedResultSetisClosedisEscapeProcessingKEEP_CURRENT_RESULTmaxRowsNO_GENERATED_KEYSqueryTimeoutresultInresultOutRETURN_GENERATED_KEYSrootWarningrsPropertiesSUCCESS_NO_INFO

Constructor Summary

AccessConstructor and Description
pack-priv
JDBCPreparedStatement(JDBCConnection
the Connection used execute this statement
c
,
String
the SQL statement this object represents
sql
,
int
the type of result this statement will produce (scrollability)
resultSetType
,
int
(updatability)
resultSetConcurrency
,
int
(validity beyond commit)
resultSetHoldability
,
int
internal mode of handling generated key reporting
generatedKeys
,
int[]
column indexes for generated keys
generatedIndexes
,
String[]
column names for generated keys are given
generatedNames
)

Constructs a statement that produces results of the requested type.

pack-priv
JDBCPreparedStatement(JDBCConnection c, Result result)

Constructor for updatable ResultSet

Method Summary

Modifier and TypeMethod and Description
public synchronized void
addBatch()

Implements java.sql.PreparedStatement.addBatch.

Adds a set of parameters to this PreparedStatement object's batch of commands.

public void
addBatch(String
ignored
sql
)

Implements java.sql.Statement.addBatch.

This method should always throw if called for a PreparedStatement or CallableStatement.

public void
cancel()

Implements java.sql.Statement.cancel.

Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.

protected void
checkGetParameterIndex(int
The parameter index to check
parameterIndex
)

Checks if the specified parameter index value is valid in terms of getting an OUT or INOUT parameter value.

protected void
private void
checkParametersSet()

Called just before execution or adding to batch, this ensures all the parameters have been set.

protected void
checkSetParameterIndex(int
The parameter index to check
parameterIndex
)

Checks if the specified parameter index value is valid in terms of setting an IN or IN OUT parameter value.

protected void
checkStatementType(int
type of statement regarding what it returns something other than a single row update count.
type
)

Checks if execution does or does not generate a single row update count, throwing if the argument, yes, does not match.

public synchronized void
clearBatch()

Implements java.sql.Statement.clearBatch.

Empties this Statement object's current list of SQL commands.

public synchronized void
clearParameters()

Implements java.sql.PreparedStatement.clearParameters.

Clears the current parameter values immediately.

public synchronized void
clearWarnings()

Implements java.sql.Statement.clearWarnings.

Clears all the warnings reported on this Statement object.

public synchronized void
close()

Overrides org.hsqldb.jdbc.JDBCStatementBase.close.

Implements java.sql.Statement.close.

Does the specialized work required to free this object's resources and that of its parent class.

public synchronized boolean

Returns:

true if the first result is a ResultSet object; false if the first result is an update count or there is no result
execute
()

Implements java.sql.PreparedStatement.execute.

Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement.

public boolean

Returns:

nothing
execute
(String
ignored
sql
)

Implements java.sql.Statement.execute.

This method should always throw if called for a PreparedStatement or CallableStatement.

public boolean
execute(String sql, int autoGeneratedKeys)

Implements java.sql.Statement.execute.

Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.

public boolean
execute(String sql, int[] columnIndexes)

Implements java.sql.Statement.execute.

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

public boolean
execute(String sql, String[] columnNames)

Implements java.sql.Statement.execute.

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

public synchronized int[]

Returns:

an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.
executeBatch
()

Implements java.sql.Statement.executeBatch.

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

public synchronized long[]

Returns:

an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.
executeLargeBatch
()

Overrides default java.sql.Statement.executeLargeBatch.

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

public synchronized long

Returns:

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing
executeLargeUpdate
()

Overrides default java.sql.PreparedStatement.executeLargeUpdate.

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

public synchronized ResultSet

Returns:

a ResultSet object that contains the data produced by the query; never null
executeQuery
()

Implements java.sql.PreparedStatement.executeQuery.

Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

public synchronized ResultSet

Returns:

nothing
executeQuery
(String
ignored
sql
)

Implements java.sql.Statement.executeQuery.

This method should always throw if called for a PreparedStatement or CallableStatement.

public synchronized int

Returns:

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing
executeUpdate
()

Implements java.sql.PreparedStatement.executeUpdate.

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

public int

Returns:

nothing
executeUpdate
(String
ignored
sql
)

Implements java.sql.Statement.executeUpdate.

This method should always throw if called for a PreparedStatement or CallableStatement.

public int
executeUpdate(String sql, int autoGeneratedKeys)

Implements java.sql.Statement.executeUpdate.

Statement methods that must be overridden in this class and throw an exception.

public int
executeUpdate(String sql, int[] columnIndexes)

Implements java.sql.Statement.executeUpdate.

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

public int
executeUpdate(String sql, String[] columnNames)

Implements java.sql.Statement.executeUpdate.

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

pack-priv void
fetchResult()

Internal result producer for JDBCStatement (sqlExecDirect mode).

public synchronized Connection

Returns:

the connection that produced this statement
getConnection
()

Implements java.sql.Statement.getConnection.

Retrieves the Connection object that produced this Statement object.

public synchronized int

Returns:

the default fetch direction for result sets generated from this Statement object
getFetchDirection
()

Implements java.sql.Statement.getFetchDirection.

Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.

public synchronized int

Returns:

the default fetch size for result sets generated from this Statement object
getFetchSize
()

Implements java.sql.Statement.getFetchSize.

Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object.

public synchronized ResultSet

Returns:

a ResultSet object containing the auto-generated key(s) generated by the execution of this Statement object
getGeneratedKeys
()

Implements java.sql.Statement.getGeneratedKeys.

Retrieves any auto-generated keys created as a result of executing this Statement object.

public synchronized long

Returns:

the current maximum number of rows for a ResultSet object produced by this Statement object; zero means there is no limit
getLargeMaxRows
()

Overrides default java.sql.Statement.getLargeMaxRows.

Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

public synchronized long

Returns:

the current result as an update count; -1 if the current result is a ResultSet object or there are no more results
getLargeUpdateCount
()

Overrides default java.sql.Statement.getLargeUpdateCount.

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

public synchronized int

Returns:

the current column size limit for columns storing character and binary values; zero means there is no limit
getMaxFieldSize
()

Implements java.sql.Statement.getMaxFieldSize.

Retrieves the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.

public synchronized int

Returns:

the current maximum number of rows for a ResultSet object produced by this Statement object; zero means there is no limit
getMaxRows
()

Implements java.sql.Statement.getMaxRows.

Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

public synchronized ResultSetMetaData

Returns:

the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object
getMetaData
()

Implements java.sql.PreparedStatement.getMetaData.

Retrieves a ResultSetMetaData object that contains information about the columns of the ResultSet object that will be returned when this PreparedStatement object is executed.

public synchronized boolean

Returns:

true if the next result is a ResultSet object; false if it is an update count or there are no more results
getMoreResults
(int
one of the following Statement constants indicating what should happen to current ResultSet objects obtained using the method getResultSet: Statement.CLOSE_CURRENT_RESULT, Statement.KEEP_CURRENT_RESULT, or Statement.CLOSE_ALL_RESULTS
current
)

Overrides org.hsqldb.jdbc.JDBCStatementBase.getMoreResults.

Implements java.sql.Statement.getMoreResults.

Moves to this Statement object's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object.

public synchronized boolean

Returns:

true if the next result is a ResultSet object; false if it is an update count or there are no more results
getMoreResults
()

Overrides org.hsqldb.jdbc.JDBCStatementBase.getMoreResults.

Implements java.sql.Statement.getMoreResults.

Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.

public synchronized ParameterMetaData

Returns:

a ParameterMetaData object that contains information about the number, types and properties for each parameter marker of this PreparedStatement object
getParameterMetaData
()

Implements java.sql.PreparedStatement.getParameterMetaData.

Retrieves the number, types and properties of this PreparedStatement object's parameters.

public ResultMetaData
public synchronized int

Returns:

the current query timeout limit in seconds; zero means there is no limit
getQueryTimeout
()

Implements java.sql.Statement.getQueryTimeout.

Retrieves the number of seconds the driver will wait for a Statement object to execute.

public synchronized ResultSet

Returns:

the current result as a ResultSet object or null if the result is an update count or there are no more results
getResultSet
()

Overrides org.hsqldb.jdbc.JDBCStatementBase.getResultSet.

Implements java.sql.Statement.getResultSet.

Retrieves the current result as a ResultSet object.

public synchronized int

Returns:

either ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
getResultSetConcurrency
()

Implements java.sql.Statement.getResultSetConcurrency.

Retrieves the result set concurrency for ResultSet objects generated by this Statement object.

public synchronized int

Returns:

either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
getResultSetHoldability
()

Implements java.sql.Statement.getResultSetHoldability.

Retrieves the result set holdability for ResultSet objects generated by this Statement object.

public JDBCResultSetMetaData
public synchronized int

Returns:

one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
getResultSetType
()

Implements java.sql.Statement.getResultSetType.

Retrieves the result set type for ResultSet objects generated by this Statement object.

public String
public long
public synchronized int

Returns:

the current result as an update count; -1 if the current result is a ResultSet object or there are no more results
getUpdateCount
()

Overrides org.hsqldb.jdbc.JDBCStatementBase.getUpdateCount.

Implements java.sql.Statement.getUpdateCount.

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

public synchronized SQLWarning

Returns:

the first SQLWarning object or null if there are no warnings
getWarnings
()

Implements java.sql.Statement.getWarnings.

Retrieves the first warning reported by calls on this Statement object.

public synchronized boolean

Returns:

true if this Statement object is closed; false if it is still open
isClosed
()

Implements java.sql.Statement.isClosed.

Retrieves whether this Statement object has been closed.

public synchronized boolean

Returns:

true if the Statement is poolable; false otherwise
isPoolable
()

Implements java.sql.Statement.isPoolable.

Returns a value indicating whether the Statement is poolable or not.

public boolean
public boolean

Returns:

true if this implements the interface or directly or indirectly wraps an object that does.
isWrapperFor
(Class<?>
a Class defining an interface.
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

pack-priv void
performPostExecute()

Overrides org.hsqldb.jdbc.JDBCStatementBase.performPostExecute.

processes chained warnings and any generated columns result set

private void
public synchronized void
setArray(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Array
an Array object that maps an SQL ARRAY value
x
)

Implements java.sql.PreparedStatement.setArray.

Sets the designated parameter to the given java.sql.Array object.

public synchronized void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the Java input stream that contains the ASCII parameter value
x
,
int
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setAsciiStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public synchronized void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the Java input stream that contains the ASCII parameter value
x
,
long
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setAsciiStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public synchronized void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the Java input stream that contains the ASCII parameter value
x
)

Implements java.sql.PreparedStatement.setAsciiStream.

Sets the designated parameter to the given input stream.

pack-priv void
setAscStream(int parameterIndex, InputStream x, long length)

public synchronized void
setBigDecimal(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
BigDecimal
the parameter value
x
)

Implements java.sql.PreparedStatement.setBigDecimal.

Sets the designated parameter to the given java.math.BigDecimal value.

public synchronized void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
,
int
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setBinaryStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public synchronized void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
,
long
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setBinaryStream.

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public synchronized void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
)

Implements java.sql.PreparedStatement.setBinaryStream.

Sets the designated parameter to the given input stream.

private void
setBinStream(int parameterIndex, InputStream x, long length)

public synchronized void
setBlob(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Blob
a Blob object that maps an SQL BLOB value
x
)

Implements java.sql.PreparedStatement.setBlob.

Sets the designated parameter to the given java.sql.Blob object.

public synchronized void
setBlob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
,
long
the number of bytes in the parameter data.
length
)

Implements java.sql.PreparedStatement.setBlob.

Sets the designated parameter to a InputStream object.

public synchronized void
setBlob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
)

Implements java.sql.PreparedStatement.setBlob.

Sets the designated parameter to a InputStream object.

private void
setBlobForBinaryParameter(int parameterIndex, Blob x)

Converts a blob to binary data for non-blob binary parameters.

pack-priv void
setBlobParameter(int
int
i
,
Object
Object
o
)

setParameterForBlob

pack-priv void
setBlobParameter(int i, Object o, long streamLength)

public synchronized void
setBoolean(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
boolean
the parameter value
x
)

Implements java.sql.PreparedStatement.setBoolean.

Sets the designated parameter to the given Java boolean value.

public synchronized void
setByte(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
byte
the parameter value
x
)

Implements java.sql.PreparedStatement.setByte.

Sets the designated parameter to the given Java byte value.

public synchronized void
setBytes(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
byte[]
the parameter value
x
)

Implements java.sql.PreparedStatement.setBytes.

Sets the designated parameter to the given Java array of bytes.

public synchronized void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java.io.Reader object that contains the Unicode data
reader
,
int
the number of characters in the stream
length
)

Implements java.sql.PreparedStatement.setCharacterStream.

Sets the designated parameter to the given Reader object, which is the given number of characters long.

public synchronized void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java.io.Reader object that contains the Unicode data
reader
,
long
the number of characters in the stream
length
)

Implements java.sql.PreparedStatement.setCharacterStream.

Sets the designated parameter to the given Reader object, which is the given number of characters long.

public synchronized void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java.io.Reader object that contains the Unicode data
reader
)

Implements java.sql.PreparedStatement.setCharacterStream.

Sets the designated parameter to the given Reader object.

private void
setCharStream(int parameterIndex, Reader reader, long length)

public synchronized void
setClob(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Clob
a Clob object that maps an SQL CLOB value
x
)

Implements java.sql.PreparedStatement.setClob.

Sets the designated parameter to the given java.sql.Clob object.

public synchronized void
setClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Implements java.sql.PreparedStatement.setClob.

Sets the designated parameter to a Reader object.

public synchronized void
setClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Implements java.sql.PreparedStatement.setClob.

Sets the designated parameter to a Reader object.

private void
setClobForStringParameter(int parameterIndex, Clob x)

pack-priv void
pack-priv void
setClobParameter(int i, Object o, long streamLength)

public void
setCursorName(String
the new cursor name, which must be unique within a connection
name
)

Implements java.sql.Statement.setCursorName.

Sets the SQL cursor name to the given String, which will be used by subsequent Statement object execute methods.

public synchronized void
setDate(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Date
the parameter value
x
)

Implements java.sql.PreparedStatement.setDate.

Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application.

public synchronized void
setDate(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Date
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the date
cal
)

Implements java.sql.PreparedStatement.setDate.

Sets the designated parameter to the given java.sql.Date value, using the given Calendar object.

public synchronized void
setDouble(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
double
the parameter value
x
)

Implements java.sql.PreparedStatement.setDouble.

Sets the designated parameter to the given Java double value.

public void
setEscapeProcessing(boolean
true to enable escape processing; false to disable it
enable
)

Implements java.sql.Statement.setEscapeProcessing.

Sets escape processing on or off.

public synchronized void
setFetchDirection(int
the initial direction for processing rows
direction
)

Implements java.sql.Statement.setFetchDirection.

Gives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object.

public synchronized void
setFetchSize(int
the number of rows to fetch
rows
)

Implements java.sql.Statement.setFetchSize.

Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet objects generated by this Statement.

public synchronized void
setFloat(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
float
the parameter value
x
)

Implements java.sql.PreparedStatement.setFloat.

Sets the designated parameter to the given Java float value.

public synchronized void
setInt(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
int
the parameter value
x
)

Implements java.sql.PreparedStatement.setInt.

Sets the designated parameter to the given Java int value.

pack-priv void
setIntParameter(int
parameter index
parameterIndex
,
int
object to set
value
)

Used with int and narrower integral primitives

public synchronized void
setLargeMaxRows(long
the new max rows limit; zero means there is no limit
max
)

Overrides default java.sql.Statement.setLargeMaxRows.

Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.

public synchronized void
setLong(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
long
the parameter value
x
)

Implements java.sql.PreparedStatement.setLong.

Sets the designated parameter to the given Java long value.

pack-priv void
setLongParameter(int
parameter index
parameterIndex
,
long
object to set
value
)

Used with long and narrower integral primitives.

public synchronized void
setMaxFieldSize(int
the new column size limit in bytes; zero means there is no limit
max
)

Implements java.sql.Statement.setMaxFieldSize.

Sets the limit for the maximum number of bytes in a ResultSet Sets the limit for the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.

public synchronized void
setMaxRows(int
the new max rows limit; zero means there is no limit
max
)

Implements java.sql.Statement.setMaxRows.

Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.

public synchronized void
setNCharacterStream(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the parameter value
value
,
long
the number of characters in the parameter data.
length
)

Implements java.sql.PreparedStatement.setNCharacterStream.

Sets the designated parameter to a Reader object.

public synchronized void
setNCharacterStream(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the parameter value
value
)

Implements java.sql.PreparedStatement.setNCharacterStream.

Sets the designated parameter to a Reader object.

public synchronized void
setNClob(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
NClob
the parameter value
value
)

Implements java.sql.PreparedStatement.setNClob.

Sets the designated parameter to a java.sql.NClob object.

public synchronized void
setNClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Implements java.sql.PreparedStatement.setNClob.

Sets the designated parameter to a Reader object.

public synchronized void
setNClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Implements java.sql.PreparedStatement.setNClob.

Sets the designated parameter to a Reader object.

public synchronized void
setNString(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
String
the parameter value
value
)

Implements java.sql.PreparedStatement.setNString.

Sets the designated parameter to the given String object.

public synchronized void
setNull(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
int
the SQL type code defined in java.sql.Types
sqlType
)

Implements java.sql.PreparedStatement.setNull.

Sets the designated parameter to SQL NULL.

public synchronized void
setNull(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
int
a value from java.sql.Types
sqlType
,
String
the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or REF
typeName
)

Implements java.sql.PreparedStatement.setNull.

Sets the designated parameter to SQL NULL.

public synchronized void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database
targetSqlType
)

Implements java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object.

public synchronized void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
)

Implements java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter using the given object.

public synchronized void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
targetSqlType
,
int
for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
scaleOrLength
)

Implements java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object.

public synchronized void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
SQLType
the SQL type to be sent to the database. The scale argument may further qualify this type.
targetSqlType
,
int
for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
scaleOrLength
)

Overrides default java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object.

public synchronized void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
SQLType
the SQL type to be sent to the database
targetSqlType
)

Overrides default java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object.

pack-priv void
setParameter(int
parameter index
parameterIndex
,
Object
object
o
)

The internal parameter value setter always converts the parameter to the type required for data transmission.

public synchronized void
setPoolable(boolean
requests that the statement be pooled if true and that the statement not be pooled if false
poolable
)

Implements java.sql.Statement.setPoolable.

Requests that a Statement be pooled or not pooled.

public synchronized void
setQueryTimeout(int
the new query timeout limit in seconds; zero means there is no limit
seconds
)

Implements java.sql.Statement.setQueryTimeout.

Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.

public void
setRef(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Ref
an SQL REF value
x
)

Implements java.sql.PreparedStatement.setRef.

Sets the designated parameter to the given REF(<structured-type>) value.

public void
setRowId(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
RowId
the parameter value
x
)

Implements java.sql.PreparedStatement.setRowId.

Sets the designated parameter to the given java.sql.RowId object.

public synchronized void
setShort(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
short
the parameter value
x
)

Implements java.sql.PreparedStatement.setShort.

Sets the designated parameter to the given Java short value.

public void
setSQLXML(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
SQLXML
a SQLXML object that maps an SQL XML value
xmlObject
)

Implements java.sql.PreparedStatement.setSQLXML.

Sets the designated parameter to the given java.sql.SQLXML object.

public synchronized void
setString(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
String
the parameter value
x
)

Implements java.sql.PreparedStatement.setString.

Sets the designated parameter to the given Java String value.

public synchronized void
setTime(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Time
the parameter value
x
)

Implements java.sql.PreparedStatement.setTime.

Sets the designated parameter to the given java.sql.Time value.

public synchronized void
setTime(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Time
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the time
cal
)

Implements java.sql.PreparedStatement.setTime.

Sets the designated parameter to the given java.sql.Time value, using the given Calendar object.

public synchronized void
setTimestamp(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Timestamp
the parameter value
x
)

Implements java.sql.PreparedStatement.setTimestamp.

Sets the designated parameter to the given java.sql.Timestamp value.

public synchronized void
setTimestamp(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Timestamp
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the timestamp
cal
)

Implements java.sql.PreparedStatement.setTimestamp.

Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object.

public synchronized void
setUnicodeStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
a java.io.InputStream object that contains the Unicode parameter value
x
,
int
the number of bytes in the stream
length
)

Implements java.sql.PreparedStatement.setUnicodeStream.

Deprecated Use setCharacterStream

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public void
setURL(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
URL
the java.net.URL object to be set
x
)

Implements java.sql.PreparedStatement.setURL.

Sets the designated parameter to the given java.net.URL value.

public synchronized String

Returns:

a String representation of this object
toString
()

Overrides java.lang.Object.toString.

Retrieves a String representation of this object.

public <T> T

Returns:

an object that implements the interface. May be a proxy for the actual implementing object.
unwrap
(Class<T>
A Class defining an interface that the result must implement.
iface
)

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

Inherited from org.hsqldb.jdbc.JDBCStatementBase:
checkClosedcloseOnCompletioncloseResultDatagetGeneratedResultSetisCloseOnCompletion