public class PyCursor extends PyObject implements ClassDictInit, WarningListener, ContextManager
PyObject.ConversionException
Modifier and Type | Method and Description |
---|---|
void |
__del__()
Delete the cursor.
|
PyObject |
__enter__() |
PyObject |
__enter__(ThreadState ts) |
boolean |
__exit__(PyObject type,
PyObject value,
PyObject traceback) |
boolean |
__exit__(ThreadState ts,
PyException exception) |
PyObject |
__findattr_ex__(String name)
Gets the value of the attribute name.
|
PyObject |
__iter__()
Returns an iteratable object.
|
PyObject |
__iternext__()
Return the next element of the sequence that this is an iterator
for.
|
void |
__setattr__(String name,
PyObject value)
Sets the attribute name to value.
|
void |
callproc(PyObject name,
PyObject params,
PyObject bindings,
PyObject maxRows)
This method is optional since not all databases provide stored procedures.
|
static void |
classDictInit(PyObject dict)
Initializes the object's namespace.
|
void |
close()
Close the cursor now (rather than whenever __del__ is called).
|
void |
execute(PyObject sql,
PyObject params,
PyObject bindings,
PyObject maxRows)
Prepare and execute a database operation (query or command).
|
void |
executemany(PyObject sql,
PyObject params,
PyObject bindings,
PyObject maxRows)
Prepare a database operation (query or command) and then execute it against all
parameter sequences or mappings found in the sequence seq_of_parameters.
|
PyObject |
fetchall()
Fetch all (remaining) rows of a query result, returning them as a sequence
of sequences (e.g. a list of tuples).
|
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.
|
DataHandler |
getDataHandler()
Return the currently bound DataHandler.
|
static boolean |
hasParams(PyObject params)
Method hasParams
|
static boolean |
isSeq(PyObject object)
Method isSeq
|
static boolean |
isSeqSeq(PyObject object)
Method isSeqSeq
|
PyObject |
next()
Returns the next row from the currently executing SQL statement
using the same semantics as .fetchone().
|
PyObject |
nextset()
Move the result pointer to the next set if available.
|
PyStatement |
prepare(PyObject sql)
Prepare a sql statement for later execution.
|
void |
scroll(int value,
String mode)
Scroll the cursor in the result set to a new position according
to mode.
|
String |
toString()
String representation of the object.
|
void |
warning(WarningEvent event)
Adds a warning to the tuple and will follow the chain as necessary.
|
__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delattr__, __delete__, __delitem__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __eq__, __findattr__, __findattr__, __finditem__, __finditem__, __finditem__, __float__, __floordiv__, __ge__, __get__, __getattr__, __getattr__, __getitem__, __getitem__, __getnewargs__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __itruediv__, __ixor__, __le__, __len__, __long__, __lshift__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setitem__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __truediv__, __unicode__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _xor, asDouble, asIndex, asIndex, asInt, asInt, asIterable, asLong, asLong, asName, asName, asString, asString, asStringOrNull, asStringOrNull, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, getDict, getType, hashCode, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isMappingType, isNumberType, isSequenceType, noAttributeError, readonlyAttributeError, setDict, setType
public String toString()
public void __setattr__(String name, PyObject value)
__setattr__
in class PyObject
name
- value
- PyObject.__setattr__(PyString, PyObject)
public PyObject __findattr_ex__(String name)
__findattr_ex__
in class PyObject
name
- public static void classDictInit(PyObject dict)
dict
- public void __del__()
public void close()
public PyObject __iter__()
public PyObject next()
public PyObject __iternext__()
__iternext__
in class PyObject
public DataHandler getDataHandler()
public void callproc(PyObject name, PyObject params, PyObject bindings, PyObject maxRows)
name
- params
- bindings
- maxRows
- public void executemany(PyObject sql, PyObject params, PyObject bindings, PyObject maxRows)
sql
- params
- bindings
- maxRows
- public void execute(PyObject sql, PyObject params, PyObject bindings, PyObject maxRows)
sql
- sql string or prepared statementparams
- params for a prepared statementbindings
- dictionary of (param index : SQLType binding)maxRows
- integer value of max rowspublic PyObject fetchone()
public PyObject fetchall()
public PyObject fetchmany(int size)
size
- public PyObject nextset()
public PyStatement prepare(PyObject sql)
sql
- The sql string to be prepared.public void scroll(int value, String mode)
value
- mode
- public void warning(WarningEvent event)
warning
in interface WarningListener
event
- public static boolean isSeq(PyObject object)
object
- public static boolean hasParams(PyObject params)
params
- public static boolean isSeqSeq(PyObject object)
object
- public PyObject __enter__(ThreadState ts)
__enter__
in interface ContextManager
public PyObject __enter__()
public boolean __exit__(ThreadState ts, PyException exception)
__exit__
in interface ContextManager