MxODBC provides an easy to use, high-performance, reliable and robust interface to ODBC compatible databases such as, and, and, and many more. It is an extension to our open-source. ODBC refers to 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 the is built into the system.
On Mac OS X, the is part of the OS, with an optional available as separate download. On Unix platforms, you can choose one of the ODBC managers, or, which provide the same ODBC 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.
If you are working on Linux and Mac OS X, you can typically download drivers from the database vendor. If you have trouble finding a database driver for your platform, try the , or have a look at our mxODBC Connect product: If you are looking for a platform independent remote database connectivity solution for Python, you may be interested in our product, which eliminates the need to have an ODBC driver for the client side of the application. It specializes on remote database connections such as the ones you typically find in web-applications, e.g. Where multiple Linux servers need to communicate with a company database running on a Windows server. Python Database API 2.0 Compliance: the mxODBC API is fully compatible and implements a large number of powerful extensions.
Support for all recent ODBC Versions: mxODBC works with ODBC drivers implementing the ODBC version specifications 2.0 - 3.8. 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 on all supported platforms. Support for all popular ODBC Drivers: mxODBC includes adjustments and work-arounds to support MS SQL Server Native Client (both on Windows and Linux), MS SQL Server Native Client ODBC Driver, FreeTDS ODBC Driver, Oracle Instant Client ODBC Driver, IBM DB2 ODBC Driver, Sybase ASE ODBC Driver, Netezza ODBC Driver, Teradata ODBC Driver, PostgreSQL ODBC Driver, MySQL ODBC Driver, MariaDB ODBC Driver, MaxDB ODBC Driver as well as the ODBC driver sets of EasySoft, DataDirect, OpenLink, Actual Technologies. Support for all popular ODBC Driver Managers: mxODBC comes with subpackages for the native Windows and Mac OS X ODBC managers, as well as the ODBC managers, and, which are commonly used on Unix systems.
Stable, robust and reliable: the mxODBC API has been in active production use for more than 15 years. African latin independence day. ODBC Catalog & Introspection Functions: mxODBC Client API provides methods e.g. To list tables, find column specifications, query index relationships, etc. Stored Procedure / Function Calls: directly call stored procedures and functions, using output and input/output parameters, as well as result sets for passing back data to Python. This gives you full access to your database systems from Python, without any need to adapt database APIs. Support for Input, Ouput and In/Out Parameters: you can freely use these parameter types in stored procedure calls, functions calls and regular SQL statement execution, allowing you to tap into all the flexibility your databases have to offer. Support for Multiple Result Sets: call stored procedures and access all returned result sets using an easy to API.
Easily free up resources in case result sets are no longer needed. Support for custom Row objects: in addition to using standard Python tuples, mxODBC can automatically return result set rows as custom objects. MxODBC comes with a set of optimized row factories for: TupleRows, ListRows and NamespaceRows. All of these provide both index and attribute access to row column fields - much like namedtuples in Python. Support for ODBC direct execution: have mxODBC send the queries and parameters directly to the database server instead of letting the ODBC driver parse them on the client.
This can in some cases result in much better performance and provide more feature richness for your applications. Support for all ODBC Transaction Isolation Levels: use mxODBC to adjust the to meet your needs and requirements, optimizing database access the way you need it.
Dynamic ODBC Configuration: adjust ODBC connection parameters dynamically, e.g. Set timeouts, read-only access, auto-commit, etc. ODBC and Oracle style parameters: mxODBC can be used with both the standard question mark ODBC style parameter syntax (e.g. ) as well as with the Oracle style named parameters (e.g. Where id=:id'). More useful DB-API Extensions:.
Adjustable.paramstyle: adjust the parameter style on connections and cursor as needed. cursor.scroll to scroll the cursor in result sets without actually fetching data. cursor.prepare to prepare SQL statements for execution, without actually running them.
This allows creating pools of cursors for dedicated purposes, checking for syntax errors or moving data access plan calculations outside inner loops. connection.autocommit to easily turn on/off the ODBC auto-commit feature. connection.dbapi to have the right module level mxODBC objects readily available without having to import them separately. cursor and connection objects usable as Python context managers.
cursor.executemany accepts iterators/generators as parameter 'sequence'. cursor.cursortype to easily adjust the used ODBC cursor type to your application's needs. ODBC cursor/connection option methods to adjust ODBC cursors/connections to your application's needs and optimize performance by e.g. Declaring a connection read-only. Configurable Data Type Mappings:. Supports Python type binding and database SQL type binding for efficient data exchange.
Supports 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. Supports Python 2.7 memoryview objects. Automatically handles and supports unknown data types and user data types via string conversion. 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. Multi-Version Python Support: mxODBC works with Python 2.4, 2.5, 2.6 and 2.7.
Full 64-bit Support: mxODBC runs on the following 64-bit platforms natively: Windows, Linux, FreeBSD and Mac OS X. Highly Portable Codebase: in addition to the already supported platforms for mxODBC, we provide for more exotic platforms. Easy installation: using pip/easyinstall/zc.buildout and our web installer from, or using our Windows installers, Python distutils compatible prebuilt Python packages or setuptools/zc.buildout/pip compatible egg packages. Easy configuration: use ODBC manager GUI tools for easy configuration of ODBC data sources, then access these data sources by name from Python. Commercially support available: eGenix provides, so you can be sure that your questions and issues will be addressed promptly. 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 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 or 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 pre-installed.
Please see the for setup instructions. It is also possible to use the ODBC manager on Linux systems, if needed, or recommended by your database vendor. Mac OS X: On Mac OS X, you can use the system system ODBC manager (which is a version of the popular manager).
Please see the for setup instructions. Other systems: On other systems, you can use our to connect to your databases from Python. Unlike mxODBC, the mxODBC Connect product does not need ODBC drivers on the client side. Only the server needs an ODBC driver installed and this is typically run directly on the database server, giving you much better performance and more stability for your applications. The eGenix.com mxODBC Distribution is a commercial product and made available under the terms and conditions of the (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 and use the product.
If you would like to evaluate the eGenix.com mxODBC Distribution, please request an or send an email to the and include the following information: name of the licensee, number of evaluation licenses. We will then send you the requested number of evaluation licenses for the mxODBC Professional Edition.
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. Production licenses for the mxODBC product can be bought via our. Licenses are sold per Python installation.
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. For prices and volume discounts please check the. We also offer site and corporate licenses.
Please write to 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 for instructions. If you have questions about the ordering process, or the needed number of licenses, please write to the.
MxODBC licenses are available in different editions to meet your specific needs. The edition features are enabled via the license files that you receive after purchase. The download packages are the same for all editions. The allows installation of mxODBC for use in one Python installation. There is no limitation on the database backend, the number of open connections per process, or the platform - you can benefit from the full mxODBC functionality on all supported platforms. This edition is ideal for users in professional settings and in situations where the number of connections should not be limited, e.g.
In a web server environment. If you are intending to upgrade from an existing mxODBC license to the new mxODBC 3.3, please contact the with your existing license serials for details for an upgrade discount coupon. We will give out 20% discount coupons for upgrade purchases going from mxODBC 2.x to 3.3 and 50% coupons for upgrades from mxODBC 3.x to 3.3.
After upgrade, use of the original license from which you upgraded is no longer permitted. For developers who want to integrate mxODBC into an application or product, we offer a which allows royalty-free redistribution of mxODBC as part of a product built by a developer. Developer licenses for the mxODBC product can be bought via our. Licenses are sold per developer and product, e.g. If you have one developer working on two products integrating mxODBC, you will need to purchase two licenses. If you have three developers working on one product, you will need to purchase three licenses in order to benefit from the royalty-free distribution right. For prices please check the.
Volume discounts are available on request. Please contact the for quotes. If you are looking for upgrades to your existing mxODBC Developer CPU Licenses or mxODBC Product Development Edition Licenses, we will provide you with upgrade coupons. Please contact with your existing license serials for details for an upgrade discount coupon. We will give out 20% discount coupons for upgrade purchases going from mxODBC 2.x to 3.3 and 50% coupons for upgrades from mxODBC 3.x to 3.3. After upgrade, use of the original license from which you upgraded is no longer permitted. Please note that we have changed the licensing scheme for mxODBC development licenses to a per-developer and product based one in 3.1 and later, to better meet our customer's requirements.
If you have questions, please contact the. Alternative Redistribution Forms If you want to redistribute mxODBC as part of a product on a per-installation basis (rather than on a per developer and product basis), you can do so by purchasing standard or professional edition licenses in bulk and then redistribute these to your customers. For larger volumes we also have a special reseller agreement to simplify the process. Please write to the for instructions and more information.
The following documentation is available for mxODBC: - and The manual includes a comprehensive installation guide, a discussion of the design principles behind mxODBC, as well as a reference of the available programming interfaces. With over 200 pages it provides a very detailed overview of the many professional features in mxODBC. 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.
A successful installation of mxODBC requires these three steps:. Before continuing with the download of mxODBC, first make sure that you have installed the (version 3.2 or later), since the eGenix.com mxODBC Distribution is an add-on to our base set of Python extensions. The downloads below do not contain any license keys. You will either have to obtain or in order to successfully install and use the package. Select the right download for your platform and Python version and then head on to the below. 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.4 are named '.ppc.'
, they still contain universal binaries. The name is due to a bug in distutils for Python 2.4. For instructions on how to install these prebuilt distributions, please see the. Mac OS X ships with the iODBC ODBC manager as system default ODBC manager. Please configure your data sources using the system ODBC manager.
If you instead want to use the unixODBC manager from, you additionally have to add the ports lib dir to DYLDLIBRARYPATH, e.g. Using export DYLDLIBRARYPATH=/opt/local/lib Mac OS X (Intel - 64-bit). You will need the UCS2 version of the distribution if you plan to use it with the Python version shipped with Mac OS X. For instructions on how to install these prebuilt distributions, please see the. Mac OS X ships with the iODBC ODBC manager as system default ODBC manager. Please configure your data sources using the system ODBC manager. If you instead want to use the unixODBC manager from, you additionally have to add the ports lib dir to DYLDLIBRARYPATH, e.g.
Using export DYLDLIBRARYPATH=/opt/local/lib FreeBSD (i386 - 32-bit). If you need distribution archives for platforms not mentioned here, please contact 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.