public class PyCursor extends PyObject implements ClassDictInit, WarningListener, ContextManager, Traverseproc
PyObject.ConversionException
Modifier and Type | Field and Description |
---|---|
protected static PyList |
__members__
Field __members__
|
protected static PyList |
__methods__
Field __methods__
|
protected int |
arraysize
Field arraysize
|
protected PyConnection |
connection
Field connection
|
protected DataHandler |
datahandler
Field datahandler
|
protected boolean |
dynamicFetch
Field dynamicFetch
|
protected Fetch |
fetch
Field fetch
|
protected PyObject |
lastrowid
Field warnings
|
protected PyObject |
rsConcur
Field rsConcur
|
protected PyObject |
rsType
Field rsType
|
protected int |
softspace
Field softspace
|
protected PyStatement |
statement
Field statement
|
protected PyObject |
updatecount
Field updatecount
|
protected PyObject |
warnings
Field warnings
|
attributes, gcMonitorGlobal, objtype, TYPE
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__(java.lang.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__(java.lang.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.
|
protected void |
clear()
Resets the cursor state.
|
void |
close()
Close the cursor now (rather than whenever __del__ is called).
|
protected void |
execute(PyObject params,
PyObject bindings)
Execute the current sql statement.
|
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.
|
PyObject |
fetchmany(int size)
Fetch the next set of rows of a query result, returning a sequence of
sequences (e.g.
|
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.
|
protected java.sql.DatabaseMetaData |
getMetaData()
Return ths DatabaseMetaData for the current connection.
|
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.
|
boolean |
refersDirectlyTo(PyObject ob)
Optional operation.
|
void |
scroll(int value,
java.lang.String mode)
Scroll the cursor in the result set to a new position according
to mode.
|
java.lang.String |
toString()
String representation of the object.
|
int |
traverse(Visitproc visit,
java.lang.Object arg)
Traverses all directly contained
PyObject s. |
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__, __ensure_finalizer__, __eq__, __findattr__, __findattr__, __finditem__, __finditem__, __finditem__, __float__, __floordiv__, __format__, __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__, __rawdir__, __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__, __trunc__, __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, _unsupportedop, _xor, adaptToCoerceTuple, asDouble, asIndex, asIndex, asInt, asInt, asIterable, asLong, asLong, asName, asName, asString, asString, asStringOrNull, asStringOrNull, bit_length, conjugate, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, finalize, getDict, getJavaProxy, getType, hashCode, impAttr, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isInteger, isMappingType, isNumberType, isSequenceType, mergeClassDict, mergeDictAttr, mergeListAttr, noAttributeError, object___subclasshook__, readonlyAttributeError, runsupportedopMessage, setDict, setType, unsupportedopMessage
protected Fetch fetch
protected int arraysize
protected int softspace
protected PyObject rsType
protected PyObject rsConcur
protected PyObject warnings
protected PyObject lastrowid
protected PyObject updatecount
protected boolean dynamicFetch
protected PyConnection connection
protected DataHandler datahandler
protected PyStatement statement
protected static PyList __methods__
protected static PyList __members__
public java.lang.String toString()
public void __setattr__(java.lang.String name, PyObject value)
__setattr__
in class PyObject
name
- value
- PyObject.__setattr__(PyString, PyObject)
public PyObject __findattr_ex__(java.lang.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
protected java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
java.sql.SQLException
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 rowsprotected void execute(PyObject params, PyObject bindings)
public 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, java.lang.String mode)
value
- mode
- public void warning(WarningEvent event)
warning
in interface WarningListener
event
- protected void clear()
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
public int traverse(Visitproc visit, java.lang.Object arg)
Traverseproc
PyObject
s.
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.traverse
in interface Traverseproc
public boolean refersDirectlyTo(PyObject ob)
Traverseproc
Traverseproc.traverse(Visitproc, Object)
with
a visitproc that just watches out for ob
.
Must return false
if ob
is null
.refersDirectlyTo
in interface Traverseproc