Top Description Fields Constructors Methods
com.ziclix.python.sql

pack-priv Class StaticFetch

Located in compilation unit of com.ziclix.python.sql.Fetch.

extends Fetch
Class Inheritance

This version of fetch builds the results statically. This consumes more resources but allows for efficient closing of database resources because the contents of the result set are immediately consumed. It also allows for an accurate rowcount attribute, whereas a dynamic query is unable to provide this information until all the results have been consumed.

Field Summary

Modifier and TypeField and Description
protected List<PyObject>
descriptions

Field descriptions

protected List<PyObject>
results

Field results

Inherited from com.ziclix.python.sql.Fetch:
descriptionrowcountrownumber

Constructor Summary

AccessConstructor and Description
public
StaticFetch(DataHandler datahandler)

Construct a static fetch.

Method Summary

Modifier and TypeMethod and Description
public void
add(ResultSet resultSet)

Implements abstract com.ziclix.python.sql.Fetch.add.

Method add

public void
add(ResultSet resultSet, Set<Integer> skipCols)

Implements abstract com.ziclix.python.sql.Fetch.add.

Method add

public void
add(CallableStatement callableStatement, Procedure procedure, PyObject params)

Implements abstract com.ziclix.python.sql.Fetch.add.

Method add

public void
close()

Overrides com.ziclix.python.sql.Fetch.close.

Remove the results.

public PyObject

Returns:

a sequence of sequences from the result set, or an empty sequence when no more data is available
fetchall
()

Implements abstract com.ziclix.python.sql.Fetch.fetchall.

Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g. a list of tuples).

public PyObject

Returns:

a sequence of sequences from the result set, or an empty sequence when no more data is available
fetchmany
(int size)

Implements abstract com.ziclix.python.sql.Fetch.fetchmany.

Fetch the next set of rows of a query result, returning a sequence of sequences (e.g. a list of tuples).

public PyObject

Returns:

true if more sets exist, else None
nextset
()

Implements abstract com.ziclix.python.sql.Fetch.nextset.

Move the result pointer to the next set if available.

public boolean
public void
scroll(int value, String
'relative' or 'absolute'
mode
)

Implements abstract com.ziclix.python.sql.Fetch.scroll.

Method scroll

public int
traverse(Visitproc visit, Object arg)

Overrides com.ziclix.python.sql.Fetch.traverse.

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from com.ziclix.python.sql.Fetch:
addWarningListenercreateDescriptioncreateDescriptioncreateResultcreateResultscreateResultsfetchonefireWarninggetDescriptiongetRowCountnewFetchremoveWarningListener

Field Detail

descriptionsback to summary
protected List<PyObject> descriptions

Field descriptions

resultsback to summary
protected List<PyObject> results

Field results

Constructor Detail

StaticFetchback to summary
public StaticFetch(DataHandler datahandler)

Construct a static fetch. The entire result set is iterated as it is added and the result set is immediately closed.

Method Detail

addback to summary
public void add(ResultSet resultSet)

Implements abstract com.ziclix.python.sql.Fetch.add.

Method add

Annotations
@Override
addback to summary
public void add(ResultSet resultSet, Set<Integer> skipCols)

Implements abstract com.ziclix.python.sql.Fetch.add.

Method add

Annotations
@Override
addback to summary
public void add(CallableStatement callableStatement, Procedure procedure, PyObject params)

Implements abstract com.ziclix.python.sql.Fetch.add.

Method add

Annotations
@Override
closeback to summary
public void close() throws SQLException

Overrides com.ziclix.python.sql.Fetch.close.

Remove the results.

Annotations
@Override
fetchallback to summary
public PyObject fetchall()

Implements abstract com.ziclix.python.sql.Fetch.fetchall.

Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g. a list of tuples). Note that the cursor's arraysize attribute can affect the performance of this operation.

An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet.

Returns:PyObject

a sequence of sequences from the result set, or an empty sequence when no more data is available

Annotations
@Override

fetchmanyback to summary
public PyObject fetchmany(int size)

Implements abstract com.ziclix.python.sql.Fetch.fetchmany.

Fetch the next set of rows of a query result, returning a sequence of sequences (e.g. a list of tuples). An empty sequence is returned when no more rows are available.

The number of rows to fetch per call is specified by the parameter. If it is not given, the cursor's arraysize determines the number of rows to be fetched. The method should try to fetch as many rows as indicated by the size parameter. If this is not possible due to the specified number of rows not being available, fewer rows may be returned.

An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet.

Note there are performance considerations involved with the size parameter. For optimal performance, it is usually best to use the arraysize attribute. If the size parameter is used, then it is best for it to retain the same value from one fetchmany() call to the next.

Returns:PyObject

a sequence of sequences from the result set, or an empty sequence when no more data is available

Annotations
@Override

nextsetback to summary
public PyObject nextset()

Implements abstract com.ziclix.python.sql.Fetch.nextset.

Move the result pointer to the next set if available.

Returns:PyObject

true if more sets exist, else None

Annotations
@Override

refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob) throws UnsupportedOperationException

Overrides com.ziclix.python.sql.Fetch.refersDirectlyTo.

Implements org.python.core.Traverseproc.refersDirectlyTo.

Doc from org.python.core.Traverseproc.refersDirectlyTo.

Optional operation. Should only be implemented if it is more efficient than calling traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.

scrollback to summary
public void scroll(int value, String mode)

Implements abstract com.ziclix.python.sql.Fetch.scroll.

Method scroll

Parameters
mode:String

'relative' or 'absolute'

Annotations
@Override
traverseback to summary
public int traverse(Visitproc visit, Object arg)

Overrides com.ziclix.python.sql.Fetch.traverse.

Implements org.python.core.Traverseproc.traverse.

Doc from org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc#visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc#visit(PyObject, Object) must not be called with a null PyObject-argument.