
132
|
Python Pocket Reference
Connection Objects
Connection objects respond to the following methods.
close()
Closes the connection now (rather than when __del__ is
called).
commit()
Commits any pending transactions to the database.
rollback()
Rolls database back to the start of any pending transac-
tion; closing a connection without committing the
changes first will cause an implicit rollback.
cursor()
Returns a new cursor object using the connection.
Cursor Objects
Cursor objects represent database cursors, used to manage
the context of a fetch operation.
description
Sequence of seven-item sequences; each contains infor-
mation describing one result column:
(name, type_code,
display_size, internal_size, precision, scale, null_
ok)
.
rowcount
Specifies the number of rows that the last execute* pro-
duced (for DQL statements like
select) or affected (for
DML statements like
update or insert).
callproc(procname [,parameters])
Calls a stored database procedure with the given name.
The sequence of parameters must contain one entry for
each argument that the procedure expects; result is
returned as a modified copy of the inputs.