|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ziclix.python.sql.Fetch
The responsibility of a Fetch instance is to manage the iteration of a ResultSet. Two different alogorithms are available: static or dynamic.
Static The static variety iterates the entire set immediately, creating the necessary Jython objects and storing them. It is able to immediately close the ResultSet so a call to close() is essentially a no-op from a database resource perspective (it does clear the results list however). This approach also allows for the correct rowcount to be determined since the entire result set has been iterated.
Dynamic The dynamic variety iterates the result set only as requested. This holds a bit truer to the intent of the API as the fetch*() methods actually fetch when instructed. This is especially useful for managing exeedingly large results, but is unable to determine the rowcount without having worked through the entire result set. The other disadvantage is the ResultSet remains open throughout the entire iteration. So the tradeoff is in open database resources versus JVM resources since the application can keep constant space if it doesn't require the entire result set be presented as one.
Constructor Summary | |
Fetch(PyCursor cursor)
Constructor Fetch |
Method Summary | |
abstract void |
add(java.sql.CallableStatement callableStatement,
Procedure procedure,
PyObject params)
Method add |
abstract void |
add(java.sql.ResultSet resultSet)
Create the results after a successful execution and manages the result set. |
abstract void |
add(java.sql.ResultSet resultSet,
java.util.Set skipCols)
Create the results after a successful execution and manages the result set. |
abstract void |
close()
Cleanup any resources. |
abstract PyObject |
fetchall()
Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g. a list of tuples). |
abstract PyObject |
fetchmany(int size)
Fetch the next set of rows of a query result, returning a sequence of sequences (e.g. a list of tuples). |
PyObject |
fetchone()
Fetch the next row of a query result set, returning a single sequence, or None when no more data is available. |
PyObject |
getDescription()
Return the description of the result. |
int |
getRowCount()
Return the total row count. |
abstract PyObject |
nextset()
Move the result pointer to the next set if available. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Fetch(PyCursor cursor)
Method Detail |
public abstract void add(java.sql.ResultSet resultSet)
public abstract void add(java.sql.ResultSet resultSet, java.util.Set skipCols)
public abstract void add(java.sql.CallableStatement callableStatement, Procedure procedure, PyObject params)
public PyObject fetchone()
public abstract PyObject fetchall()
public abstract PyObject fetchmany(int size)
public abstract PyObject nextset()
public abstract void close() throws java.sql.SQLException
java.sql.SQLException
public int getRowCount()
public PyObject getDescription()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |