public class SqlCursor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CURSOR_NAME |
static int |
MODE_ANSI |
static int |
MODE_ORACLE |
static int |
ORACLE_UNSUPPORTED_FEATURE |
Constructor and Description |
---|
SqlCursor(java.lang.String name)
create a SqlCursor
|
SqlCursor(java.lang.String name,
boolean withHold,
SqlCursors parent)
create a SqlCursor with attributes
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
close the cursor
|
boolean |
deallocate()
deallocate storage associated with the cursor
|
void |
declare(java.sql.PreparedStatement ps1)
declare the cursor to be associated with the prepared statement
|
SqlCursor |
generate()
generate a prepared statement
|
java.lang.Boolean |
getHighValuesAsBytes()
indicate if HIGH VALUES is supported by the database associated with this cursor
|
int |
getOpenSequence()
return the current open sequence of this cursor
|
java.sql.PreparedStatement |
getPreparedStatement()
return the prepared statement associated with this cursor
|
java.sql.ResultSet |
getResultSet()
get the result set as a result of opening (executing) the cursor
|
java.sql.SQLWarning |
getSQLWarning()
return the SQLWarning most recently issued
|
boolean |
isHold()
indicate if the WITH HOLD marker is on for this cursor
|
boolean |
isInvalid()
indicate if the current connection is invalid
|
boolean |
isOpen()
indicate if the cursor is currently open
|
boolean |
isPrepared()
indicate if the cursor has been prepared
|
boolean |
isValid()
indicate if the current connection is valid
|
void |
log(java.lang.String s)
log a message to the SQL Context log
|
void |
log(java.lang.Throwable t)
log an exception to the SQL context log
|
boolean |
ofPSName(java.lang.String psName)
indicate if the prepared statement name matches
|
boolean |
open()
open the cursor
|
SqlCursor |
reset()
reset the cursor
|
SqlCursor |
reset(boolean withHold)
reset this SQL Cursor
|
void |
resetParameters()
reset parameters to the SQL cursor
|
void |
setFetchSize(int value)
set the number of rows to fetch at a time
|
void |
setLogMode(boolean state)
set the log mode
|
void |
setMaxRows(int value)
set the maximum number of rows this cursor should retrieve
|
SqlCursor |
setObject(int slot,
java.lang.Object parameter)
set the object associated with this cursor
|
SqlCursor |
setObject(int slot,
java.lang.Object parameter,
java.lang.Object nullIndicator)
set the object associated with this cursor
|
SqlCursor |
setObject(int slot,
java.lang.Object parameter,
java.lang.Object nullIndicator,
int oracleType)
set the object associated with this cursor
|
SqlCursor |
setObject(int slot,
java.lang.Object parameter,
java.lang.Object nullIndicator,
int oracleType,
java.lang.String dateFormat)
set the object associated with this cursor
|
SqlCursor |
setObject(java.lang.Object parameter)
set the cursor parameter to this cursor
|
SqlCursor |
setObject(java.lang.Object parameter,
java.lang.Object nullIndicator)
set the cursor parameter associated with this cursor
|
SqlCursor |
setObject(java.lang.Object parameter,
java.lang.Object nullIndicator,
int oracleType)
set the cursor parameter associated with this cursor
|
SqlCursor |
setObject(java.lang.Object parameter,
java.lang.Object nullIndicator,
int oracleType,
java.lang.String dateFormat)
set the cursor parameter associated with this cursor
|
void |
setPrefetchSize(int value)
set the prefetch amount of rows
|
void |
setPs(java.sql.PreparedStatement ps)
set the prepared statement
|
void |
setPSName(java.lang.String psName)
set the prepared statement name
|
void |
setQueryTimeout(int value)
set the query timeout in milliseconds
|
void |
setResultSet(java.sql.ResultSet rs)
set the result set associated with this cursor
|
void |
setValid(boolean state)
set the valid state of this connection
|
int |
updateWhereCurrent(java.lang.String updateString)
update the current row(s) associated with this cursor
|
int |
updateWhereCurrent(java.lang.String updateString,
java.lang.Object[] params)
update the current row(s) associated with this cursor
|
int |
updateWhereCurrent(java.lang.String updateString,
java.lang.Object[] params,
java.lang.Object[] indics)
update the current row(s) associated with this cursor
|
public static final int ORACLE_UNSUPPORTED_FEATURE
public static final java.lang.String DEFAULT_CURSOR_NAME
public static final int MODE_ANSI
public static final int MODE_ORACLE
public SqlCursor(java.lang.String name)
name
- - the name of the cursorpublic SqlCursor(java.lang.String name, boolean withHold, SqlCursors parent)
name
- - the name of the cursorwithHold
- - true if created WITH HOLD (open after commits)parent
- - the SqlCursors to use as a parentpublic void setPrefetchSize(int value)
value
- - the number of rows to prefetchpublic void setFetchSize(int value)
value
- - the number of rows to fetchpublic void setMaxRows(int value)
value
- - the maximum number of rowspublic void setQueryTimeout(int value)
value
- - the timeout in millisecondspublic void setLogMode(boolean state)
state
- - true to turn loggin onpublic final void log(java.lang.String s)
s
- - the String message to logpublic final void log(java.lang.Throwable t)
t
- - the Throwable exception to logpublic java.sql.SQLWarning getSQLWarning()
public boolean isValid()
public boolean isInvalid()
public void setValid(boolean state)
state
- - true if this connection is currently valid, false if notpublic final void resetParameters()
public final SqlCursor reset(boolean withHold)
withHold
- - true if this cursor should be marked as WITH HOLD (surviving commits)public final SqlCursor reset()
public final boolean isHold()
public final SqlCursor setObject(java.lang.Object parameter)
parameter
- the parameter associated with the cursorpublic final SqlCursor setObject(java.lang.Object parameter, java.lang.Object nullIndicator)
parameter
- the parameter associated with the cursornullIndicator
- the object indicating whether this parameter contains nullpublic final SqlCursor setObject(java.lang.Object parameter, java.lang.Object nullIndicator, int oracleType)
parameter
- the parameter associated with the cursornullIndicator
- the object indicating whether this parameter contains nulloracleType
- the Oracle column typepublic final SqlCursor setObject(java.lang.Object parameter, java.lang.Object nullIndicator, int oracleType, java.lang.String dateFormat)
parameter
- the parameter associated with the cursornullIndicator
- the object indicating whether this parameter contains nulloracleType
- the Oracle column typedateFormat
- for date columns the String representing the date formatpublic final SqlCursor setObject(int slot, java.lang.Object parameter) throws java.sql.SQLException
slot
- the slot number to setparameter
- the Object at that slot numberjava.sql.SQLException
- if the underlying JDBC operation failedpublic final SqlCursor setObject(int slot, java.lang.Object parameter, java.lang.Object nullIndicator) throws java.sql.SQLException
slot
- the slot number to setparameter
- the Object at that slot numbernullIndicator
- the Object that indicates whether this parameter is nulljava.sql.SQLException
- if the underlying JDBC operation failedpublic final SqlCursor setObject(int slot, java.lang.Object parameter, java.lang.Object nullIndicator, int oracleType) throws java.sql.SQLException
slot
- the slot number to setparameter
- the Object at that slot numbernullIndicator
- the Object that indicates whether this parameter is nulloracleType
- the Oracle type number associated with this objectjava.sql.SQLException
- if the underlying JDBC operation failedpublic final SqlCursor setObject(int slot, java.lang.Object parameter, java.lang.Object nullIndicator, int oracleType, java.lang.String dateFormat) throws java.sql.SQLException
slot
- the slot number to setparameter
- the Object at that slot numbernullIndicator
- the Object that indicates whether this parameter is nulloracleType
- the Oracle type number associated with this objectdateFormat
- for date columns the String representing the date formatjava.sql.SQLException
- if the underlying JDBC operation failedpublic final SqlCursor generate() throws java.sql.SQLException
java.sql.SQLException
- should an error occurpublic final void setPSName(java.lang.String psName)
psName
- the prepared statement namepublic final boolean ofPSName(java.lang.String psName)
psName
- the prepared statement name to checkpublic final boolean open() throws java.sql.SQLException
java.sql.SQLException
- if an error occurred during openingpublic final boolean isOpen()
public final boolean isPrepared()
public final boolean close() throws java.sql.SQLException
java.sql.SQLException
- if an error occurred while attempting to close the cursorpublic final boolean deallocate() throws java.sql.SQLException
java.sql.SQLException
- if an error occurred during deallocationpublic final void declare(java.sql.PreparedStatement ps1) throws java.sql.SQLException
ps1
- a PreparedStatement associated with the cursorjava.sql.SQLException
- if an error occurredpublic final java.sql.ResultSet getResultSet() throws java.sql.SQLException
java.sql.SQLException
- if an error occurredpublic void setResultSet(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- the ResultSet associated with this cursorjava.sql.SQLException
- if an error occurred while checking if this cursor is openpublic final java.sql.PreparedStatement getPreparedStatement()
public final int updateWhereCurrent(java.lang.String updateString, java.lang.Object[] params, java.lang.Object[] indics) throws java.sql.SQLException
updateString
- a String indicating the update operationparams
- - the parameters to updateindics
- - the indices to updatejava.sql.SQLException
- if an error occurred during updatepublic final int updateWhereCurrent(java.lang.String updateString, java.lang.Object[] params) throws java.sql.SQLException
updateString
- a String indicating the update operationparams
- - the parameters to updatejava.sql.SQLException
- if an error occurred during updatepublic final int updateWhereCurrent(java.lang.String updateString) throws java.sql.SQLException
updateString
- a String indicating the update operationjava.sql.SQLException
- if an error occurred during updatepublic void setPs(java.sql.PreparedStatement ps)
ps
- the PreparedStatement associated with this SqlCursorpublic java.lang.Boolean getHighValuesAsBytes()
public int getOpenSequence()