java.lang.AutoCloseable, java.sql.PreparedStatement, java.sql.Statement, java.sql.WrapperVirtuosoCallableStatementpublic class VirtuosoPreparedStatement extends VirtuosoStatement implements java.sql.PreparedStatement
PreparedStatement s = connection.prepareStatement(...)
| Modifier and Type | Field | Description |
|---|---|---|
protected VirtuosoResultSet |
ps_vresultSet |
|
protected java.lang.String |
sql |
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFObatch, close_flag, closeOnCompletion, connection, cursorName, exec_type, future, isCached, metaData, objparams, parameters, paramsMetaData, prefetch, req_no, result_opened, rpc_timeout, sparql_executed, statid, txn_timeout, type, vresultSet, wait_result| Modifier and Type | Method | Description |
|---|---|---|
void |
addBatch() |
Adds a set of parameters to the batch.
|
void |
clearParameters() |
Clears the current parameter values immediately.
|
void |
close() |
Releases this Statement object's database
and JDBC resources immediately instead of new wait for
this to happen when it is automatically closed.
|
boolean |
execute() |
Executes any kind of SQL statement.
|
int[] |
executeBatch() |
Submits a batch of commands to the database for execution.
|
int[] |
executeBatchUpdate() |
|
java.sql.ResultSet |
executeQuery() |
Executes a SQL prepare statement that returns a single ResultSet.
|
int |
executeUpdate() |
Executes the SQL INSERT, UPDATE or DELETE statement
in this PreparedStatement object.
|
void |
finalize() |
Method runs when the garbage collector want to erase the object
|
java.sql.ResultSetMetaData |
getMetaData() |
Gets the number, types and properties of a ResultSet's columns.
|
java.sql.ParameterMetaData |
getParameterMetaData() |
Retrieves the number, types and properties of this
PreparedStatement object's parameters. |
void |
setArray(int i,
java.sql.Array x) |
Sets an Array parameter.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x) |
Sets the designated parameter to the given input stream.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length) |
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length) |
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
setBigDecimal(int parameterIndex,
java.math.BigDecimal x) |
Sets the designated parameter to a java.lang.BigDecimal value.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x) |
Sets the designated parameter to the given input stream.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length) |
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length) |
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream) |
Sets the designated parameter to a
InputStream object. |
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length) |
Sets the designated parameter to a
InputStream object. |
void |
setBlob(int i,
java.sql.Blob x) |
Sets a BLOB parameter.
|
void |
setBoolean(int parameterIndex,
boolean x) |
Sets the designated parameter to a Java boolean value.
|
void |
setByte(int parameterIndex,
byte x) |
Sets the designated parameter to a Java byte value.
|
void |
setBytes(int parameterIndex,
byte[] x) |
Sets the designated parameter to a Java array of bytes.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader) |
Sets the designated parameter to the given
Reader
object. |
void |
setCharacterStream(int parameterIndex,
java.io.Reader x,
int length) |
Sets the designated parameter to the given
Reader
object, which is the given number of characters long. |
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
long length) |
Sets the designated parameter to the given
Reader
object, which is the given number of characters long. |
void |
setClob(int parameterIndex,
java.io.Reader reader) |
Sets the designated parameter to a
Reader object. |
void |
setClob(int parameterIndex,
java.io.Reader reader,
long length) |
Sets the designated parameter to a
Reader object. |
void |
setClob(int i,
java.sql.Clob x) |
Sets a CLOB parameter.
|
protected void |
setClosed(boolean flag) |
|
void |
setDate(int parameterIndex,
java.sql.Date x) |
Sets the designated parameter to a java.sql.Date value.
|
void |
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal) |
Sets the designated parameter to a java.sql.Date value,
using the given Calendar object.
|
void |
setDouble(int parameterIndex,
double x) |
Sets the designated parameter to a Java double value.
|
void |
setFloat(int parameterIndex,
float x) |
Sets the designated parameter to a Java float value.
|
void |
setInt(int parameterIndex,
int x) |
Sets the designated parameter to a Java int value.
|
void |
setLong(int parameterIndex,
long x) |
Sets the designated parameter to a Java long value.
|
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value) |
Sets the designated parameter to a
Reader object. |
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value,
long length) |
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
java.io.Reader reader) |
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
java.io.Reader reader,
long length) |
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
java.sql.NClob value) |
Sets the designated parameter to a
java.sql.NClob object. |
void |
setNString(int parameterIndex,
java.lang.String value) |
Sets the designated paramter to the given
String object. |
void |
setNull(int parameterIndex,
int sqlType) |
Sets the designated parameter to SQL NULL.
|
void |
setNull(int paramIndex,
int sqlType,
java.lang.String typeName) |
Sets the designated parameter to SQL NULL.
|
void |
setObject(int parameterIndex,
java.lang.Object x) |
Sets the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale) |
Sets the value of a parameter using an object.
|
void |
setRef(int i,
java.sql.Ref x) |
Sets a REF(<structured-type>) parameter.
|
void |
setRowId(int parameterIndex,
java.sql.RowId x) |
Sets the designated parameter to the given
java.sql.RowId object. |
void |
setShort(int parameterIndex,
short x) |
Sets the designated parameter to a Java short value.
|
void |
setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject) |
Sets the designated parameter to the given
java.sql.SQLXML object. |
void |
setString(int parameterIndex,
java.lang.String x) |
Sets the designated parameter to a Java String value.
|
protected void |
setString(int parameterIndex,
VirtuosoExplicitString x) |
|
void |
setTime(int parameterIndex,
java.sql.Time x) |
Sets the designated parameter to a java.sql.Time value.
|
void |
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal) |
Sets the designated parameter to a java.sql.Time value,
using the given Calendar object.
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x) |
Sets the designated parameter to a java.sql.Timestamp value.
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal) |
Sets the designated parameter to a java.sql.Timestamp value,
using the given Calendar object.
|
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length) |
Sets the designated parameter to the given input stream, which will have
the specified number of unicode chars.
|
void |
setURL(int parameterIndex,
java.net.URL x) |
Sets the designated parameter to the given
java.net.URL value. |
protected void |
setVector(int parameterIndex,
Vector x) |
Sets the designated parameter to a Java Vector value.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteLargeUpdate, setObject, setObjectaddBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, 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, setQueryTimeoutaddBatch, cancel, cancel_rs, clearBatch, clearWarnings, close_rs, closeOnCompletion, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getExecType, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getStmtOpts, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, notify_error, sendQuery, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrapprotected java.lang.String sql
protected VirtuosoResultSet ps_vresultSet
protected void setVector(int parameterIndex,
Vector x)
throws VirtuosoException
parameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occurspublic void clearParameters()
throws VirtuosoException
clearParameters in interface java.sql.PreparedStatementVirtuosoException - if a database access error occursPreparedStatement.clearParameters()public boolean execute()
throws VirtuosoException
execute in interface java.sql.PreparedStatementVirtuosoException - If a database access error occurs.VirtuosoStatement.getResultSet(),
VirtuosoStatement.getUpdateCount(),
VirtuosoStatement.getMoreResults(),
PreparedStatement.execute()public int executeUpdate()
throws VirtuosoException
executeUpdate in interface java.sql.PreparedStatementVirtuosoException - If a database access error occurs.PreparedStatement.executeUpdate()public int[] executeBatchUpdate()
throws java.sql.BatchUpdateException
java.sql.BatchUpdateExceptionpublic java.sql.ResultSet executeQuery()
throws VirtuosoException
executeQuery in interface java.sql.PreparedStatementVirtuosoException - If a database access error occurs.PreparedStatement.executeQuery()public java.sql.ResultSetMetaData getMetaData()
throws VirtuosoException
getMetaData in interface java.sql.PreparedStatementVirtuosoException - if a database access error occursPreparedStatement.getMetaData()public void finalize()
throws java.lang.Throwable
finalize in class VirtuosoStatementjava.lang.Throwablepublic void close()
throws VirtuosoException
close in interface java.lang.AutoCloseableclose in interface java.sql.Statementclose in class VirtuosoStatementVirtuosoException - If a database access error occurs.Statement.close()public void setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
throws VirtuosoException
setAsciiStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the Java input stream that contains the ASCII parameter valuelength - the number of bytes in the streamVirtuosoException - if a database access error occursPreparedStatement.setAsciiStream(int, java.io.InputStream, int)public void setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
throws VirtuosoException
setBigDecimal in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setBigDecimal(int, java.math.BigDecimal)public void setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length)
throws VirtuosoException
setBinaryStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java input stream which contains the binary parameter valuelength - the number of bytes in the streamVirtuosoException - if a database access error occursPreparedStatement.setBinaryStream(int, java.io.InputStream, int)public void setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
throws VirtuosoException
setUnicodeStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java input stream which contains the binary parameter valuelength - the number of bytes in the streamVirtuosoException - if a database access error occursPreparedStatement.setBinaryStream(int, java.io.InputStream, int)public void setBoolean(int parameterIndex,
boolean x)
throws VirtuosoException
setBoolean in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setBoolean(int, boolean)public void setByte(int parameterIndex,
byte x)
throws VirtuosoException
setByte in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setByte(int, byte)public void setBytes(int parameterIndex,
byte[] x)
throws VirtuosoException
setBytes in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setBytes(int, byte[])public void setDate(int parameterIndex,
java.sql.Date x)
throws VirtuosoException
setDate in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setDate(int, java.sql.Date)public void setDouble(int parameterIndex,
double x)
throws VirtuosoException
setDouble in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setDouble(int, double)public void setFloat(int parameterIndex,
float x)
throws VirtuosoException
setFloat in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setFloat(int, float)public void setInt(int parameterIndex,
int x)
throws VirtuosoException
setInt in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setInt(int, int)public void setLong(int parameterIndex,
long x)
throws VirtuosoException
setLong in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setLong(int, long)public void setNull(int parameterIndex,
int sqlType)
throws VirtuosoException
setNull in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...sqlType - the SQL type code defined in java.sql.TypesVirtuosoException - if a database access error occursPreparedStatement.setNull(int, int)public void setObject(int parameterIndex,
java.lang.Object x)
throws VirtuosoException
setObject in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the object containing the input parameter valueVirtuosoException - if a database access error occursPreparedStatement.setObject(int, java.lang.Object, int)public void setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType)
throws VirtuosoException
setObject in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the object containing the input parameter valuetargetSqlType - the SQL type (as defined in java.sql.Types) to be
sent to the databaseVirtuosoException - if a database access error occursPreparedStatement.setObject(int, java.lang.Object, int)public void setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale)
throws VirtuosoException
setObject in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the object containing the input parameter valuetargetSqlType - the SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type.scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
this is the number of digits after the decimal point. For all other
types, this value will be ignored.VirtuosoException - if a database access error occursPreparedStatement.setObject(int, java.lang.Object, int),
Typespublic void setShort(int parameterIndex,
short x)
throws VirtuosoException
setShort in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setShort(int, short)public void setString(int parameterIndex,
java.lang.String x)
throws VirtuosoException
setString in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setString(int, java.lang.String)protected void setString(int parameterIndex,
VirtuosoExplicitString x)
throws VirtuosoException
VirtuosoExceptionpublic void setTime(int parameterIndex,
java.sql.Time x)
throws VirtuosoException
setTime in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setTime(int, java.sql.Time)public void setTimestamp(int parameterIndex,
java.sql.Timestamp x)
throws VirtuosoException
setTimestamp in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valueVirtuosoException - if a database access error occursPreparedStatement.setTimestamp(int, java.sql.Timestamp)public void addBatch()
throws VirtuosoException
addBatch in interface java.sql.PreparedStatementVirtuosoException - If a database access error occurs.PreparedStatement.addBatch()public int[] executeBatch()
throws java.sql.BatchUpdateException
VirtuosoStatementexecuteBatch in interface java.sql.StatementexecuteBatch in class VirtuosoStatementjava.sql.BatchUpdateException - if a database access error occurspublic void setArray(int i,
java.sql.Array x)
throws VirtuosoException
setArray in interface java.sql.PreparedStatementi - the first parameter is 1, the second is 2, ...x - an object representing an SQL arrayVirtuosoException - if a database access error occursPreparedStatement.setArray(int, java.sql.Array)public void setBlob(int i,
java.sql.Blob x)
throws VirtuosoException
setBlob in interface java.sql.PreparedStatementi - the first parameter is 1, the second is 2, ...x - an object representing a BLOBVirtuosoException - if a database access error occursPreparedStatement.setBlob(int, java.sql.Blob)public void setCharacterStream(int parameterIndex,
java.io.Reader x,
int length)
throws VirtuosoException
Reader
object, which is the given number of characters long.setCharacterStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java reader which contains the UNICODE datalength - the number of characters in the streamVirtuosoException - if a database access error occursPreparedStatement.setCharacterStream(int, java.io.Reader, int)public void setClob(int i,
java.sql.Clob x)
throws VirtuosoException
setClob in interface java.sql.PreparedStatementi - the first parameter is 1, the second is 2, ...x - an object representing a CLOBVirtuosoException - if a database access error occursPreparedStatement.setClob(int, java.sql.Clob)public void setNull(int paramIndex,
int sqlType,
java.lang.String typeName)
throws VirtuosoException
setNull in interface java.sql.PreparedStatementparamIndex - the first parameter is 1, the second is 2, ...sqlType - a value from java.sql.TypestypeName - the fully-qualified name of an SQL user-named type,
ignored if the parameter is not a user-named type or REFVirtuosoException - if a database access error occursPreparedStatement.setNull(int, int)public void setRef(int i,
java.sql.Ref x)
throws VirtuosoException
setRef in interface java.sql.PreparedStatementi - the first parameter is 1, the second is 2, ...x - an object representing data of an SQL REF TypeVirtuosoException - if a database access error occursPreparedStatement.setRef(int, java.sql.Ref)public void setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
throws VirtuosoException
setDate in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuecal - the Calendar object the driver will use
to construct the dateVirtuosoException - if a database access error occursPreparedStatement.setDate(int, java.sql.Date)public void setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal)
throws VirtuosoException
setTime in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuecal - the Calendar object the driver will use
to construct the timeVirtuosoException - if a database access error occursPreparedStatement.setTime(int, java.sql.Time)public void setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal)
throws VirtuosoException
setTimestamp in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuecal - the Calendar object the driver will use
to construct the timestampVirtuosoException - if a database access error occursPreparedStatement.setTimestamp(int, java.sql.Timestamp)public void setURL(int parameterIndex,
java.net.URL x)
throws java.sql.SQLException
java.net.URL value.
The driver converts this to an SQL DATALINK value
when it sends it to the database.setURL in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java.net.URL object to be setjava.sql.SQLException - if a database access error occurspublic java.sql.ParameterMetaData getParameterMetaData()
throws java.sql.SQLException
PreparedStatement object's parameters.getParameterMetaData in interface java.sql.PreparedStatementParameterMetaData object that contains information
about the number, types and properties of this
PreparedStatement object's parametersjava.sql.SQLException - if a database access error occursParameterMetaDatapublic void setRowId(int parameterIndex,
java.sql.RowId x)
throws java.sql.SQLException
java.sql.RowId object. The
driver converts this to a SQL ROWID value when it sends it
to the databasesetRowId in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the parameter valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setNString(int parameterIndex,
java.lang.String value)
throws java.sql.SQLException
String object.
The driver converts this to a SQL NCHAR or
NVARCHAR or LONGNVARCHAR value
(depending on the argument's
size relative to the driver's limits on NVARCHAR values)
when it sends it to the database.setNString in interface java.sql.PreparedStatementparameterIndex - of the first parameter is 1, the second is 2, ...value - the parameter valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs; or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setNCharacterStream(int parameterIndex,
java.io.Reader value,
long length)
throws java.sql.SQLException
Reader object. The
Reader reads the data till end-of-file is reached. The
driver does the necessary conversion from Java character format to
the national character set in the database.setNCharacterStream in interface java.sql.PreparedStatementparameterIndex - of the first parameter is 1, the second is 2, ...value - the parameter valuelength - the number of characters in the parameter data.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs; or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setNClob(int parameterIndex,
java.sql.NClob value)
throws java.sql.SQLException
java.sql.NClob object. The driver converts this to a
SQL NCLOB value when it sends it to the database.setNClob in interface java.sql.PreparedStatementparameterIndex - of the first parameter is 1, the second is 2, ...value - the parameter valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs; or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setClob(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
Reader object. The reader must contain the number
of characters specified by length otherwise a SQLException will be
generated when the PreparedStatement is executed.
This method differs from the setCharacterStream (int, Reader, int) method
because it informs the driver that the parameter value should be sent to
the server as a CLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARCHAR or a CLOBsetClob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is 2, ...reader - An object that contains the data to set the parameter value to.length - the number of characters in the parameter data.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs; this method is called on
a closed PreparedStatement or if the length specified is less than zero.java.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length)
throws java.sql.SQLException
InputStream object. The inputstream must contain the number
of characters specified by length otherwise a SQLException will be
generated when the PreparedStatement is executed.
This method differs from the setBinaryStream (int, InputStream, int)
method because it informs the driver that the parameter value should be
sent to the server as a BLOB. When the setBinaryStream method is used,
the driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARBINARY or a BLOBsetBlob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1,
the second is 2, ...inputStream - An object that contains the data to set the parameter
value to.length - the number of bytes in the parameter data.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs;
this method is called on a closed PreparedStatement;
if the length specified
is less than zero or if the number of bytes in the inputstream does not match
the specfied length.java.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setNClob(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
Reader object. The reader must contain the number
of characters specified by length otherwise a SQLException will be
generated when the PreparedStatement is executed.
This method differs from the setCharacterStream (int, Reader, int) method
because it informs the driver that the parameter value should be sent to
the server as a NCLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGNVARCHAR or a NCLOBsetNClob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is 2, ...reader - An object that contains the data to set the parameter value to.length - the number of characters in the parameter data.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the length specified is less than zero;
if the driver does not support national character sets;
if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject)
throws java.sql.SQLException
java.sql.SQLXML object.
The driver converts this to an
SQL XML value when it sends it to the database.
setSQLXML in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is 2, ...xmlObject - a SQLXML object that maps an SQL XML valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs;
this method is called on a closed PreparedStatement
or the java.xml.transform.Result,
Writer or OutputStream has not been closed for
the SQLXML objectjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length)
throws java.sql.SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream. Data will be read from the stream
as needed until end-of-file is reached. 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.
setAsciiStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the Java input stream that contains the ASCII parameter valuelength - the number of bytes in the streamjava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementpublic void setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length)
throws java.sql.SQLException
LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream object. The data will be read from the
stream as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setBinaryStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java input stream which contains the binary parameter valuelength - the number of bytes in the streamjava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementpublic void setCharacterStream(int parameterIndex,
java.io.Reader reader,
long length)
throws java.sql.SQLException
Reader
object, which is the given number of characters long.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader object. The data will be read from the stream
as needed until end-of-file is reached. 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.
setCharacterStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...reader - the java.io.Reader object that contains the
Unicode datalength - the number of characters in the streamjava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementpublic void setAsciiStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream. Data will be read from the stream
as needed until end-of-file is reached. 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.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setAsciiStream which takes a length parameter.
setAsciiStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the Java input stream that contains the ASCII parameter valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setBinaryStream(int parameterIndex,
java.io.InputStream x)
throws java.sql.SQLException
LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream object. The data will be read from the
stream as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setBinaryStream which takes a length parameter.
setBinaryStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...x - the java input stream which contains the binary parameter valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setCharacterStream(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
Reader
object.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader object. The data will be read from the stream
as needed until end-of-file is reached. 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.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setCharacterStream which takes a length parameter.
setCharacterStream in interface java.sql.PreparedStatementparameterIndex - the first parameter is 1, the second is 2, ...reader - the java.io.Reader object that contains the
Unicode datajava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setNCharacterStream(int parameterIndex,
java.io.Reader value)
throws java.sql.SQLException
Reader object. The
Reader reads the data till end-of-file is reached. The
driver does the necessary conversion from Java character format to
the national character set in the database.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setNCharacterStream which takes a length parameter.
setNCharacterStream in interface java.sql.PreparedStatementparameterIndex - of the first parameter is 1, the second is 2, ...value - the parameter valuejava.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs; or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setClob(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
Reader object.
This method differs from the setCharacterStream (int, Reader) method
because it informs the driver that the parameter value should be sent to
the server as a CLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARCHAR or a CLOB
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setClob which takes a length parameter.
setClob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is 2, ...reader - An object that contains the data to set the parameter value to.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs; this method is called on
a closed PreparedStatementor if parameterIndex does not correspond to a parameter
marker in the SQL statementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setBlob(int parameterIndex,
java.io.InputStream inputStream)
throws java.sql.SQLException
InputStream object.
This method differs from the setBinaryStream (int, InputStream)
method because it informs the driver that the parameter value should be
sent to the server as a BLOB. When the setBinaryStream method is used,
the driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARBINARY or a BLOB
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setBlob which takes a length parameter.
setBlob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1,
the second is 2, ...inputStream - An object that contains the data to set the parameter
value to.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs;
this method is called on a closed PreparedStatement or
if parameterIndex does not correspond
to a parameter marker in the SQL statement,java.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodpublic void setNClob(int parameterIndex,
java.io.Reader reader)
throws java.sql.SQLException
Reader object.
This method differs from the setCharacterStream (int, Reader) method
because it informs the driver that the parameter value should be sent to
the server as a NCLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGNVARCHAR or a NCLOB
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setNClob which takes a length parameter.
setNClob in interface java.sql.PreparedStatementparameterIndex - index of the first parameter is 1, the second is 2, ...reader - An object that contains the data to set the parameter value to.java.sql.SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement;
if the driver does not support national character sets;
if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed PreparedStatementjava.sql.SQLFeatureNotSupportedException - if the JDBC driver does not support this methodprotected void setClosed(boolean flag)