public class IfxPreparedStatement extends IfxStatement implements IfmxPreparedStatement, PreparedStatement2
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.
Connection.prepareStatement(java.lang.String)
,
ResultSet
Modifier and Type | Field and Description |
---|---|
protected long |
namedCalls |
protected long |
ordinalCalls |
protected java.util.Vector<IfxObject> |
vector |
BatchParamVector, BatchVector, Closed, commandString, currentResult, cursorOpen, executeBatchInProgress, jconn, numqmarks, outputMetaData, pool, poolable, prot, SGK_ALL_KEYS, SGK_indexes, SGK_KEYS_BY_INDEX, SGK_KEYS_BY_NAME, SGK_metaData, SGK_names, SGK_NO_KEYS, SGK_resultSet, statementType
Modifier and Type | Method and Description |
---|---|
void |
addBatch()
JDBC 2.0
Add a set of parameters to the batch.
|
void |
addBatch(java.lang.String sql)
JDBC 2.0
Adds a SQL command to the current batch of commmands for the statement.
|
protected boolean |
ambiguousSQLType(int sqltype) |
protected void |
checkParameterIndex(int i,
int qmarks) |
void |
clearBatch()
JDBC 2.0
Make the set of commands in the current batch empty.
|
void |
clearBindColType()
Reset the values set by calling setBindColType()
|
void |
clearParameters()
In general parameter values remain in force for repeated use of a
Statement.
|
void |
close()
In many cases, it is desirable to immediately release a
Statements's database and JDBC resources instead of waiting for
this to happen when it is automatically closed; the close
method provides this immediate release.
|
void |
closeCursor()
Will issue SQ_CLOSE with currently active statement id, resulting in
database releasing the lock on currently active cursor.
|
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.
|
boolean |
execute(java.lang.String sql)
Execute a SQL statement that may return multiple results.
|
boolean |
execute(java.lang.String sql,
int returnKeys) |
boolean |
execute(java.lang.String sql,
int[] columnIndexes) |
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames) |
int[] |
executeBatch()
JDBC 2.0
Submit a batch of commands to the database for execution.
|
java.sql.ResultSet |
executeQuery()
A prepared SQL query is executed and its ResultSet is returned.
|
java.sql.ResultSet |
executeQuery(boolean withHold)
A prepared SQL query is executed and its ResultSet is returned.
|
java.sql.ResultSet |
executeQuery(boolean withHold,
boolean withReOptimization)
An Informix executeQuery() extension to specify whether the
result should be a HOLD ResultSet (cursor) or not and if the
query plan should be reoptimized if the data for the preparedstatement
object has changed.
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute a SQL statement that returns a single ResultSet.
|
java.sql.ResultSet |
executeQuery(java.lang.String sql,
boolean withhold)
Execute a SQL statement that returns a single ResultSet.
|
int |
executeUpdate()
Execute a SQL INSERT, UPDATE or DELETE statement.
|
int |
executeUpdate(java.lang.String sql)
Execute a SQL INSERT, UPDATE or DELETE statement.
|
int |
executeUpdate(java.lang.String sql,
int returnKeys)
Execute a SQL INSERT, UPDATE or DELETE statement.
|
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes)
Execute a SQL INSERT, UPDATE or DELETE statement.
|
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Execute a SQL INSERT, UPDATE or DELETE statement.
|
java.sql.ResultSetMetaData |
getMetaData()
The number, types and properties of a ResultSet's columns
are provided by the getMetaData method.
|
java.sql.ParameterMetaData |
getParameterMetaData() |
protected java.sql.ParameterMetaData |
getParameterMetaData(java.lang.String signature,
boolean isProc,
java.lang.String procName,
int numParams) |
IfxProtocol |
getResultSetProtocol()
Returns the Protocol object created by the currentResult variable
for Connected RowSets.
|
void |
IfxSetObject(int i,
java.lang.Object x,
int ifxType)
This method is the same as the setObject() method with the
exception that the driver will convert the object to the given
ifxtype when sending to the database.
|
void |
IfxSetObject(int i,
java.lang.Object x,
int scale,
int ifxType)
This method is the same as the setObject() method with the
exception that the driver will convert the object to the given
ifxtype when sending to the database.
|
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
setArray(int i,
java.sql.Array x)
JDBC 2.0
Set an Array parameter.
|
void |
setArray(int i,
java.sql.Array x,
int ifxType)
JDBC 2.0
Set an Array parameter.
|
protected void |
setArray(int i,
java.sql.Array x,
java.lang.String collectionType)
Set an Array parameter.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x) |
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.
|
void |
setAsciiStream(int i,
java.io.InputStream x,
int length,
int ifxType)
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.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length) |
void |
setBigDecimal(int i,
java.math.BigDecimal x)
Set a parameter to a java.lang.BigDecimal value.
|
void |
setBigDecimal(int i,
java.math.BigDecimal x,
int ifxType)
Set a parameter to a java.lang.BigDecimal value.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x) |
void |
setBinaryStream(int paramterIndex,
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.
|
void |
setBinaryStream(int i,
java.io.InputStream x,
int length,
int ifxType)
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.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length) |
void |
setBindColIfxType(int colIndex,
int ifxtype)
Similar to setBindColType(), but used when application wants
to use Informix SQL types in it's parameter call.
|
void |
setBindColIfxType(int colIndex,
int ifxtype,
int scale)
Allows applications to specify the output
type to be IFX_TYPE_DECIMAL, IFX_TYPE_MONEY
so that the server can cast to that type before returning
to the client.
|
void |
setBindColIfxType(int colIndex,
int ifxtype,
java.lang.String name)
Allows applications to specify the output
type to be IFX_TYPE_LIST, IFX_TYPE_ROW, IFX_TYPE_MULTISET,
IFX_TYPE_SET, IFX_TYPE_UDTVAR, IFX_TYPE_UDTFIXED
so that the server can cast to that type before returning
to the client.
|
void |
setBindColType(int colIndex,
int sqltype)
Allows applications to specify the output
type of the resultset values so that the server can cast
to that type before returning to the client.
|
void |
setBindColType(int colIndex,
int sqltype,
int scale)
Allows applications to specify the output
type to be java.sql.DECIMAL or java.sql.NUMERIC,
so that the server can cast to that type before returning
to the client.
|
void |
setBindColType(int colIndex,
int sqltype,
java.lang.String name)
Allows applications to specify the output
type to be java.sql.STRUCT, java.sql.ARRAY, java.sql.DISTINCT,
and java.sql.JAVA_OBJECT so that the server can cast
to that type before returning to the client.
|
void |
setBlob(int i,
java.sql.Blob x)
JDBC 2.0
Set a BLOB parameter.
|
void |
setBlob(int i,
java.sql.Blob x,
int ifxType)
JDBC 2.0
Set a BLOB parameter.
|
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream) |
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length) |
void |
setBoolean(int i,
boolean x)
Set a parameter to a Java boolean value.
|
void |
setBoolean(int i,
boolean x,
int ifxType)
Set a parameter to a Java boolean value.
|
void |
setByte(int i,
byte x)
Set a parameter to a Java byte value.
|
void |
setByte(int i,
byte x,
int ifxType)
Set a parameter to a Java byte value.
|
void |
setBytes(int i,
byte[] x)
Set a parameter to a Java array of bytes.
|
void |
setBytes(int i,
byte[] x,
int ifxType)
Set a parameter to a Java array of bytes.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader) |
void |
setCharacterStream(int i,
java.io.Reader x,
int length)
JDBC 2.0
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.
|
void |
setCharacterStream(int i,
java.io.Reader x,
int length,
int ifxType)
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.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
long length) |
void |
setClob(int i,
java.sql.Clob x)
JDBC 2.0
Set a CLOB parameter.
|
void |
setClob(int i,
java.sql.Clob x,
int ifxType)
JDBC 2.0
Set a CLOB parameter.
|
void |
setClob(int parameterIndex,
java.io.Reader reader) |
void |
setClob(int parameterIndex,
java.io.Reader reader,
long length) |
void |
setDate(int i,
java.sql.Date x)
Set a parameter to a java.sql.Date value.
|
void |
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
Set a parameter to a java.sql.Date value.
|
void |
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal,
int ifxType)
Set a parameter to a java.sql.Date value.
|
void |
setDate(int i,
java.sql.Date x,
int ifxType)
Set a parameter to a java.sql.Date value.
|
void |
setDouble(int i,
double x)
Set a parameter to a Java double value.
|
void |
setDouble(int i,
double x,
int ifxType)
Set a parameter to a Java double value.
|
void |
setFloat(int i,
float x)
Set a parameter to a Java float value.
|
void |
setFloat(int i,
float x,
int ifxType)
Set a parameter to a Java float value.
|
void |
setIfxBSONObject(int i,
IfxBSONObject x)
Sets a parameter to an IfxBSONObject value.
|
void |
setInt(int i,
int x)
Set a parameter to a Java int value.
|
void |
setInt(int i,
int x,
int ifxType)
Set a parameter to a Java int value.
|
void |
setInterval(int i,
Interval x)
Set a parameter to an Interval value.
|
void |
setIntervalDF(int i,
IntervalDF x)
Set a parameter to an IntervalDF value.
|
void |
setIntervalYM(int i,
IntervalYM x)
Set a parameter to an IntervalYM value.
|
void |
setLong(int i,
long x)
Set a parameter to a Java long value.
|
void |
setLong(int i,
long x,
int ifxType)
Set a parameter to a Java long value.
|
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value) |
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value,
long length) |
void |
setNClob(int parameterIndex,
java.sql.NClob value) |
void |
setNClob(int parameterIndex,
java.io.Reader reader) |
void |
setNClob(int parameterIndex,
java.io.Reader reader,
long length) |
void |
setNString(int parameterIndex,
java.lang.String value) |
void |
setNull(int i,
int sqlType)
Set a parameter to SQL NULL.
|
void |
setNull(int i,
int sqlType,
int ifxType)
Set a parameter to SQL NULL.
|
protected void |
setNull(int i,
int sqlType,
int ifxType,
java.lang.String name)
Set a parameter to SQL NULL.
|
void |
setNull(int i,
int sqlType,
java.lang.String name)
Set a parameter to SQL NULL.
|
void |
setObject(int i,
java.lang.Object x) |
void |
setObject(int i,
java.lang.Object x,
int targetSqlType)
This method is like setObject above, but assumes scale of zero.
|
void |
setObject(int i,
java.lang.Object x,
int targetSqlType,
int scale)
Set the value of a parameter using an object; use the
java.lang equivalent objects for integral values.
|
protected void |
setObject(int i,
java.lang.Object x,
java.lang.String name) |
void |
setRef(int i,
java.sql.Ref x)
JDBC 2.0
Set a REF(<structured-type>) parameter.
|
void |
setRowId(int parameterIndex,
java.sql.RowId x) |
void |
setShort(int i,
short x)
Set a parameter to a Java short value.
|
void |
setShort(int i,
short x,
int ifxType)
Set a parameter to a Java short value.
|
void |
setSQLXML(int parameterIndex,
java.sql.SQLXML xmlObject) |
void |
setString(int i,
java.lang.String x)
Set a parameter to a Java String value.
|
void |
setString(int i,
java.lang.String x,
int ifxType)
This method is Informix extension method and
NOT a JDBC standard method.
|
void |
setTime(int i,
java.sql.Time x)
Set a parameter to a java.sql.Time value.
|
void |
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal)
Set a parameter to a java.sql.Time value.
|
void |
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal,
int ifxType)
Set a parameter to a java.sql.Time value.
|
void |
setTime(int i,
java.sql.Time x,
int ifxType)
Set a parameter to a java.sql.Time value.
|
void |
setTimestamp(int i,
java.sql.Timestamp x)
Set a parameter to a java.sql.Timestamp value.
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal)
Set a parameter to a java.sql.Timestamp value.
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal,
int ifxType)
Set a parameter to a java.sql.Timestamp value.
|
void |
setTimestamp(int i,
java.sql.Timestamp x,
int ifxType)
Set a parameter to a java.sql.Timestamp value.
|
void |
setUnicodeStream(int i,
java.io.InputStream x,
int length)
Deprecated.
|
void |
setURL(int parameterIndex,
java.net.URL x) |
protected void |
superClose() |
<T> T |
unwrap(java.lang.Class<T> iface) |
cancel, chkAndSetGetRsltCalledFlag, clearWarnings, closeOnCompletion, executeImpl, executeQueryImpl, getAutoFree, getBigSerial, getConnection, getCursorName, getFetchBufferSize, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getSerial, getSerial8, getStatementType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, resetMethodCalledFlags, scrubBatch, setAutoFree, setCursorName, setEscapeProcessing, setFetchBufferSize, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setResultSetConcurrency, setResultSetType, setStatementType, transferWarnings
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, clearWarnings, closeOnCompletion, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
protected java.util.Vector<IfxObject> vector
protected long ordinalCalls
protected long namedCalls
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
executeQuery
in interface java.sql.PreparedStatement
java.sql.SQLException
public java.sql.ResultSet executeQuery(boolean withHold) throws java.sql.SQLException
executeQuery
in interface IfmxPreparedStatement
withHold
- use Cursor With Hold or notjava.sql.SQLException
public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface java.sql.PreparedStatement
java.sql.SQLException
public boolean execute() throws java.sql.SQLException
execute
in interface java.sql.PreparedStatement
java.sql.SQLException
Statement.execute(java.lang.String)
public boolean execute(java.lang.String sql) throws java.sql.SQLException
IfxStatement
execute
in interface java.sql.Statement
execute
in class IfxStatement
sql
- any SQL statementjava.sql.SQLException
IfxStatement.getResultSet()
,
IfxStatement.getUpdateCount()
,
IfxStatement.getMoreResults()
public boolean execute(java.lang.String sql, int returnKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
execute
in class IfxStatement
java.sql.SQLException
public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
execute
in interface java.sql.Statement
execute
in class IfxStatement
java.sql.SQLException
public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
execute
in class IfxStatement
java.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
IfxStatement
executeQuery
in interface java.sql.Statement
executeQuery
in class IfxStatement
sql
- typically this is a static SQL SELECT statementjava.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sql, boolean withhold) throws java.sql.SQLException
IfxStatement
executeQuery
in interface IfmxStatement
executeQuery
in class IfxStatement
sql
- typically this is a static SQL SELECT statementwithhold
- use Cursor With Hold or notjava.sql.SQLException
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
IfxStatement
executeUpdate
in interface java.sql.Statement
executeUpdate
in class IfxStatement
sql
- a SQL INSERT, UPDATE or DELETE statement or a SQL
statement that returns nothingjava.sql.SQLException
public int executeUpdate(java.lang.String sql, int returnKeys) throws java.sql.SQLException
IfxStatement
executeUpdate
in interface java.sql.Statement
executeUpdate
in class IfxStatement
sql
- a SQL INSERT, UPDATE or DELETE statement or a SQL
statement that returns nothingjava.sql.SQLException
public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
IfxStatement
executeUpdate
in interface java.sql.Statement
executeUpdate
in class IfxStatement
sql
- a SQL INSERT, UPDATE or DELETE statement or a SQL
statement that returns nothingjava.sql.SQLException
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
IfxStatement
executeUpdate
in interface java.sql.Statement
executeUpdate
in class IfxStatement
sql
- a SQL INSERT, UPDATE or DELETE statement or a SQL
statement that returns nothingjava.sql.SQLException
public void setNull(int i, int sqlType) throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
setNull
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- SQL type code defined by java.sql.Typesjava.sql.SQLException
IfxTypes
public void setNull(int i, int sqlType, int ifxType) throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
setNull
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- SQL type code defined by java.sql.Typesjava.sql.SQLException
IfxTypes
public void setNull(int i, int sqlType, java.lang.String name) throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
setNull
in interface PreparedStatement2
setNull
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- SQL type code defined by java.sql.Typesjava.sql.SQLException
protected void setNull(int i, int sqlType, int ifxType, java.lang.String name) throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- SQL type code defined by java.sql.TypesifxType
- Informix type code defined by com.informix.lang.IfxTypesname
- Opaque type name, distinct type name or complex type
definitionjava.sql.SQLException
public void setBigDecimal(int i, java.math.BigDecimal x) throws java.sql.SQLException
setBigDecimal
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setBigDecimal(int i, java.math.BigDecimal x, int ifxType) throws java.sql.SQLException
setBigDecimal
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setBoolean(int i, boolean x) throws java.sql.SQLException
setBoolean
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setBoolean(int i, boolean x, int ifxType) throws java.sql.SQLException
setBoolean
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setByte(int i, byte x) throws java.sql.SQLException
setByte
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setByte(int i, byte x, int ifxType) throws java.sql.SQLException
setByte
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setShort(int i, short x) throws java.sql.SQLException
setShort
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setShort(int i, short x, int ifxType) throws java.sql.SQLException
setShort
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setInt(int i, int x) throws java.sql.SQLException
setInt
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setInt(int i, int x, int ifxType) throws java.sql.SQLException
setInt
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setLong(int i, long x) throws java.sql.SQLException
setLong
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setLong(int i, long x, int ifxType) throws java.sql.SQLException
setLong
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setFloat(int i, float x) throws java.sql.SQLException
setFloat
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setFloat(int i, float x, int ifxType) throws java.sql.SQLException
setFloat
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setDouble(int i, double x) throws java.sql.SQLException
setDouble
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setDouble(int i, double x, int ifxType) throws java.sql.SQLException
setDouble
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setString(int i, java.lang.String x) throws java.sql.SQLException
setString
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setString(int i, java.lang.String x, int ifxType) throws java.sql.SQLException
setString
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setBytes(int i, byte[] x) throws java.sql.SQLException
setBytes
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setBytes(int i, byte[] x, int ifxType) throws java.sql.SQLException
setBytes
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setDate(int i, java.sql.Date x) throws java.sql.SQLException
setDate
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setDate(int i, java.sql.Date x, int ifxType) throws java.sql.SQLException
setDate
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setTime(int i, java.sql.Time x) throws java.sql.SQLException
setTime
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setTime(int i, java.sql.Time x, int ifxType) throws java.sql.SQLException
setTime
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setTimestamp(int i, java.sql.Timestamp x) throws java.sql.SQLException
setTimestamp
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setTimestamp(int i, java.sql.Timestamp x, int ifxType) throws java.sql.SQLException
setTimestamp
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
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.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java input stream which contains the ASCII parameter valuelength
- the number of bytes in the streamjava.sql.SQLException
public void setAsciiStream(int i, java.io.InputStream x, int length, int ifxType) throws java.sql.SQLException
Note: this stream object can either be a standard Java stream object, or your own subclass that implements the standard interface.
setAsciiStream
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java input stream which contains the ASCII parameter valuelength
- the number of bytes in the streamifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setUnicodeStream(int i, java.io.InputStream x, int length) throws java.sql.SQLException
Note: this stream object can either be a standard Java stream object, or your own subclass that implements the standard interface.
setUnicodeStream
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java input stream which contains the
UNICODE parameter value @param length the number of bytes in
the streamjava.sql.SQLException
public void setBinaryStream(int paramterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
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.PreparedStatement
parameterIndex
- 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
public void setBinaryStream(int i, java.io.InputStream x, int length, int ifxType) throws java.sql.SQLException
Note: this stream object can either be a standard Java stream object, or your own subclass that implements the standard interface.
setBinaryStream
in interface IfmxPreparedStatement
parameterIndex
- 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 streamifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.IfxTypes
public void setInterval(int i, Interval x) throws java.sql.SQLException
setInterval
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setIntervalYM(int i, IntervalYM x) throws java.sql.SQLException
setIntervalYM
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void setIntervalDF(int i, IntervalDF x) throws java.sql.SQLException
setIntervalDF
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
public void clearParameters() throws java.sql.SQLException
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.
clearParameters
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setObject(int i, java.lang.Object x, int targetSqlType, int scale) throws java.sql.SQLException
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, by using a Driver specific Java type and using a targetSqlType of java.sql.types.OTHER.
setObject
in interface java.sql.PreparedStatement
parameterIndex
- 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. For all other
types this value will be ignored,java.sql.SQLException
Types
public void setObject(int i, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setObject(int i, java.lang.Object x) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
java.sql.SQLException
protected void setObject(int i, java.lang.Object x, java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public void IfxSetObject(int i, java.lang.Object x, int scale, int ifxType) throws java.sql.SQLException
This method is the same as the setObject() method with the exception that the driver will convert the object to the given ifxtype when sending to the database.
IfxSetObject
in interface IfmxPreparedStatement
parameterIndex
- The first parameter is 1, the second is 2, ...x
- The object containing the input parameter valuescale
- For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored,ifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
public void IfxSetObject(int i, java.lang.Object x, int ifxType) throws java.sql.SQLException
This method is the same as the setObject() method with the exception that the driver will convert the object to the given ifxtype when sending to the database.
IfxSetObject
in interface IfmxPreparedStatement
parameterIndex
- The first parameter is 1, the second is 2, ...x
- The object containing the input parameter valueifxType
- the Informix type to bind as.java.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
protected void checkParameterIndex(int i, int qmarks) throws java.sql.SQLException
java.sql.SQLException
public void addBatch(java.lang.String sql) throws java.sql.SQLException
IfxStatement
addBatch
in interface java.sql.Statement
addBatch
in class IfxStatement
sql
- typically this is a static SQL INSERT or UPDATE statementjava.sql.SQLException
- if a database-access error occurs, or the
driver does not support batch statementspublic void addBatch() throws java.sql.SQLException
addBatch
in interface PreparedStatement2
addBatch
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database-access error occurs.Statement.addBatch(java.lang.String)
public int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
executeBatch
in class IfxStatement
java.sql.SQLException
- if a database-access error occurs, or the
driver does not support batch statementspublic void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
clearBatch
in class IfxStatement
java.sql.SQLException
- if a database-access error occurs, or the
driver does not support batch statementspublic void setCharacterStream(int i, java.io.Reader x, int length) throws java.sql.SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setCharacterStream
in interface PreparedStatement2
setCharacterStream
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java reader which contains the UNICODE datalength
- the number of characters in the streamjava.sql.SQLException
- if a database-access error occurs.public void setCharacterStream(int i, java.io.Reader x, int length, int ifxType) throws java.sql.SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setCharacterStream
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java reader which contains the UNICODE datalength
- the number of characters in the streamifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.public void setRef(int i, java.sql.Ref x) throws java.sql.SQLException
setRef
in interface PreparedStatement2
setRef
in interface java.sql.PreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing data of an SQL REF Typejava.sql.SQLException
public void setBlob(int i, java.sql.Blob x) throws java.sql.SQLException
setBlob
in interface PreparedStatement2
setBlob
in interface java.sql.PreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing a BLOBjava.sql.SQLException
public void setBlob(int i, java.sql.Blob x, int ifxType) throws java.sql.SQLException
setBlob
in interface IfmxPreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing a BLOBifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
public void setClob(int i, java.sql.Clob x) throws java.sql.SQLException
setClob
in interface PreparedStatement2
setClob
in interface java.sql.PreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing a CLOBjava.sql.SQLException
public void setClob(int i, java.sql.Clob x, int ifxType) throws java.sql.SQLException
setClob
in interface IfmxPreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing a CLOBifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
public void setArray(int i, java.sql.Array x) throws java.sql.SQLException
setArray
in interface PreparedStatement2
setArray
in interface java.sql.PreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing an SQL arrayjava.sql.SQLException
public void setArray(int i, java.sql.Array x, int ifxType) throws java.sql.SQLException
setArray
in interface IfmxPreparedStatement
i
- the first parameter is 1, the second is 2, ...x
- an object representing an SQL arrayifxType
- the Informix type to bind asjava.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
protected void setArray(int i, java.sql.Array x, java.lang.String collectionType) throws java.sql.SQLException
i
- the first parameter is 1, the second is 2, ...x
- an object representing an SQL arraycollectionType
- Collection definitionjava.sql.SQLException
- if a database-access error occurs.public void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal) throws java.sql.SQLException
setTime
in interface PreparedStatement2
setTime
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal, int ifxType) throws java.sql.SQLException
setTime
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind as.cal
- The calendar object the driver uses to construct the time.java.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface PreparedStatement2
getMetaData
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database-access error occurs.public void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal) throws java.sql.SQLException
setDate
in interface PreparedStatement2
setDate
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- the Calendar object the driver will use to construct the date
NOTE : The default Calendar is also considered to construct the datejava.sql.SQLException
- if a database-access error occurs.public void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal, int ifxType) throws java.sql.SQLException
setDate
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuecal
- the Calendar object the driver will use to construct the dateifxType
- the Informix type to bind as
NOTE : The default Calendar is also considered to construct the datejava.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws java.sql.SQLException
setTimestamp
in interface PreparedStatement2
setTimestamp
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal, int ifxType) throws java.sql.SQLException
setTimestamp
in interface IfmxPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valueifxType
- the Informix type to bind ascal
- The calendar object the driver uses to construct the timestamp.java.sql.SQLException
- if a database-access error occurs.com.informix.jdbc.IfxTypes
public void setBindColType(int colIndex, int sqltype) throws java.sql.SQLException
setBindColType
in interface IfmxPreparedStatement
colIndex
- the first parameter is 1, the second is 2, ...sqltype
- the server should cast to.java.sql.SQLException
public void setBindColType(int colIndex, int sqltype, int scale) throws java.sql.SQLException
setBindColType
in interface IfmxPreparedStatement
colIndex
- the first parameter is 1, the second is 2, ...sqltype
- the server should cast to.scale
- - Java specific scale - not used by Informixjava.sql.SQLException
public void setBindColIfxType(int colIndex, int ifxtype, int scale) throws java.sql.SQLException
setBindColIfxType
in interface IfmxPreparedStatement
colIndex
- the first parameter is 1, the second is 2, ...ifxtype
- the server should cast to.scale
- - Informix specific encoded lengthjava.sql.SQLException
public void setBindColType(int colIndex, int sqltype, java.lang.String name) throws java.sql.SQLException
setBindColType
in interface IfmxPreparedStatement
colIndex
- the first parameter is 1, the second is 2, ...sqltype
- the server should cast to.name
- indicates the string representation of the UDT
or complex typejava.sql.SQLException
public void setBindColIfxType(int colIndex, int ifxtype, java.lang.String name) throws java.sql.SQLException
setBindColIfxType
in interface IfmxPreparedStatement
colIndex
- the first parameter is 1, the second is 2, ...ifxtype
- the server should cast to.name
- indicates the string representation of the UDT
or complex typejava.sql.SQLException
public void setBindColIfxType(int colIndex, int ifxtype) throws java.sql.SQLException
setBindColIfxType
in interface IfmxPreparedStatement
colIndex
- the first parameter is 1, the second is 2, ...ifxtype
- the server should cast to.java.sql.SQLException
protected boolean ambiguousSQLType(int sqltype)
public void clearBindColType() throws java.sql.SQLException
clearBindColType
in interface IfmxPreparedStatement
java.sql.SQLException
public IfxProtocol getResultSetProtocol() throws java.sql.SQLException
java.sql.SQLException
public void setURL(int parameterIndex, java.net.URL x) throws java.sql.SQLException
setURL
in interface java.sql.PreparedStatement
java.sql.SQLException
public java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException
getParameterMetaData
in interface java.sql.PreparedStatement
java.sql.SQLException
protected java.sql.ParameterMetaData getParameterMetaData(java.lang.String signature, boolean isProc, java.lang.String procName, int numParams) throws java.sql.SQLException
java.sql.SQLException
public void setAsciiStream(int parameterIndex, java.io.InputStream x) throws java.sql.SQLException
setAsciiStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setAsciiStream(int parameterIndex, java.io.InputStream x, long length) throws java.sql.SQLException
setAsciiStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBinaryStream(int parameterIndex, java.io.InputStream x) throws java.sql.SQLException
setBinaryStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBinaryStream(int parameterIndex, java.io.InputStream x, long length) throws java.sql.SQLException
setBinaryStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBlob(int parameterIndex, java.io.InputStream inputStream) throws java.sql.SQLException
setBlob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBlob(int parameterIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException
setBlob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setCharacterStream(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
setCharacterStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setCharacterStream(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
setCharacterStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setClob(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
setClob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setClob(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
setClob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNCharacterStream(int parameterIndex, java.io.Reader value) throws java.sql.SQLException
setNCharacterStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNCharacterStream(int parameterIndex, java.io.Reader value, long length) throws java.sql.SQLException
setNCharacterStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNClob(int parameterIndex, java.sql.NClob value) throws java.sql.SQLException
setNClob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNClob(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
setNClob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNClob(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
setNClob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNString(int parameterIndex, java.lang.String value) throws java.sql.SQLException
setNString
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setRowId(int parameterIndex, java.sql.RowId x) throws java.sql.SQLException
setRowId
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setSQLXML(int parameterIndex, java.sql.SQLXML xmlObject) throws java.sql.SQLException
setSQLXML
in interface java.sql.PreparedStatement
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
isWrapperFor
in class IfxStatement
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
unwrap
in class IfxStatement
java.sql.SQLException
public void closeCursor() throws java.sql.SQLException
IfmxPreparedStatement
Will issue SQ_CLOSE with currently active statement id, resulting in database releasing the lock on currently active cursor.
This is a subset of Statement.close() method which would have closed all database resources associated with the prepared statement.
closeCursor
in interface IfmxPreparedStatement
java.sql.SQLException
public void close() throws java.sql.SQLException
IfxStatement
Note: A Statement is automatically closed when it is garbage collected. When a Statement is closed its current ResultSet, if one exists, is also closed.
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Statement
close
in class IfxStatement
java.sql.SQLException
protected void superClose() throws java.sql.SQLException
java.sql.SQLException
public void setIfxBSONObject(int i, IfxBSONObject x) throws java.sql.SQLException
IfmxPreparedStatement
setIfxBSONObject
in interface IfmxPreparedStatement
i
- The first parameter is 1, the second is 2, and so on.x
- The parameter value.java.sql.SQLException
public java.sql.ResultSet executeQuery(boolean withHold, boolean withReOptimization) throws java.sql.SQLException
IfmxPreparedStatement
executeQuery
in interface IfmxPreparedStatement
withHold
- - specifies whether the ResultSet is a HOLD cursor, default falsewithReOptimization
- - specifies whether query plan should be reoptimized, default falsejava.sql.SQLException