public class SQLRCursor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
SQLRConnection |
connection |
long |
cursor
cursor and connection are used internally, they're just
public to make the JNI wrapper work faster.
|
Constructor and Description |
---|
SQLRCursor(SQLRConnection con) |
Modifier and Type | Method and Description |
---|---|
long |
affectedRows()
Returns the number of rows that were
updated, inserted or deleted by the query.
|
void |
cacheOff()
Sets query caching off.
|
void |
cacheToFile(java.lang.String filename)
Sets query caching on.
|
void |
clearBinds()
Clear all bind variables.
|
void |
closeResultSet()
Closes the current result set, if one is open.
|
int |
colCount()
Returns the number of columns in the current
result set.
|
short |
countBindVariables()
Parses the previously prepared query,
counts the number of bind variables defined
in it and returns that number.
|
void |
defineOutputBindBlob(java.lang.String variable)
Define an output bind variable.
|
void |
defineOutputBindClob(java.lang.String variable)
Define an output bind variable.
|
void |
defineOutputBindCursor(java.lang.String variable)
Define an output bind variable.
|
void |
defineOutputBindDouble(java.lang.String variable)
Define a double precision floating point output bind variable.
|
void |
defineOutputBindInteger(java.lang.String variable)
Define an integer output bind variable.
|
void |
defineOutputBindString(java.lang.String variable,
int bufferlength)
Define a string output bind variable.
|
void |
delete() |
void |
dontGetColumnInfo()
Tells the server not to send any column
info (names, types, sizes).
|
boolean |
endOfResultSet()
Returns 0 if part of the result set is still
pending on the server and 1 if not.
|
java.lang.String |
errorMessage()
If a query failed and generated an error,
the error message is available here.
|
long |
errorNumber()
If a query failed and generated an
error, the error number is available here.
|
boolean |
executeQuery()
Execute the query that was previously
prepared and bound.
|
boolean |
fetchFromBindCursor()
Fetch from a cursor that was returned as
an output bind variable.
|
long |
firstRowIndex()
Returns the index of the first buffered row.
|
java.lang.String |
getCacheFileName()
Returns the name of the file containing the
cached result set.
|
void |
getColumnInfo()
Tells the server to send column info.
|
boolean |
getColumnIsAutoIncrement(int col)
Returns true if the specified column
auto-increments and false otherwise.
|
boolean |
getColumnIsAutoIncrement(java.lang.String col)
Returns true if the specified column
auto-increments and false otherwise.
|
boolean |
getColumnIsBinary(int col)
Returns true if the specified column
contains binary data and false
otherwise.
|
boolean |
getColumnIsBinary(java.lang.String col)
Returns true if the specified column
contains binary data and false
otherwise.
|
boolean |
getColumnIsNullable(int col)
Returns true if the specified column can
contain nulls and false otherwise.
|
boolean |
getColumnIsNullable(java.lang.String col)
Returns true if the specified column can
contain nulls and false otherwise.
|
boolean |
getColumnIsPartOfKey(int col)
Returns true if the specified column is
part of a composite key and false otherwise.
|
boolean |
getColumnIsPartOfKey(java.lang.String col)
Returns true if the specified column is
part of a composite key and false otherwise.
|
boolean |
getColumnIsPrimaryKey(int col)
Returns true if the specified column is a
primary key and false otherwise.
|
boolean |
getColumnIsPrimaryKey(java.lang.String col)
Returns true if the specified column is a
primary key and false otherwise.
|
boolean |
getColumnIsUnique(int col)
Returns true if the specified column is
unique and false otherwise.
|
boolean |
getColumnIsUnique(java.lang.String col)
Returns true if the specified column is
unique and false otherwise.
|
boolean |
getColumnIsUnsigned(int col)
Returns true if the specified column is
an unsigned number and false otherwise.
|
boolean |
getColumnIsUnsigned(java.lang.String col)
Returns true if the specified column is
an unsigned number and false otherwise.
|
boolean |
getColumnIsZeroFilled(int col)
Returns true if the specified column was
created with the zero-fill flag and false
otherwise.
|
boolean |
getColumnIsZeroFilled(java.lang.String col)
Returns true if the specified column was
created with the zero-fill flag and false
otherwise.
|
int |
getColumnLength(int col)
Returns the length of the specified column.
|
int |
getColumnLength(java.lang.String col)
Returns the length of the specified column.
|
boolean |
getColumnList(java.lang.String table,
java.lang.String wild)
Sends a query that returns a list of columns
in the table specified by the "table" parameter
matching "wild".
|
java.lang.String |
getColumnName(int col)
Returns the name of the specified column.
|
java.lang.String[] |
getColumnNames()
Returns a null terminated array of the
column names of the current result set.
|
long |
getColumnPrecision(int col)
Returns the precision of the specified
column.
|
long |
getColumnPrecision(java.lang.String col)
Returns the precision of the specified
column.
|
long |
getColumnScale(int col)
Returns the scale of the specified column.
|
long |
getColumnScale(java.lang.String col)
Returns the scale of the specified column.
|
java.lang.String |
getColumnType(int col)
Returns the type of the specified column.
|
java.lang.String |
getColumnType(java.lang.String col)
Returns the type of the specified column.
|
boolean |
getDatabaseList(java.lang.String wild)
Sends a query that returns a list of
databases/schemas matching "wild".
|
java.lang.String |
getField(long row,
int col)
Returns a pointer to the value of the
specified row and column.
|
java.lang.String |
getField(long row,
java.lang.String col)
Returns a pointer to the value of the
specified row and column.
|
byte[] |
getFieldAsByteArray(long row,
int col)
Returns a pointer to the value of the
specified row and column.
|
byte[] |
getFieldAsByteArray(long row,
java.lang.String col)
Returns the length of the
specified row and column.
|
double |
getFieldAsDouble(long row,
int col)
Returns the specified field as a double floating point number
|
double |
getFieldAsDouble(long row,
java.lang.String col)
Returns the specified field as a double floating point number
|
long |
getFieldAsInteger(long row,
int col)
Returns the specified field as a long integer
|
long |
getFieldAsInteger(long row,
java.lang.String col)
Returns the specified field as a long integer
|
long |
getFieldLength(long row,
int col)
Returns the length of the
specified row and column.
|
long |
getFieldLength(long row,
java.lang.String col)
Returns the length of the
specified row and column.
|
int |
getLongest(int col)
Returns the length of the longest field
in the specified column.
|
int |
getLongest(java.lang.String col)
Returns the length of the longest field
in the specified column.
|
void |
getNullsAsEmptyStrings()
Tells the connection to return NULL fields
and output bind variables as empty strings.
|
void |
getNullsAsNulls()
Tells the connection to return NULL fields
and output bind variables as NULL's rather
than as empty strings.
|
byte[] |
getOutputBindAsByteArray(java.lang.String variable)
Get the length of the value stored in a
previously defined output bind variable.
|
byte[] |
getOutputBindBlob(java.lang.String variable)
Get the value stored in a previously
defined output bind variable.
|
java.lang.String |
getOutputBindClob(java.lang.String variable)
Get the value stored in a previously
defined output bind variable.
|
SQLRCursor |
getOutputBindCursor(java.lang.String variable)
Get the cursor associated with a
previously defined output bind variable.
|
double |
getOutputBindDouble(java.lang.String variable)
Get the value stored in a previously
defined output bind variable as a double
precision floating point number.
|
long |
getOutputBindInteger(java.lang.String variable)
Get the value stored in a previously
defined output bind variable as a long
integer.
|
long |
getOutputBindLength(java.lang.String variable)
Get the length of the value stored in a
previously defined output bind variable.
|
java.lang.String |
getOutputBindString(java.lang.String variable)
Get the value stored in a previously
defined output bind variable.
|
long |
getResultSetBufferSize()
Returns the number of result set rows that
will be buffered at a time or 0 for the
entire result set.
|
short |
getResultSetId()
Returns the internal ID of this result set.
|
java.lang.String[] |
getRow(long row)
Returns a null terminated array of the
values of the fields in the specified row.
|
long[] |
getRowLengths(long row)
Returns a null terminated array of the
lengths of the fields in the specified row.
|
boolean |
getTableList(java.lang.String wild)
Sends a query that returns a list of tables
matching "wild".
|
void |
inputBind(java.lang.String variable,
double value,
int precision,
int scale)
Define an input bind variable.
|
void |
inputBind(java.lang.String variable,
long value)
Define an input bind variable.
|
void |
inputBind(java.lang.String variable,
java.lang.String value)
Define an input bind variable.
|
void |
inputBind(java.lang.String variable,
java.lang.String value,
int length)
Define an input bind variable.
|
void |
inputBindBlob(java.lang.String variable,
byte[] value,
long size)
Define an input bind variable.
|
void |
inputBindClob(java.lang.String variable,
java.lang.String value,
long size)
Define an input bind variable.
|
void |
inputBinds(java.lang.String[] variables,
double[] values,
int[] precisions,
int[] scales)
Define an array of input bind variables.
|
void |
inputBinds(java.lang.String[] variables,
long[] values)
Define an array of input bind variables.
|
void |
inputBinds(java.lang.String[] variables,
java.lang.String[] values)
Define an array of input bind variables.
|
void |
lowerCaseColumnNames()
Columns names are converted to lower case.
|
void |
mixedCaseColumnNames()
Columns names are returned in the same
case as they are defined in the database.
|
boolean |
openCachedResultSet(java.lang.String filename)
Opens a cached result set.
|
boolean |
prepareFileQuery(java.lang.String path,
java.lang.String filename)
Prepare to execute "query" with length
"length".
|
void |
prepareQuery(java.lang.String query)
Prepare to execute "query".
|
void |
prepareQuery(java.lang.String query,
int length)
Prepare to execute the contents
of "path"/"filename".
|
boolean |
resumeCachedResultSet(short id,
java.lang.String filename)
Resumes a result set previously left open
using suspendSession() and continues caching
the result set to "filename".
|
boolean |
resumeResultSet(short id)
Resumes a result set previously left open
using suspendSession().
|
long |
rowCount()
Returns the number of rows in the current
result set (if the result set is being
stepped through, this returns the number
of rows processed so far).
|
boolean |
sendFileQuery(java.lang.String path,
java.lang.String filename)
Sends "query" with length "length" and gets
a result set.
|
boolean |
sendQuery(java.lang.String query)
Sends "query" and gets a result set.
|
boolean |
sendQuery(java.lang.String query,
int length)
Sends the query in file "path"/"filename"
and gets a result set.
|
void |
setCacheTtl(int ttl)
Sets the time-to-live for cached result
sets.
|
void |
setResultSetBufferSize(long rows)
Sets the number of rows of the result set
to buffer at a time.
|
void |
substitution(java.lang.String variable,
double value,
int precision,
int scale)
Define a substitution variable.
|
void |
substitution(java.lang.String variable,
long value)
Define a substitution variable.
|
void |
substitution(java.lang.String variable,
java.lang.String value)
Define a substitution variable.
|
void |
substitutions(java.lang.String[] variables,
double[] values,
int[] precisions,
int[] scales)
Define an array of substitution variables.
|
void |
substitutions(java.lang.String[] variables,
long[] values)
Define an array of substitution variables.
|
void |
substitutions(java.lang.String[] variables,
java.lang.String[] values)
Define an array of substitution variables.
|
void |
suspendResultSet()
Tells the server to leave this result
set open when the connection calls
suspendSession() so that another connection
can connect to it using resumeResultSet()
after it calls resumeSession().
|
long |
totalRows()
Returns the total number of rows that will
be returned in the result set.
|
void |
upperCaseColumnNames()
Columns names are converted to upper case.
|
void |
validateBinds()
If you are binding to any variables that
might not actually be in your query, call
this to ensure that the database won't try
to bind them unless they really are in the
query.
|
boolean |
validBind(java.lang.String variable)
Returns true if "variable" was a valid
bind variable of the query
|
public long cursor
public SQLRConnection connection
public SQLRCursor(SQLRConnection con)
public void delete()
public void setResultSetBufferSize(long rows)
public long getResultSetBufferSize()
public void dontGetColumnInfo()
public void getColumnInfo()
public void mixedCaseColumnNames()
public void upperCaseColumnNames()
public void lowerCaseColumnNames()
public void cacheToFile(java.lang.String filename)
public void setCacheTtl(int ttl)
public java.lang.String getCacheFileName()
public void cacheOff()
public boolean getDatabaseList(java.lang.String wild)
public boolean getTableList(java.lang.String wild)
public boolean getColumnList(java.lang.String table, java.lang.String wild)
public boolean sendQuery(java.lang.String query)
public boolean sendQuery(java.lang.String query, int length)
public boolean sendFileQuery(java.lang.String path, java.lang.String filename)
public void prepareQuery(java.lang.String query)
public void prepareQuery(java.lang.String query, int length)
public boolean prepareFileQuery(java.lang.String path, java.lang.String filename)
public void clearBinds()
public void substitution(java.lang.String variable, java.lang.String value)
public void substitution(java.lang.String variable, long value)
public void substitution(java.lang.String variable, double value, int precision, int scale)
public short countBindVariables()
public void inputBind(java.lang.String variable, java.lang.String value)
public void inputBind(java.lang.String variable, java.lang.String value, int length)
public void inputBind(java.lang.String variable, long value)
public void inputBind(java.lang.String variable, double value, int precision, int scale)
public void inputBindBlob(java.lang.String variable, byte[] value, long size)
public void inputBindClob(java.lang.String variable, java.lang.String value, long size)
public void defineOutputBindString(java.lang.String variable, int bufferlength)
public void defineOutputBindInteger(java.lang.String variable)
public void defineOutputBindDouble(java.lang.String variable)
public void defineOutputBindBlob(java.lang.String variable)
public void defineOutputBindClob(java.lang.String variable)
public void defineOutputBindCursor(java.lang.String variable)
public void substitutions(java.lang.String[] variables, java.lang.String[] values)
public void substitutions(java.lang.String[] variables, long[] values)
public void substitutions(java.lang.String[] variables, double[] values, int[] precisions, int[] scales)
public void inputBinds(java.lang.String[] variables, java.lang.String[] values)
public void inputBinds(java.lang.String[] variables, long[] values)
public void inputBinds(java.lang.String[] variables, double[] values, int[] precisions, int[] scales)
public void validateBinds()
public boolean validBind(java.lang.String variable)
public boolean executeQuery()
public boolean fetchFromBindCursor()
public java.lang.String getOutputBindString(java.lang.String variable)
public byte[] getOutputBindBlob(java.lang.String variable)
public java.lang.String getOutputBindClob(java.lang.String variable)
public byte[] getOutputBindAsByteArray(java.lang.String variable)
public long getOutputBindInteger(java.lang.String variable)
public double getOutputBindDouble(java.lang.String variable)
public long getOutputBindLength(java.lang.String variable)
public SQLRCursor getOutputBindCursor(java.lang.String variable)
public boolean openCachedResultSet(java.lang.String filename)
public int colCount()
public long rowCount()
public long totalRows()
public long affectedRows()
public long firstRowIndex()
public boolean endOfResultSet()
public java.lang.String errorMessage()
public long errorNumber()
public void getNullsAsEmptyStrings()
public void getNullsAsNulls()
public java.lang.String getField(long row, int col)
public java.lang.String getField(long row, java.lang.String col)
public long getFieldAsInteger(long row, int col)
public long getFieldAsInteger(long row, java.lang.String col)
public double getFieldAsDouble(long row, int col)
public double getFieldAsDouble(long row, java.lang.String col)
public byte[] getFieldAsByteArray(long row, int col)
public byte[] getFieldAsByteArray(long row, java.lang.String col)
public long getFieldLength(long row, int col)
public long getFieldLength(long row, java.lang.String col)
public java.lang.String[] getRow(long row)
public long[] getRowLengths(long row)
public java.lang.String[] getColumnNames()
public java.lang.String getColumnName(int col)
public java.lang.String getColumnType(int col)
public java.lang.String getColumnType(java.lang.String col)
public long getColumnPrecision(int col)
public long getColumnPrecision(java.lang.String col)
public long getColumnScale(int col)
public long getColumnScale(java.lang.String col)
public boolean getColumnIsNullable(int col)
public boolean getColumnIsNullable(java.lang.String col)
public boolean getColumnIsPrimaryKey(int col)
public boolean getColumnIsPrimaryKey(java.lang.String col)
public boolean getColumnIsUnique(int col)
public boolean getColumnIsUnique(java.lang.String col)
public boolean getColumnIsPartOfKey(int col)
public boolean getColumnIsPartOfKey(java.lang.String col)
public boolean getColumnIsUnsigned(int col)
public boolean getColumnIsUnsigned(java.lang.String col)
public boolean getColumnIsZeroFilled(int col)
public boolean getColumnIsZeroFilled(java.lang.String col)
public boolean getColumnIsBinary(int col)
public boolean getColumnIsBinary(java.lang.String col)
public boolean getColumnIsAutoIncrement(int col)
public boolean getColumnIsAutoIncrement(java.lang.String col)
public int getColumnLength(int col)
public int getColumnLength(java.lang.String col)
public int getLongest(int col)
public int getLongest(java.lang.String col)
public void suspendResultSet()
public short getResultSetId()
public boolean resumeResultSet(short id)
public boolean resumeCachedResultSet(short id, java.lang.String filename)
public void closeResultSet()