|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
oracle.jdbc.driver.OracleStatement
Oracle statement class.
Field Summary |
Type | Field |
---|---|
int |
auto_rollback
|
boolean |
closed
|
oracle.jdbc.driver.DBStatement |
dbstmt
|
oracle.jdbc.driver.DBDataSet |
defines
|
int |
wait_option
|
Method Summary |
Type | Method |
---|---|
void |
addBatch(java.lang.String sql)
Add a SQL command to the current batch. |
void |
cancel()
Cancel the current statement |
void |
clearBatch()
Make the set of commands in the current batch empty. |
void |
clearDefines()
Allows the user to clear previously defined types for the define-columns of a select statement. This is useful if the user wishes to re-use a statement for a different query. |
void |
clearWarnings()
We do not have any statement-level warnings. |
void |
close()
Close the current result set, if any, and then close the statement. |
void |
closeWithKey(java.lang.String key)
The underlying cursor is not closed and the Statement handle is cached on the Key. |
int |
creationState()
Returns the Creation Status of this Statement. |
void |
defineColumnType(int column_index,
int type)
Define the type under which you will fetch data from the column. |
void |
defineColumnType(int column_index,
int type,
int max_size)
Define the type under which you will fetch data from the column and the maximum size of data you want, specifying the maximum size in bytes, not characters. |
void |
defineColumnType(int column_index,
int typeCode,
java.lang.String typeName)
Define the type under which you will fetch data from the column. |
void |
defineColumnTypeChars(int column_index,
int type,
int max_size)
Define the type under which you will fetch data from the column and the maximum size of data you want, specifying the maximum size in characters, rather than bytes. |
boolean |
execute(java.lang.String sql)
Execute a SQL statement. |
int[] |
executeBatch()
Submit a batch of commands to the database for execution. |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute a query statement. |
int |
executeUpdate(java.lang.String sql)
Execute an update statement. |
boolean |
getAutoRefetch()
Oracle extension. |
java.sql.Connection |
getConnection()
JDBC 2.0 Returns the Connection object
that produced this Statement object. |
short |
getDBTypeForm(int index)
|
int |
getFetchDirection()
JDBC 2.0 Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object. |
int |
getFetchSize()
JDBC 2.0 Retrieves the number of result set rows that is the default fetch size for result sets generated from this Statement object. |
boolean |
getFixedString()
Returns the current setObject(string) behavior for this Statement. By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics. |
int |
getMaxFieldSize()
|
int |
getMaxRows()
|
boolean |
getMoreResults()
We only have one result and there no way to indicate it. |
int |
getQueryTimeout()
The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. |
java.sql.ResultSet |
getResultSet()
Allocate a result set. |
int |
getResultSetConcurrency()
JDBC 2.0 Retrieves the result set concurrency. |
int |
getResultSetType()
JDBC 2.0 Determine the result set type. |
int |
getRowPrefetch()
Allows the user to retrieve the prefetch value for all results sets created from this statement. |
byte |
getSqlKind()
Return the statement kind. |
int |
getUpdateCount()
|
java.sql.SQLWarning |
getWarnings()
We do not have any statement-level warnings |
boolean |
is_value_null(boolean getColumn,
int index)
This is public only so that the Jolt server can get to it. |
int |
sendBatch()
Void entrypoint so that we do not have to cast statements to OraclePreparedStatements when sending the batch |
void |
setAutoRefetch(boolean autoRefetch)
Oracle extension. |
void |
setCursorName(java.lang.String name)
We do not support that |
void |
setEscapeProcessing(boolean enable)
|
void |
setFetchDirection(int direction)
JDBC 2.0 Gives the driver a hint as to the direction in which the rows in a result set will be processed. |
void |
setFetchSize(int rows)
JDBC 2.0 Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. |
void |
setFixedString(boolean fixedString_value)
Changes the default setObject(string) behavior for this Statement. By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics. |
void |
setMaxFieldSize(int max)
|
void |
setMaxRows(int max)
|
void |
setQueryTimeout(int max)
The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. |
void |
setResultSetCache(OracleResultSetCache cache)
Oracle Extenstion Override the default result set cache. |
void |
setResultSetCache(OracleResultSetCache cache)
Oracle Extenstion Override the default result set cache. |
void |
setRowPrefetch(int value)
setRowPrefetch allows the user to set the row prefetch value for all result sets created from this statement. setRowPrefetch overrides the prefetch value set from the connection, for this particular statement. The row_prefetch will be turned back to 1 automatically by the driver if any of the select-column types is streaming (long data or long raw data). |
Field Detail |
public oracle.jdbc.driver.DBDataSet defines
public oracle.jdbc.driver.DBStatement dbstmt
public boolean closed
public int auto_rollback
public int wait_option
Method Detail |
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
sql
- SQL statement to be executed. The query is transformed
into native SQL.public void close() throws java.sql.SQLException
public void closeWithKey(java.lang.String key) throws java.sql.SQLException
key
- A key to tag to the statement to be retrieved laterpublic int executeUpdate(java.lang.String sql) throws java.sql.SQLException
sql
- SQL statement to be executed. The query is transformed
into native SQL.public boolean execute(java.lang.String sql) throws java.sql.SQLException
sql
- SQL statement to be executed.public byte getSqlKind()
public void clearDefines() throws java.sql.SQLException
This is useful if the user wishes to re-use a statement for a different query.
After calling clearDefines, the user can either perform defines by calling defineColumnType/defineColumnTypeChars or let the driver use the default defines for the table.
To use the clearDefines
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
public void defineColumnType(int column_index, int type) throws java.sql.SQLException
If you decide to define column types you have to declare the types of exactly all columns in the Query. If definition are missing or too many definitions are provided executeQuery will fail with a SQLException.
To use the defineColumnType
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
column_index
- Index of columntype
- Type to be assigned to column
This type could be different from the
native type of the column. Appropriate
conversions will be done. A subsequent
call to getObject() for this column will
return the supplied type rather than the
native type, however.public void defineColumnType(int column_index, int type, int max_size) throws java.sql.SQLException
void defineColumnType (int column_index,
int type)
before executing a Query you may choose to inform
JDBC of the type you will use for fetching data from columns and the
maximum length of data you desire. Each type of data has a default
maximum length. This API is useful if you do not wish to get the
full default length of data.
The actual maximum length of data returned
will be the minimum of the following values:
Similar to the other "define" API, to use the
defineColumnType
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
column_index
- Index of columntype
- Type to be assigned to column
This type could be different from the
native type of the column. Appropriate
conversions will be done. A subsequent
call to getObject() for this column will
return the supplied type rather than the
native type, however.max_size
- Maximum length of data that the user
wants for this column. This value is
specified in bytes, not characters.
To specify the maximum length in characters,
use the defineColumnTypeChars
entrypoint.public void defineColumnTypeChars(int column_index, int type, int max_size) throws java.sql.SQLException
defineColumnType
.void defineColumnType (int column_index,
int type)
before executing a Query you may choose to inform
JDBC of the type you will use for fetching data from columns and the
maximum length of data you desire. Each type of data has a default
maximum length. This API is useful if you do not wish to get the
full default length of data.
The actual maximum length of data returned
will be the minimum of the following values:
Similar to the other "define" API, to use the
defineColumnTypeChars
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
column_index
- Index of columntype
- Type to be assigned to column
This type could be different from the
native type of the column. Appropriate
conversions will be done.max_size
- Maximum length of data that the user
wants for this column. This value is
specified in characters, not bytes.
To specify the maximum length in bytes,
use the defineColumnType
entrypoint.public void defineColumnType(int column_index, int typeCode, java.lang.String typeName) throws java.sql.SQLException
If you decide to define column types you have to declare the types of exactly all columns in the Query. If definition are missing or too many definitions are provided executeQuery will fail with a SQLException.
To use the defineColumnType
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
column_index
- Index of columntypeCode
- Type code for this column.typeName
- specifies the fully-qualified name of the
column if typeCode is OracleTypes.REF_TYPE
or OracleTypes.STRUCT or OracleTypes.ARRAY.
This parameter is ignored for other type
codes.public void setRowPrefetch(int value) throws java.sql.SQLException
setRowPrefetch overrides the prefetch value set from the connection, for this particular statement.
The row_prefetch will be turned back to 1 automatically by the driver if any of the select-column types is streaming (long data or long raw data). This is overrides any value the user might set. Also, this will be done regardless of wether the streaming columns are read or not.
To use the setRowPrefetch
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
public int getRowPrefetch()
To use the getRowPrefetch
entrypoint you have to
cast the Statement object to the type
oracle.jdbc.driver.OracleStatement
.
public void setFixedString(boolean fixedString_value)
By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics. This is in accordance with the JDBC specification.
This behavior can be changed for this Statement by passing false to setFixedString().
fixedString
- If true, then setObject(x, String) calls will bind
with Types.FIXED_CHAR rather than Types.VARCHAR, which
will result in blank-padded character comparison
semantics.getFixedString
public boolean getFixedString()
By default, a call to PreparedStatement.setObject() with a String will bind the string using Types.VARCHAR, which will use non blank-padded character comparison semantics. This is in accordance with the JDBC specification.
This behavior can be changed for this Statement by passing false to setFixedString().
setFixedString
public int getMaxFieldSize() throws java.sql.SQLException
public void setMaxFieldSize(int max) throws java.sql.SQLException
public int getMaxRows() throws java.sql.SQLException
public void setMaxRows(int max) throws java.sql.SQLException
public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
public int getQueryTimeout() throws java.sql.SQLException
public void setQueryTimeout(int max) throws java.sql.SQLException
seconds
- the new query timeout limit in seconds; zero means unlimit
edpublic void cancel() throws java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
public void setCursorName(java.lang.String name) throws java.sql.SQLException
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
public int getUpdateCount() throws java.sql.SQLException
public boolean getMoreResults() throws java.sql.SQLException
public int sendBatch() throws java.sql.SQLException
public short getDBTypeForm(int index)
public boolean is_value_null(boolean getColumn, int index) throws java.sql.SQLException
public void setFetchDirection(int direction) throws java.sql.SQLException
direction
- the initial direction for processing rowspublic int getFetchDirection() throws java.sql.SQLException
Statement
object.
Since Oracle database only supports forward only cursor.
This method always return FETCH_FORWARD.Statement
objectpublic void setFetchSize(int rows) throws java.sql.SQLException
rows
- the number of rows to fetchpublic int getFetchSize() throws java.sql.SQLException
Statement
object.
If this Statement
object has not set
a fetch size by calling the method setFetchSize
,
the return value is the connection default prefetch size.Statement
objectpublic int getResultSetConcurrency() throws java.sql.SQLException
public int getResultSetType() throws java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
Connection
object
that produced this Statement
object.public void setResultSetCache(OracleResultSetCache cache) throws java.sql.SQLException
cache
- is a OracleResultSetCache instancepublic void setResultSetCache(OracleResultSetCache cache) throws java.sql.SQLException
cache
- is a OracleResultSetCache instancepublic void addBatch(java.lang.String sql) throws java.sql.SQLException
sql
- typically this is a static SQL INSERT or UPDATE
statement.public void clearBatch() throws java.sql.SQLException
public int[] executeBatch() throws java.sql.SQLException
Commands are executed in the order in which they were added to the batch. This method closes the calling Statement object's current set if one is open. The statement's internal list of batch commands is reset to empty once this method returns.
public void setAutoRefetch(boolean autoRefetch) throws java.sql.SQLException
autoRefetch
- true enables auto-refetch; false disables auto-refetch.OracleConnection.setDefaultAutoRefetch(boolean)
,
OracleResultSet.setAutoRefetch(boolean)
public boolean getAutoRefetch() throws java.sql.SQLException
setAutoRefetch(boolean)
public int creationState()
OracleStatement.NEW (0) OracleStatement.IMPLICIT (1) OracleStatement.EXPLICIT (2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |