Product Documentation

FairCom SQL for Python

Previous Topic

Next Topic

FairCom DB Python Installation

To install pyctree on your system:

  1. Run the following command from the Unix shell or the Windows command prompt from the <faircom>\drivers\python.sql directory:
    python setup.py install

    Note: On Linux/Unix, you may need to "sudo" or "su" first. On Windows, if you get a "Permission denied" error, please do the above from a CMD shell that has been run "as administrator".

  2. Place the ctsqlapi shared library (or DLL in Windows) in a place where the Python executable can load it (for example: LD_LIBRARY_PATH on some versions of Unix).

Notes:

  1. The FairCom pyctree interface (the Python DB API 2.0-compliant driver) is compatible with Python versions 2.6 and 3.x.
  2. Support for the following data types has not been implemented: BINARY, VARBINARY, LONGVARBINARY, LONGVARCHAR and UNICODE fields.
  3. The following features do not conform to the PEP 249 standard:

    Auto Commit - The autocommit read/write property of the Connection class allows the programmer to turn on/off the autocommit capability.

    Query Timeout - The querytimeout read/write attribute of the Cursor class can be set to 0 (default) to indicate no timeout or to a positive value to specify a query timeout in seconds.

  4. The provided FairCom DB SQL libraries are linked with OpenSSL support. Due to the link order of the libraries, some platforms may require specific run-time library pre-load instructions. For example, on some Linux distros:

    export LD_LIBRARY_PATH=../../ctree.drivers/lib

    LD_PRELOAD=/usr/lib/libssl.so python PY_tutorial2.py

Best practice dictates LD_PRELOAD should only specify full paths to your libssl.so library, which may reside in different locations on different Unix/Linux distros.

Unicode Support

The Python driver has been enhanced to detect the nature of the ctsqlapi library in use (Unicode vs non-Unicode) and consider this when calling into the library. The driver can now be used with a Unicode server as well as non-Unicode servers.

TOCIndex