mxODBC

mxODBC - Python ODBC Database Interface

mxODBC is the eGenix flagship product for connecting Python to all major databases, on all major platforms, using a Python DB-API 2.0 standard compatible interface.
Version: 3.0.4

Introduction

mxODBC provides an easy to use, high-performance, reliable and robust Python interface to ODBC compatible databases such as MS SQL Server and MS Access, Oracle Database, IBM DB2 and Informix , Sybase ASE and Sybase Anywhere, MySQL, PostgreSQL, SAP MaxDB and many more. It is an extension to our eGenix.com mx Base Distribution.

ODBC refers to Open Database Connectivity and is the industry standard API for connecting applications to databases. In order to facilitate setting up ODBC connectivity, operating systems typically provide ODBC Managers which help set up the ODBC drivers and manage the binding of the applications against these drivers. On Windows and Mac OS X the ODBC Manager is built into the system. On Unix platforms, there are two ODBC managers, unixODBC and iODBC, which provide the same functionality on most Unix systems.

Databases usually ship with ODBC drivers for Windows, so it's easy to get Python connected to a database on Windows. On Linux and Mac OS X, the situation is not as bright, but getting a lot better with the growing popularity of these platforms. If you have trouble finding a database driver for your platform, have a look at mxODBC Connect, which eliminates the need to have an ODBC driver for the client side of the application, or try the ODBC vendor list on SQLSummit.com.

If you are looking for a client-server oriented database connectivity solution for Python, you may be interested in our mxODBC Connect product. This specializes on remote database connections such as the ones you typically find in web-applications, e.g. where a Linux machine cluster needs to communicate with a database running on a Windows server.

Features

  • Python Database API 2.0 Compliance: the mxODBC API is fully Python DB-API 2.0 compatible and implements a large number of powerful extensions.
  • Support for all recent ODBC Version : mxODBC works with ODBC drivers implementing the ODBC version specifications 2.0 - 3.52.
  • Uses ODBC 3 APIs: provided the ODBC driver is capable of using ODBC 3 APIs, mxODBC will use them for added efficiency.
  • 32-bit and 64-bit ODBC: mxODBC supports both 32-bit and 64-bit versions of the ODBC standard - including special 64-bit builds on Unix.
  • Stable, robust and reliable:the mxODBC API has been in active production use for more than 10 years.
  • ODBC Catalog & Introspection Functions: mxODBC Client API provides methods e.g. to list tables, find column specifications, query index relationships, etc.
  • Dynamic ODBC Configuration: adjust ODBC connection parameters dynamically, e.g. set timeouts, read-only access, auto-commit, etc.
  • Full Unicode Support: use Unicode for managing text data in your client applications - even if the database does not natively support Unicode, mxODBC will automatically provide the necessary conversions on-the-fly.
  • Configurable Data Type Mappings:
    • Supports Python type binding and Database type binding for efficient data exchange.
    • Supports mxDateTime and Python's time and datetime modules for date/time value exchange.
    • Supports standard Python floats, integers, longs and Python's decimal module for loss-less numeric value exchange.
    • Automatically handles and supports unknown data types and user data types via string conversion.
  • Full Python Support: mxODBC works with Python 2.3, 2.4, 2.5 and 2.6 on 32-bit and 64-bit platforms.
  • Highly Portable Codebase: in addition to the already supported platforms for mxODBC, we provide custom porting services for more exotic platforms.
  • Easy installation: using Windows installers or our Python distutils compatible prebuilt Python packages.
  • Easy configuration: use ODBC manager GUI tools for easy configuration of ODBC data sources, then access these data sources by name from Python.

System Requirements

The eGenix mxODBC distribution includes the mxODBC package needed to connect Python to an ODBC manager. However, it does not include an ODBC manager or any ODBC drivers. You have to have these installed in order to be able to use mxODBC with Python.

Windows:

On Windows, the situation is very simple: most databases come with ODBC drivers and register them with the Windows ODBC manager that's part of every Windows system.

Please consult the ODBC driver documentation for details on how to setup ODBC data sources. The mxODBC User Manual also includes a section on this topic and some helpful hints in case you run into problems.

Linux, FreeBSD, Solaris, AIX:

On Unix, you will have to install one of the popular ODBC managers iODBC or unixODBC and then register the ODBC drivers for your database with these ODBC managers.

Linux systems usually come with at least one of these ODBC managers preinstalled. Please see the mxODBC User Manual for setup instructions.

Mac OS X:

On Mac OS X, you can use the system system ODBC manager (which is a version of the popular iODBC manager).

Please see the mxODBC User Manual for setup instructions.

Licensing

The eGenix.com mxODBC Distribution is a commercial product and made available under the terms and conditions of the eGenix.com Commercial License Agreement, Version 1.2.0 (PDF file).

When purchasing a license for the mxODBC product, you will receive a digitally signed Proof of Authorization together with a license file authorizing you to install the product for use on one machine.

