Connecting to an ODBC Data Source


IMPORTANT - Change for installations running on a Java Virtual Machine (JVM) version 1.8 or higher. In Java 1.8, Oracle removed the JDBC-ODBC Bridge Driver from the Windows JVM installation. This driver was used to provide access to ODBC data sources from Java applications. With this change, BBj can no longer access ODBC data sources from BBj programs unless you install one of the third party commercial ODBC bridge options available. The most common users affected by this change will be those who access Microsoft Access databases from BBj. If you are currently using ODBC data sources to access a third party DBMS from BBj, BASIS recommends switching to a JDBC driver for the DBMS, or using one of the commercial ODBC bridge options available.


In versions of BBj running on JVM versions 1.7 or older, the following two options can be used to establish a connection to an ODBC data source:

  • The easiest method is to specify the case-sensitive name of the data source in the call to SQLOPEN. When using this method, make sure that an alias of the same name is not currently present in the SQL.INI file. If there is an alias by the same name, the alias in the SQL.INI file will take precedence.

  • The other method is to use the JDBC-ODBC Bridge connect string. The format is as follows:
    jdbc:odbc:ODBCDataSourceName[:opt1=value:opt2=value:…]

It is strongly recommended that SQL connections to any DBMS be made using a JDBC connection rather than ODBC data sources. Using pure JDBC is typically more stable and efficient, and as noted above, the ODBC option will not be available out-of-the-box when using a 1.8 or higher JVM.