Installation guide

6. mxODBC Connection Objects
6. mxODBC Connection Objects
Connection objects provide the communication link between your Python
application and the database. They are also the scope of transactions you perform.
Each connection can be setup to your specific needs, multiple connections may be
opened at the same time.
6.1 Subpackage Support
Connection objects are supported by all subpackages included in mxODBC.
The extent to which the functionality and number of methods is supported may
differ from subpackage to subpackage, so you have to verify the functionality of
the used methods (esp. the catalog methods) for each subpackage and database
that you intend to use.
6.2 Connection Type Object
mxODBC uses a dedicated object type for connections. Each mxODBC
subpackage defines its own object type, but all share the same name:
ConnectionType.
6.3 Connection Object Constructors
Connect(dsn, user='', password='', clear_auto_commit=1,
errorhandler=None, connection_options=())
This constructor returns a connection object for the given data source. It
accepts keyword arguments.
dsn indicates the data source to be used, user
and
password are optional and used for database login.
errorhandler may be given to set the error handler for the Connection object
prior to actually connecting to the database. This is useful to mask e.g. certain
warnings which can occur at connection time. The
errorhandler can be
changed after the connection has been established by assigning to the
.errorhandler attribute of the Connection object. The default error handler
raises exceptions for all database warnings and errors. See section 10.4 Error
Handlers for more details on how to use error handlers.
87