If you are installing the product on a shared server which is accessible over a network, then you have to purchase a separate license for each machine that can access the installation via this server.

Evaluation

If you would like to evaluate the eGenix.com mxODBC Distribution, please request an evaluation license or send an email to the eGenix.com Sales Team and include the following information: name of the licensee, number of evaluation licenses.

We will then send you the requested number of evaluation licenses. The evaluation licenses have a built-in timeout of 30 days, but are otherwise fully functional.

If you are satisfied with the product, you can then proceed to the next section.

Buy Licenses

Production licenses for the mxODBC product can be bought via our eGenix.com Online Shop. Licenses are sold per CPU installation and enable a single installation of mxODBC each.

For prices and volume discounts please check the mxODBC CPU License Shop Page.

We also offer site and corporate licenses. Please write to sales@egenix.com for quotes on these.

After purchase, you will receive the necessary license files from eGenix.com within two business by email to the shipping address you specified in the ordering process.

If you need to buy licenses for third parties (e.g. as contractor or reseller), please consult sales@egenix.com for instructions.

If you have questions about the ordering process, or the needed number of licenses, please write to the eGenix.com Sales Team.

Developer Licenses

For developers who want to integrate mxODBC into an application or product, we offer a Developer CPU license which allows royalty-free redistribution of mxODBC as part of products built on the Developer CPU.

Developer licenses for the mxODBC product can be bought via our eGenix.com Online Shop. Licenses are sold per developer CPU installation. Please note that in order to benefit from the redistribution terms in that license, you will have to purchase a separate license for each Developer CPU used by the developers in the process of developing the product.

For prices please check the mxODBC Developer CPU License Shop Page. Volume discounts are available on request. Please contact the eGenix.com Sales Team for quotes.

Alternative Redistribution Forms

If you want to redistribute mxODBC as part of a product on a per-CPU basis (rather than on a per-developer basis), you can do so by purchasing separate CPU licenses for each of your customers. For larger volumes we also have a special reseller agreement to simplify the process. Please write to the eGenix.com Sales Team for instructions and more information.

Documentation

The following documentation is available for mxODBC:

mxODBC User Manual and Reference Guide - HTML and PDF

The manual includes an installation guide, a discussion of the design principles behind mxODBC, as well as a reference of the available programming interfaces.

The PDF file is also available as part of the installation and can be found in the mx/ODBC/Doc/ folder.

Books

"Python Programming On Win32" by Mark Hammond, Andy Robinson has a section on mxODBC and mxDateTime.

Download

A successful installation of mxODBC requires these three steps:

  1. Before continuing with the download of mxODBC, first make sure that you have installed the eGenix.com mx Base Distribution, since the eGenix.com mxODBC Distribution is an add-on to our base set of Python extensions.
  2. The downloads below do not contain any license keys. You will either have to obtain evaluation licenses or buy production licenses in order to successfully install and use the package.
  3. Select the right download for your platform and Python version and then head on to the installation instructions below.
IMPORTANT:
By downloading, installing or using the eGenix mxODBC Distribution, you agree to the terms and conditions set forth in the eGenix.com Commercial License Agreement 1.2.0.

Redistribution of these files is not allowed. Please contact the eGenix Sales Team for details about redistribution possibilities and terms.

Windows (x86 - 32-bit):

Please always download the correct installer for your Python version, otherwise you won't be able to install the packages.

For instructions on how to install the prebuilt distributions, please see the installation section below.

The Windows ODBC manager which comes with the Windows Operating System will be used by this distribution.

Linux (i686 - 32-bit):

For instructions on how to install these prebuilt distributions, please see the installation section below.

You will need to have one of popular ODBC managers for Unix installed on the target system: iODBC 3.52.x or unixODBC 2.2.x. We have successfully tested the product with iODBC 3.52.6 and unixODBC 2.2.12.

Linux (x86_64 - 64-bit):

For instructions on how to install these prebuilt distributions, please see the installation section below.

You will need to have one of popular ODBC managers for Unix installed on the target system: iODBC 3.52.x or unixODBC 2.2.x. We have successfully tested the product with iODBC 3.52.6 and unixODBC 2.2.12.

Mac OS X (PPC + Intel - Universal Binaries):

You will need the UCS2 version of the distribution if you plan to use it with the Python version shipped with Mac OS X.

Note: Even though the files for Python 2.3 and 2.4 are named "...Power_Macintosh..." or "...ppc...", they still contain universal binaries. The name is due to a bug in distutils for Python 2.3 and 2.4.

For instructions on how to install these prebuilt distributions, please see the installation section below.

Mac OS X ships with the iODBC ODBC manager as system default ODBC manager. Please configure your data sources using the system ODBC manager.

Solaris (UltraSparc - 32-bit):

Note: The Solaris downloads have not yet been updated to 3.0.4 or Python 2.6. They still point to the 3.0.1 version of eGenix mxODBC.

For instructions on how to install these prebuilt distributions, please see the installation section below.

You will need to have one of popular ODBC managers for Unix installed on the target system: iODBC 3.52.x or unixODBC 2.2.x. We have successfully tested the product with iODBC 3.52.6 and unixODBC 2.2.12.

AIX 5.3 (IBM Series p or Series i, POWER5 processor - 32-bit):

Note: The AIX downloads have not yet been updated to 3.0.4 or Python 2.6. They still point to the 3.0.1 version of eGenix mxODBC.

For instructions on how to install these prebuilt distributions, please see the installation section below.

You will need to have one of popular ODBC managers for Unix installed on the target system: iODBC 3.52.x or unixODBC 2.2.x. We have successfully tested the product with iODBC 3.52.6 and unixODBC 2.2.12.

FreeBSD (i386 - 32-bit):

For instructions on how to install these prebuilt distributions, please see the installation section below.

You will need to have one of popular ODBC managers for Unix installed on the target system: iODBC 3.52.x or unixODBC 2.2.x. We have successfully tested the product with iODBC 3.52.6 and unixODBC 2.2.12.

FreeBSD (amd64 - 64-bit):

For instructions on how to install these prebuilt distributions, please see the installation section below.

You will need to have one of popular ODBC managers for Unix installed on the target system: iODBC 3.52.x or unixODBC 2.2.x. We have successfully tested the product with iODBC 3.52.6 and unixODBC 2.2.12.

Source Code:

mxODBC is a commercial product for which we do not make the source code available.

Other Platforms:

If you need distribution archives for platforms not mentioned here, please contact support@egenix.com for details. It is very likely that we can find a way to help you.

Python Unicode Version (UCS2 vs. UCS4)

On Unix it is important to know whether you need to download a distribution for a narrow Unicode build of Python (UCS2) or a wide version (UCS4).

Most Unixes ship with wide Python builds these days (including RedHat and SuSE). In order to make sure, please run the following command which will tell you what kind of Python installation you have:

python -c "import sys;print(sys.maxunicode<66000)and'UCS2'or'UCS4'"

If you get errors such as "unresolved symbol PyUnicodeUCS2_AsEncodedString" when trying to load an extension from the distribution, you have likely installed an archive for a wrong Unicode version.

Installation

Windows Installer

Installation using the Windows installers is straight forward: just double-click on the installer EXE or MSI file and follow the instructions.

Both installers register the distribution with the Windows software registry, so you can easily uninstall the distribution should you require to do so.

With the new MSI installer you also have the option to run the installer without the GUI or to integrate it into an automatic installation process. Please see the MSI installer documentation on the Python web-site for details.

To uninstall the distribution, please use the standard Windows software registry.

Prebuilt Distribution Installation

To reduce the number of binaries that we have to create for each release, we have adapted a new generic distribution format that works on all Python platforms: the Prebuilt Distribution Format.

Technically, this format is a standard Python distutils distribution, but with only the build/ directory and without the source tree.

System-wide Installation

In order to install such a distribution, please follow these instructions:

  1. Download and unzip the archive into a temporary directory
  2. Change into the distribution directory
  3. Run the following command using the Python interpreter with which you intend to work (this could be the default one, or an application specific one depending on your needs):
    sudo python setup.py install
    On Windows and some other platforms that don't have sudo, please run the above without sudo as administrator or root.

The distribution will then be installed into the standard directory for Python extensions of your Python installation (usually the site-packages/ subdirectory of the Python standard library directory).

To uninstall, follow the same steps as above, but use the command uninstall instead:

sudo python setup.py uninstall

User Installation

You will need to be able to sudo on the target machine or know the root password for the above to work. If you don't have permission to install packages as root, you can still install the distribution into a local directory, e.g. ~/lib/python by using the following installation command:

python setup.py install --home=/home/user/

This will install the distribution into the directory /home/user/lib/python/. In order to have Python see this directory and make it useable for import, you have to adjust the PYTHONPATH environment variable to include this directory, e.g.

export PYTHONPATH /home/user/lib/python 

To see all the possible installation options, run the install script using the help options:

python setup.py install --help

To uninstall, follow the same steps as above, but use the command uninstall instead:

sudo python setup.py uninstall --home=/home/user/

Support

eGenix offers these support options:

Commercial Support

Professional level support for this product as well as all other eGenix products and Python itself is available directly from the developers at eGenix.com.

Consulting

eGenix.com offers professional consulting services for all questions and tasks around this product, including customized modifications, help with integration and on-site problem solving. Please contact sales@egenix.com for details.

Free User Support

In order for our users to keep in touch and be able to help themselves, we have created the egenix-users user mailing list.

References

mxODBC is in production use by several Fortune-100 companies, including Intel, IBM and Royal Bank of Scotland, and many other "smaller" companies like e.g. Google.

Several of these have integrated mxODBC into their products. The most well-known of these is probably the UltraSeek search engine.

Please see the mxODBC References & Quotes page for more details or write to sales@egenix.com for more information.

History & Changes

Please see the change log for details regarding changes to the package between releases.