public class JBaseJDBCPreparedStatement extends JBaseJDBCSocketStatement implements java.sql.PreparedStatement, JBaseJDBCGlobals
JBaseJDBCGlobals.TYPES
Modifier and Type | Field and Description |
---|---|
protected ParameterList |
parameters |
batchRequestsList
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
AM, CHAR_AM, CHAR_SM, CHAR_VM, SHORT_AM, SHORT_CHAR_AM, SHORT_CHAR_SM, SHORT_CHAR_VM, SHORT_SM, SHORT_VM, SM, VM
Constructor and Description |
---|
JBaseJDBCPreparedStatement(JBaseJDBCSocketConnection connection) |
JBaseJDBCPreparedStatement(JBaseJDBCSocketConnection connection,
java.lang.String sql) |
Modifier and Type | Method and Description |
---|---|
void |
addBatch() |
void |
clearParameters() |
void |
close()
Releases this Statement object's database and JDBC resources immediately
instead of waiting for this to happen when it is automatically closed.
|
protected static int |
countParameters(java.lang.String sqlTemplate) |
static void |
CRT(java.lang.String s) |
boolean |
execute() |
boolean |
execute(java.lang.String sql)
Executes the given SQL statement, which may return multiple results.
|
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
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.
|
boolean |
execute(java.lang.String sql,
int[] columnIndexes)
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.
|
java.sql.ResultSet |
executeQuery() |
int |
executeUpdate()
Executes the SQL statement in this PreparedStatement object,
which must be an SQL INSERT, UPDATE or DELETE statement;
or an SQL statement that returns nothing, such as a DDL statement.
|
java.sql.ResultSetMetaData |
getMetaData()
A jBASE JDBC driver's private method.
|
java.sql.ParameterMetaData |
getParameterMetaData() |
java.sql.ResultSet |
getResultSet()
Retrieves the current result as a ResultSet object.
|
static void |
main(java.lang.String[] args) |
void |
setArray(int i,
java.sql.Array x) |
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length) |
void |
setBigDecimal(int parameterIndex,
java.math.BigDecimal x) |
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length) |
void |
setBlob(int parameterIndex,
java.sql.Blob x) |
void |
setBoolean(int parameterIndex,
boolean x) |
void |
setByte(int parameterIndex,
byte x) |
void |
setBytes(int parameterIndex,
byte[] x) |
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length) |
void |
setClob(int i,
java.sql.Clob x) |
void |
setDate(int parameterIndex,
java.sql.Date x) |
void |
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
Sets the designated parameter to the given java.sql.Date value, using the given Calendar object.
|
void |
setDouble(int parameterIndex,
double x) |
void |
setFloat(int parameterIndex,
float x) |
void |
setInt(int parameterIndex,
int x) |
void |
setLong(int parameterIndex,
long x) |
void |
setNull(int parameterIndex,
int sqlType) |
void |
setNull(int parameterIndex,
int sqlType,
java.lang.String typeName) |
void |
setObject(int parameterIndex,
java.lang.Object x)
Sets the value of the designated parameter using the given object.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType) |
void |
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale) |
void |
setRef(int i,
java.sql.Ref x) |
void |
setShort(int parameterIndex,
short x) |
void |
setString(int parameterIndex,
java.lang.String x) |
void |
setTime(int parameterIndex,
java.sql.Time x) |
void |
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal) |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x) |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal) |
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length) |
void |
setURL(int parameterIndex,
java.net.URL x) |
addBatch, cancel, clearBatch, clearWarnings, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, freeId, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getId, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setId, setMaxFieldSize, setMaxRows, setQueryTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeLargeUpdate, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setObject, setObject, setRowId, setSQLXML
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
protected ParameterList parameters
public JBaseJDBCPreparedStatement(JBaseJDBCSocketConnection connection) throws java.sql.SQLException
java.sql.SQLException
public JBaseJDBCPreparedStatement(JBaseJDBCSocketConnection connection, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public static void CRT(java.lang.String s)
public static void main(java.lang.String[] args)
protected static int countParameters(java.lang.String sqlTemplate)
public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface java.sql.PreparedStatement
java.sql.SQLException
- if a database access error occurs or the SQL statement returns a ResultSet objectpublic void addBatch() throws java.sql.SQLException
addBatch
in interface java.sql.PreparedStatement
java.sql.SQLException
public void clearParameters() throws java.sql.SQLException
clearParameters
in interface java.sql.PreparedStatement
java.sql.SQLException
public boolean execute() throws java.sql.SQLException
execute
in interface java.sql.PreparedStatement
java.sql.SQLException
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
JBaseJDBCSocketStatement
getResultSet
in interface java.sql.Statement
getResultSet
in class JBaseJDBCSocketStatement
java.sql.SQLException
- if a database access error occurspublic boolean execute(java.lang.String sql) throws java.sql.SQLException
JBaseJDBCSocketStatement
execute
in interface java.sql.Statement
execute
in class JBaseJDBCSocketStatement
sql
- any SQL statementjava.sql.SQLException
- - if a database access error occurspublic boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
JBaseJDBCSocketStatement
execute
in interface java.sql.Statement
execute
in class JBaseJDBCSocketStatement
sql
- any SQL statementautoGeneratedKeys
- a constant indicating whether auto-generated keys should be made available for retrieval using the method getGeneratedKeys; one of the following constants: Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYSjava.sql.SQLException
- if a database access error occurs or the second parameter supplied to this method is not Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS.Statement.getResultSet()
,
Statement.getUpdateCount()
,
Statement.getMoreResults()
,
Statement.getGeneratedKeys()
,
Statement.execute(java.lang.String, int)
public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
JBaseJDBCSocketStatement
execute
in interface java.sql.Statement
execute
in class JBaseJDBCSocketStatement
sql
- any SQL statementcolumnIndexes
- an array of the indexes of the columns in the inserted row that should be made available for retrieval by a call to the method getGeneratedKeysjava.sql.SQLException
- if a database access error occurs or the elements in the int array passed to this method are not valid column indexesStatement.getResultSet()
,
Statement.getUpdateCount()
,
Statement.getMoreResults()
public void close() throws java.sql.SQLException
JBaseJDBCSocketStatement
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Statement
close
in class JBaseJDBCSocketStatement
java.sql.SQLException
- if a database access error occurspublic void setByte(int parameterIndex, byte x) throws java.sql.SQLException
setByte
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setDouble(int parameterIndex, double x) throws java.sql.SQLException
setDouble
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setFloat(int parameterIndex, float x) throws java.sql.SQLException
setFloat
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setInt(int parameterIndex, int x) throws java.sql.SQLException
setInt
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNull(int parameterIndex, int sqlType) throws java.sql.SQLException
setNull
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setLong(int parameterIndex, long x) throws java.sql.SQLException
setLong
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setShort(int parameterIndex, short x) throws java.sql.SQLException
setShort
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBoolean(int parameterIndex, boolean x) throws java.sql.SQLException
setBoolean
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBytes(int parameterIndex, byte[] x) throws java.sql.SQLException
setBytes
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
setAsciiStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
setBinaryStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
setUnicodeStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setCharacterStream(int parameterIndex, java.io.Reader reader, int length) throws java.sql.SQLException
setCharacterStream
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setObject(int parameterIndex, java.lang.Object x) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the object containing the input parameter valuejava.sql.SQLException
- if a database access error occurs or the type of the given object is ambiguouspublic void setObject(int parameterIndex, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setNull(int parameterIndex, int sqlType, java.lang.String typeName) throws java.sql.SQLException
setNull
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setString(int parameterIndex, java.lang.String x) throws java.sql.SQLException
setString
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws java.sql.SQLException
setBigDecimal
in interface java.sql.PreparedStatement
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 void setArray(int i, java.sql.Array x) throws java.sql.SQLException
setArray
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setBlob(int parameterIndex, java.sql.Blob x) throws java.sql.SQLException
setBlob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setClob(int i, java.sql.Clob x) throws java.sql.SQLException
setClob
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setDate(int parameterIndex, java.sql.Date x) throws java.sql.SQLException
setDate
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
public void setRef(int i, java.sql.Ref x) throws java.sql.SQLException
setRef
in interface java.sql.PreparedStatement
java.sql.SQLException
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
executeQuery
in interface java.sql.PreparedStatement
java.sql.SQLException
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
JBaseJDBCSocketStatement
getMetaData
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setTime(int parameterIndex, java.sql.Time x) throws java.sql.SQLException
setTime
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws java.sql.SQLException
setTimestamp
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal) throws java.sql.SQLException
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 datejava.sql.SQLException
- - if a database access error occurspublic void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal) throws java.sql.SQLException
setTime
in interface java.sql.PreparedStatement
java.sql.SQLException
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws java.sql.SQLException
setTimestamp
in interface java.sql.PreparedStatement
java.sql.SQLException