Installation guide
mxODBC - Python ODBC Database Interface
.__enter__()
Returns the connection itself. This method makes connection objects usable as
context manager (together with the .__exit__() method) and is called when
entering a with-block (new in Python 2.5).
.__exit__(exc_type, exc_value, exc_tb)
Returns True in case exc_type is set to None (no exception set) and commits
the current transaction. Returns False in case
exc_type is set to an exception
and rolls back the current transaction. This method is part of the context
manager API and is called when leaving a with-block (new in Python 2.5).
6.8 Connection Object Attributes
.autocommit
Writeable attribute to query and set the auto-commit status of the connection.
Returns
True if the connection is operating in auto commit (non-transactional)
mode. Returns
False is the connection is operating in manual commit
(transactional) mode.
Setting the attribute to
True or False adjusts the connection's mode
accordingly.
This attribute is a shortcut to using
connection.setconnectoption(SQL.AUTO_COMMIT, value) and can raise
the same exceptions, e.g. in case of a closed connection.
.bindmethod
Attribute to query and set the input variable binding method used by the
connection. This can either be
BIND_USING_PYTHONTYPE of
BIND_USING_SQLTYPE (see the Constants section 10.5 for details).
The attribute is inherited by cursors created on the connection at creation
time. Cursors may override the setting on a per cursor basis.
.closed
Read-only attribute that is true in case the connection is closed. Any action on
a closed connection will result in a
ProgrammingError to be raised. This
variable can be used to conveniently test for this state.
.converter
Read/write attribute that sets the converter callback default for all newly
created cursors using the connection. It is
None per default (meaning to use
the standard conversion mechanism). See the Supported Data Types
section for
details.
94