The goal of the odbc package is to provide a DBI-compliant interfaceto OpenDatabase Connectivity (ODBC) drivers. This allows for an efficient,easy to setup connection to any database with ODBC drivers available,including SQLServer, Oracle, MySQL, PostgreSQL, SQLite and others. Theimplementation builds on the nanodbc C++ library.
Windows is bundled with ODBC libraries however drivers for eachdatabase need to be installed separately. Windows ODBC drivers typicallyinclude an installer that needs to be run and will install the driver tothe proper locations.
Open Database Connectivity (ODBC) provides an API for accessing databases. Database vendors provide ODBC drivers for their database products. An application written to the ODBC standard can be ported to other databases that also provide an ODBC interface.
When we tested pyodbc, Easysoft ODBC drivers passed all tests that the target database was capable of passing. For example, when we ran the pyodbc test suite against Oracle® Database XE, test_sqlserver_callproc failed because it uses SQL Server specific syntax to create and execute a stored procedure. If the test is modified to use SQL syntax that Oracle® supports, the test succeeds. For example:
Add Oracle 21, 19, 18, 12 or 11.2 client libraries to your operating systemlibrary search path such as PATH on Windows or LD_LIBRARY_PATH onLinux. On macOS use init_oracle_client() in yourapplication to pass the Oracle Client directory name, seeUsing cx_Oracle.init_oracle_client() to set the Oracle Client directory. This is also usable on Windows.
If you use optional Oracle configuration files such as tnsnames.ora,sqlnet.ora or oraaccess.xml with Instant Client, then put the filesin an accessible directory, for example in/opt/oracle/your_config_dir. Then use:
Alternatively, put the files in the network/admin subdirectory of InstantClient, for example in /opt/oracle/instantclient_21_1/network/admin.This is the default Oracle configuration directory for executables linkedwith this Instant Client.
Alternatively, put the files in the network/admin subdirectory of InstantClient, for example in /usr/lib/oracle/21/client64/lib/network/admin.This is the default Oracle configuration directory for executables linkedwith this Instant Client.
If you use optional Oracle configuration files such as tnsnames.ora,sqlnet.ora or oraaccess.xml with Instant Client, then put the filesin an accessible directory, for example inC:\oracle\your_config_dir. Then use:
Alternatively, put the files in a network\admin subdirectory ofInstant Client, for example inC:\oracle\instantclient_19_11\network\admin. This is the defaultOracle configuration directory for executables linked with thisInstant Client.
If you use optional Oracle configuration files such as tnsnames.ora,sqlnet.ora or oraaccess.xml with Oracle Instant Client, then put thefiles in an accessible directory, for example in/Users/your_username/oracle/your_config_dir. Then use:
For other installation options such as installing through a proxy, seeinstructions above. Make sure the Oracle Client libraries are in the systemlibrary search path because cx_Oracle 7 does not support thecx_Oracle.init_oracle_client() method and does not support loading theOracle Client libraries from the directory containing the cx_Oracle modulebinary.
On Windows, if you are not usinginit_oracle_client(), then restart your command promptand use set PATH to check the environment variable has the correctOracle Client listed before any other Oracle directories.
On macOS, make sure you are not using the bundled Python (use Homebrew or Python.org instead). If you are not usinginit_oracle_client(), then put the Oracle InstantClient libraries in ~/lib or /usr/local/lib.
Choose the OpenLink PostgreSQL Driver(Express Edition) v6.0 from the list of availabledrivers. Choose the OpenLink PostgreSQLDriver (Express Edition)(Unicode) v6.0 if and only if you are working withmulti-byte character sets, as unnecessary translations cansignificantly ODBC performance:
(3) ODBC drivers - Application software such as MS-Access, MS-Excel, and ArcGIS support "open database connection" standards for accessing database servers. On a Windows-based client machine, you may need to configure an ODBC driver to enable access to our Postgres database server.
Getting the needed files The Oracle client software is available as a free download from Oracle but the MIT online version is much easier to install since it has all the MIT specific choices already selected with the MSI. The software is listed on the Software page made available by MIT's Information Systems & Technology (IST) webpages: The Oracle listing is here: -hardware?type=All&platform=Windows+7&users=All&title=oracle&recommended_only=All
There is a second configuration file, SQLNET.ORA, that may need changing to ensure encrypted authentication and communication, but the version that comes with MIT's distribution of the Oracle client should work. These two files should replace the ones that you will find in the Admin subdirectory of your Oracle installation. If you chose the installation defaults, this sub-directory is: C:\oracle\product\11.2.0\client\network\admin Before you copy your TNSnames.ora file into this directory, you may want to rename the existing configuration file. We suggest adding 'old' or 'original' to the name. Also, be sure you do not change the name or content of the plain text files when you copy them from the class locker. For example, some copy or transfer programs may 'wrap' lines longer than 80 characters or append a *.txt suffix to the file name. Also, be sure that the names of the files are not changed when you copy them. For example, the files are plain text and if you open them in a text editor and then save them to the new location, the software may add a '.txt' suffix to the file name. If your Windows Explorer settings hide filenames suffixes, the '.txt' will not be visible but the file will be saved as 'tnsnames.ora.txt' - and SQL*Plus will not be able to get the information it needs to find the machine housing the CRL databse. Test your Oracle Client installation Use the newly installed SQL*Plus application to test your Oracle Client. Just as you do in the computing lab, start it up from Start/AllPrograms/Oracle.../Application-Development/SQL*Plus Make sure you can log in using these parameters: User Name: = parcels@crl Password: =
Choose one of these two ODBC drivers (option a) Microsoft OLE DB Provider for ODBC Drivers On the connection tab: data source: Use data source name = "CRL Oracle" User name = 'parcels' > and password = and, for security reasons, leave unchecked both the 'blank password' and 'allow saving password' choices. Finally, leave item 3 (the catalog) blank and click 'test connection' button. If the 'connection successful' window pops up, all is ready and you can click the 'OK' button (option b) Microsoft OLE DB Provider for Oracle On the conn 2b1af7f3a8