ODBC Driver

MonetDB ODBC Driver

ODBC stands for Open DataBase Connectivity, a standard database access method developed by the SQL Access group in 1992. The goal of ODBC is to make it possible to access any data from any application, regardless of which database management system (DBMS) is handling the data. ODBC manages this by inserting a middle layer, called a database driver, between an application and the DBMS. The purpose of this layer is to translate the application's data queries into commands that the DBMS understands. For this to work, both the application and the DBMS must be ODBC-compliant which means that the application must be capable of issuing ODBC commands and the DBMS must be capable of responding to them.

The MonetDB ODBC driver supports connecting to older versions of a MonetDB server. Therefore we advise to install the latest released MonetDB ODBC driver.

Installing the MonetDB ODBC Driver for Windows

For Microsoft Windows you can download the ODBC installers from MonetDB Download Area for Windows. On 32-bit Windows you install the 32-bit version. On 64-bit Windows we recommend to install both versions.

The ODBC installer will detect if an older version of the ODBC driver is already installed. If so, it will allow you to upgrade the ODBC driver, so you do not need to uninstall the previous installed ODBC driver first. The installer also allows you to uninstall an installed ODBC driver. So keep the installer program in a safe place in case you need it again.

Only one version of the MonetDB ODBC driver can be installed on Windows. Usually it will be the latest released MonetDB ODBC driver.

If for some reason you will need to install an older version, you need to uninstall the current ODBC driver first. Do this with the same installer program used to install the current ODBC driver. Next you can install the older version.

Configuring an ODBC Data Source on Windows

See Windows ODBC Data Source setup page.

Installing the MonetDB ODBC Driver for unixODBC

On Linux and macOS the ODBC driver is included when installing MonetDB server.

Next you will need to add the ODBC driver to unixODBC program.

As Superuser, start the unixODBC configuration program ODBCConfig and select the Drivers tab.

uodbc1.png

On this tab, click on the button labeled Add... and fill in the fields as follows.

uodbc2.png

  • Name MonetDB
  • Description ODBC Driver for MonetDB SQL Server
  • Driver <path-to-MonetDB>/lib(64)/libMonetODBC.so
  • Setup <path-to-MonetDB>/lib(64)/libMonetODBCs.so

Don't change the other fields. When done, click on the check mark in the top left corner of the window. The first window should now contain an entry for MonetDB. Click on OK

Configuring an ODBC Data Source via unixODBC

Now as normal user start ODBCConfig again.

uodbc3.png

On the User DSN tab click on the Add... button. A new window pops up in which you have to select the ODBC driver. Click on the entry for MonetDB and click on OK.

uodbc4.png

A new window pops up. Fill in the fields as follows.

uodbc5.png

  • Name MonetDB
  • Description Default MonetDB Data Source
  • Host localhost
  • Port 50000
  • User monetdb
  • Password monetdb

Don't change the other fields. When done, click on the check mark in the top left corner of the window. The first window should now contain an entry for MonetDB. Click on OK.

Microsoft Excel Demo

A little demo showing how to import data from a MonetDB server into Microsoft Excel.

Start up a MonetDB SQL Server and next start Excel.

In Excel, select from the drop down menu, first Data, then Get External Data, and finally New Database Query...

excel1.png

If MonetDB ODBC driver was installed correctly, there should be an entry MonetDB in the dialog box that opens. Select it and click on OK.

excel2.png

In the wizard that opens, scroll down in the list on the left hand side and select voyages. Tip: via the Options... button you can change the schema from which the tables and views must be listed in the left list.
Then click on the button labeled > and then on Next >.

excel3.png

In the next page of the wizard, click on Next >.

excel4.png

In the next page of the wizard, click on Next >.

excel5.png

In the final page of the wizard, click on Finish.

excel6.png

A new dialog window opens. Click on OK to insert the data into the current Excel worksheet.

excel7.png

That's all.

excel8.png

Reporting issues with MonetDB ODBC Driver

Before you report an ODBC Driver issue make sure you have used the latest released MonetDB ODBC Driver. The issue may already be fixed in a newer release.

Issues with MonetDB ODBC driver can be reported on Github MonetDB Issues. In the issue include information on used client Application, client OS and version, server OS and version, MonetDB server version and MonetDB ODBC Driver version.

If possible include an ODBC trace log file. This log file can be created by enabling 'Start Tracing Now' via the Tracing tab of the "ODBC Data Sources administrator" program.

Sources of MonetDB ODBC Driver code

These can be found in clients/odbc The sub dirirectory driver contains the source files of the ODBC Driver implementation. The driver/README file contains information on the ODBC Driver implementation.