|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--superwaba.ext.xplat.sql.Statement | +--superwaba.ext.xplat.sql.PreparedStatement | +--superwaba.ext.xplat.sql.db2e.Db2eStatement
This implements Statement and PreparedStatement to save on overall package size.
Field Summary | |
protected int |
_conHandle
|
protected Db2eConnection |
_connection
|
protected int |
_count
|
protected Db2e |
_db
|
protected int |
_maxFieldSize
|
protected superwaba.ext.xplat.sql.db2e.Db2eResultSet.Db2eRsmd |
_meta
|
protected boolean |
_resultOpen
|
protected superwaba.ext.xplat.sql.db2e.Db2eResultSet |
_results
|
protected int |
_resultSetType
|
protected int |
_statement
|
protected SQLWarning |
_warnings
|
Fields inherited from class superwaba.ext.xplat.sql.Statement |
CLOSE_ALL_RESULTS,
CLOSE_CURRENT_RESULT,
EXECUTE_FAILED,
KEEP_CURRENT_RESULT,
NO_GENERATED_KEYS,
RETURN_GENERATED_KEYS,
SUCCESS_NO_INFO |
Method Summary | |
void |
addBatch()
This method adds a set of parameters to the batch for JDBC 2.0. |
void |
addBatch(String sql)
This method adds a SQL statement to a SQL batch. |
void |
clearBatch()
This method clears out any SQL statements that have been populated in the current batch. |
void |
clearParameters()
This method clears all of the input parameter that have been set on this statement. |
void |
clearWarnings()
This method clears any SQL warnings that have been attached to this statement. |
void |
close()
This method closes the statement and frees any associated resources. |
protected void |
ensureParamSize(int parameterIndex)
|
boolean |
execute()
This method executes a prepared SQL query. |
boolean |
execute(String sql)
This method executes an arbitrary SQL statement of any time. |
int[] |
executeBatch()
This method executes the SQL batch and returns an array of update counts - one for each SQL statement in the batch - ordered in the same order the statements were added to the batch. |
ResultSet |
executeQuery()
This method executes a prepared SQL query and returns its ResultSet. |
ResultSet |
executeQuery(String sql)
This method executes the specified SQL SELECT statement and returns a (possibly empty) ResultSet with the results of the query. |
protected boolean |
executeSet(String sql)
|
int |
executeUpdate()
This method executes an SQL INSERT, UPDATE or DELETE statement. |
int |
executeUpdate(String sql)
This method executes the specified SQL INSERT, UPDATE, or DELETE statement and returns the number of rows affected, which may be 0. |
Connection |
getConnection()
This method returns the Connection instance that was
used to create this object. |
int |
getFetchDirection()
This method returns the current direction that the driver thinks the result set will be accessed int. |
int |
getFetchSize()
This method returns the number of rows the driver believes should be fetched from the database at a time. |
int |
getMaxFieldSize()
This method returns the maximum length of any column value in bytes. |
int |
getMaxRows()
This method returns the maximum possible number of rows in a result set. |
ResultSetMetaData |
getMetaData()
This method returns meta data for the result set from this statement. |
boolean |
getMoreResults()
This method advances the result set pointer to the next result set, which can then be retrieved using getResultSet |
ParameterMetaData |
getParameterMetaData()
|
int |
getQueryTimeout()
The method returns the number of seconds a statement may be in process before timing out. |
ResultSet |
getResultSet()
This method returns the result set of the SQL statement that was executed. |
int |
getResultSetConcurrency()
This method returns the concurrency type of the result set for this statement. |
int |
getResultSetType()
This method returns the result set type for this statement. |
int |
getUpdateCount()
This method returns the update count of the SQL statement that was executed. |
SQLWarning |
getWarnings()
This method returns the first SQL warning attached to this statement. |
protected void |
handleError(DB2Exception error)
|
protected void |
notSupported()
|
protected boolean |
prepResultSet(boolean resetColumns)
|
void |
setBlob(int parameterIndex,
Blob x)
This method sets the specified parameter from the given Java Blob value. |
void |
setBoolean(int parameterIndex,
boolean x)
This method sets the specified parameter from the given Java boolean value. |
void |
setByte(int parameterIndex,
byte x)
This method sets the specified parameter from the given Java byte value. |
void |
setBytes(int parameterIndex,
byte[] x)
This method sets the specified parameter from the given Java byte array value. |
void |
setBytes(int parameterIndex,
byte[] x,
int start,
int length)
This method sets the specified parameter from the given Java byte array value. |
void |
setCursorName(String name)
This method sets the cursor name that will be used by the result set. |
void |
setDate(int parameterIndex,
Date x)
This method sets the specified parameter from the given Java java.sql.Date value. |
void |
setDouble(int parameterIndex,
double x)
This method sets the specified parameter from the given Java double value. |
void |
setEscapeProcessing(boolean enable)
This method sets the local escape processing mode on or off. |
void |
setFetchDirection(int direction)
This method informs the driver which direction the result set will be accessed in. |
void |
setFetchSize(int rows)
This method informs the driver how many rows it should fetch from the database at a time. |
void |
setFloat(int parameterIndex,
float x)
This method sets the specified parameter from the given Java float value. |
void |
setInt(int parameterIndex,
int x)
This method sets the specified parameter from the given Java int value. |
void |
setLong(int parameterIndex,
long x)
This method sets the specified parameter from the given Java long value. |
void |
setMaxFieldSize(int max)
This method sets the limit for the maximum length of any column in bytes. |
void |
setMaxRows(int max)
This method sets the maximum number of rows that can be present in a result set. |
void |
setNull(int parameterIndex,
int sqlType)
This method populates the specified parameter with a SQL NULL value for the specified type. |
void |
setNull(int paramIndex,
int sqlType,
String typeName)
This method populates the specified parameter with a SQL NULL value for the specified type. |
void |
setObject(int parameterIndex,
Object x)
This method sets the specified parameter from the given Java Object value. |
void |
setObject(int parameterIndex,
Object x,
int targetSqlType)
This method sets the specified parameter from the given Java Object value. |
void |
setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
This method sets the specified parameter from the given Java Object value. |
void |
setQueryTimeout(int seconds)
This method sets the number of seconds a statement may be in process before timing out. |
void |
setRef(int i,
Ref x)
This method sets the specified parameter from the given Java Ref value. |
void |
setShort(int parameterIndex,
short x)
This method sets the specified parameter from the given Java short value. |
void |
setString(int parameterIndex,
String x)
This method sets the specified parameter from the given Java String value. |
void |
setTime(int parameterIndex,
Time x)
This method sets the specified parameter from the given Java java.sql.Time value. |
void |
setTimestamp(int parameterIndex,
Timestamp x)
This method sets the specified parameter from the given Java java.sql.Timestamp value. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Field Detail |
protected SQLWarning _warnings
protected Db2eConnection _connection
protected Db2e _db
protected int _conHandle
protected int _statement
protected int _maxFieldSize
protected boolean _resultOpen
protected superwaba.ext.xplat.sql.db2e.Db2eResultSet _results
protected superwaba.ext.xplat.sql.db2e.Db2eResultSet.Db2eRsmd _meta
protected int _count
protected int _resultSetType
Method Detail |
protected void notSupported() throws SQLException
protected void handleError(DB2Exception error) throws SQLException
protected boolean prepResultSet(boolean resetColumns) throws SQLException
public void addBatch(String sql) throws SQLException
sql
- The sql statement to add to the batch.public void clearBatch() throws SQLException
public void clearWarnings() throws SQLException
public void close() throws SQLException
protected boolean executeSet(String sql) throws DB2Exception
public boolean execute(String sql) throws SQLException
getResultSet
, getMoreResults
and
getUpdateCount
retrieve the results.true
if a result set was returned, false
if an update count was returned.public int[] executeBatch() throws SQLException
public ResultSet executeQuery(String sql) throws SQLException
ResultSet
with the results of the query.sql
- The SQL statement to execute.public int executeUpdate(String sql) throws SQLException
sql
- The SQL statement to execute.public Connection getConnection() throws SQLException
Connection
instance that was
used to create this object.public int getFetchDirection() throws SQLException
public int getFetchSize() throws SQLException
public int getMaxFieldSize() throws SQLException
public int getMaxRows() throws SQLException
public boolean getMoreResults() throws SQLException
getResultSet
true
if there is another result set,
false
otherwise (for example, the next result is an
update count).execute(java.lang.String)
public int getQueryTimeout() throws SQLException
public ResultSet getResultSet() throws SQLException
null
if there was
no result set (for example, if the statement was an UPDATE).execute(java.lang.String)
public int getResultSetConcurrency() throws SQLException
ResultSet
.ResultSet
public int getResultSetType() throws SQLException
ResultSet
.ResultSet
public int getUpdateCount() throws SQLException
execute(java.lang.String)
public SQLWarning getWarnings() throws SQLException
public void setCursorName(String name) throws SQLException
name
- The cursor name to use for this statement.public void setEscapeProcessing(boolean enable) throws SQLException
escape
- true
to enable local escape processing,
false
to disable it.public void setFetchDirection(int direction) throws SQLException
direction
- The direction the result set will be accessed in (?????)public void setFetchSize(int rows) throws SQLException
numrows
- The number of rows the driver should fetch at a time
to populate the result set.public void setMaxFieldSize(int max) throws SQLException
maxsize
- The new maximum length of any column in bytes.public void setMaxRows(int max) throws SQLException
maxrows
- The maximum possible number of rows in a result set.public void setQueryTimeout(int seconds) throws SQLException
timeout
- The new SQL statement timeout value.public void addBatch() throws SQLException
public void clearParameters() throws SQLException
public boolean execute() throws SQLException
public ResultSet executeQuery() throws SQLException
public int executeUpdate() throws SQLException
public ResultSetMetaData getMetaData() throws SQLException
public ParameterMetaData getParameterMetaData() throws SQLException
protected void ensureParamSize(int parameterIndex)
public void setBlob(int parameterIndex, Blob x) throws SQLException
Blob
value. The default object type to SQL type mapping
will be used.index
- The index of the parameter value to set.value
- The value of the parameter.public void setBoolean(int parameterIndex, boolean x) throws SQLException
boolean
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setByte(int parameterIndex, byte x) throws SQLException
byte
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setBytes(int parameterIndex, byte[] x) throws SQLException
byte
array value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setBytes(int parameterIndex, byte[] x, int start, int length) throws SQLException
byte
array value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setDate(int parameterIndex, Date x) throws SQLException
java.sql.Date
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setDouble(int parameterIndex, double x) throws SQLException
double
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setFloat(int parameterIndex, float x) throws SQLException
float
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setInt(int parameterIndex, int x) throws SQLException
int
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setLong(int parameterIndex, long x) throws SQLException
long
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setNull(int parameterIndex, int sqlType) throws SQLException
index
- The index of the parameter to set.type
- The SQL type identifier of the parameter from Types
public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException
index
- The index of the parameter to set.type
- The SQL type identifier of the parameter from Types
name
- The name of the data type, for user defined types.public void setObject(int parameterIndex, Object x) throws SQLException
Object
value. The default object type to SQL type mapping
will be used.index
- The index of the parameter value to set.value
- The value of the parameter.public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException
Object
value. The specified SQL object type will be used.index
- The index of the parameter value to set.value
- The value of the parameter.type
- The SQL type to use for the parameter, from Types
Types
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
Object
value. The specified SQL object type will be used.index
- The index of the parameter value to set.value
- The value of the parameter.type
- The SQL type to use for the parameter, from Types
scale
- The scale of the value, for numeric values only.Types
public void setRef(int i, Ref x) throws SQLException
Ref
value. The default object type to SQL type mapping
will be used.index
- The index of the parameter value to set.value
- The value of the parameter.public void setShort(int parameterIndex, short x) throws SQLException
short
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setString(int parameterIndex, String x) throws SQLException
String
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setTime(int parameterIndex, Time x) throws SQLException
java.sql.Time
value.index
- The index of the parameter value to set.value
- The value of the parameter.public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
java.sql.Timestamp
value.index
- The index of the parameter value to set.value
- The value of the parameter.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |