ODBCConnection

The ODBCConnection is deprecated and will be removed as a component in 360 in a future release. Look in to migrating existing code to a proper JDBC driver.

About ODBC from Microsoft:

Open Database Connectivity (ODBC) is Microsoft's strategic interface for accessing data in a heterogeneous environment of relational and non- relational database management systems. Based on the Call Level Interface specification of the SQL Access Group, ODBC provides an open, vendor- neutral way of accessing data stored in a variety of proprietary personal computer, minicomputer, and mainframe databases.

This component uses the JDBC-ODBC bridge that is available in Java. Please note, however, that this bridge is slated to be removed starting with Java 8 which is why the component will be removed from 360 in a future release.

Usage

Direct connection

Using a direct connection means that you connect to the database server directly using an IP address and a port. This is the easiest way since there is no configuration needed and it only requires a few parameters. However for production code, we strongly recommend you to look at connection pooling.

A connection is direct when the Connection pool option is not checked.

Datasource

This field specifies the name of the ODBC datasource as it is setup in Windows.

User id and password

If your database uses authentication supply your username and password in these fields.

Direct connection example:

ODBCConnection odbccon1 = new ODBCConnection("myodbc", "serobkle", "#$E%0xcGFzc3dvcmQ=");

Pooled connection

The recommended way to use connections is to use a connection pool. When you have a pool setup you check the Connection Pool option and select your pool from the helper icon. This will give you something like this:

ODBCConnection odbccon1 = (ODBCConnection) PoolManager.instance().getIPool("myPool").getConnection();

If the list of pooled connection is empty you need to configure your pools in 360's administration tool. Please see the help section for Pool Connections.