ODBC Drivers


To access the BASIS DBMS, a client interface must be used. This client interface communicates with the BASIS Database, giving it instructions to perform. There are three possible client interfaces that can be used to communicate with the BASIS DBMS: the BBj ODBC Driver, the BBj JDBC Driver, and the BBj Interpreter. This section covers the use of the ODBC drivers. For JDBC drivers, see Connecting Using the JDBC Driver.

ODBC

ODBC is a standard Application Programming Interface (API) introduced by Microsoft that creates a thin, unifying layer between applications and heterogeneous database drivers. ODBC established a standard for applications accessing data and a standard for Database Management System (DBMS) vendors to provide access to their proprietary data through a common API.

The BBj ODBC Driver gives ODBC-compliant products access to BBx files via the BASIS DBMS.

ODBC Architecture

ODBC architecture has four components: the application, the ODBC Driver Manager, vendor supplied drivers, and the source of actual data. The application deals directly with the ODBC Driver Manager to access foreign data. ODBC-compliant applications do not need to deal directly with proprietary database interfaces.

The BBj ODBC Driver

Using the BBj ODBC Driver is the most common method used to access the BASIS DBMS from third party applications. Some of the features of the driver include:

  • Simple, easy configuration

  • ODBC 3.51 compliancy

  • Support for UNICODE applications, such as Microsoft Access 2000

Configuring BBj ODBC Driver Data Sources

An ODBC data source consists of the information necessary to connect to, and access a particular database. Configuration of BBj ODBC Driver data sources is designed to be simple and easy to administer. Below is an example of the ODBC configuration dialog for BBj Demo data source that is created when the BBj ODBC Driver is installed:

bbjds04.png

Configuration Options

Users of the BASIS ODBC Driver version 3.0x and below may notice that most of the configuration options found in previous versions are missing from the BBj ODBC Driver configuration dialog. Because of the architecture of the BASIS DBMS (see the Architecture section), most of the configuration is done on the server side. This feature allows for configuration of user accounts, permissions, and database options in one central location that is inaccessible to unauthorized users. The following is a list of the configuration options necessary to set up a data source using the BBj ODBC Driver:

Option

Description

Name

Name of the data source. It is case-sensitive. The data source name enables an ODBC application to identify the data source connection.

Description

Description of the data source.

Server

Name of the machine that is running the BASIS DBMS to which the data source should connect.

Port

Port number on which the BASIS DBMS is running. Currently, this should always be 2001.

User Name

User name to be used to connect to the BASIS DBMS.

Password

Password used to authenticate the user. For security reasons, BASIS recommends leaving the user name and password blank, which, if the application does not specify a user name and password, will cause the ODBC driver to prompt the user to enter a user name and password.

Database

Name of the database to connect to on the BASIS DBMS specified in Server.

Prefetch Size

When scrolling through a result set, the ODBC driver fetches results from the server. By fetching results in larger blocks, it does not need to make as many round trip calls to the server over the network, significantly improving overall performance and user experience. This value indicates the number of records to prefetch when additional records are needed. Typically the default setting works for most users.

Max Connect Retries

The maximum number of attempts the driver will make when establishing a connection before failing and returning a connection failure error.

User Config

Comma separated list of name=value pairs for any connection properties to be set during connect time. For example, you can pass in the value for a user defined property such as: DATA1=/my/directory

Use Connection Cache

Indicates whether the driver should take the first 5 connections and pipe them all through the same physical network connection to the server. This feature is present so that applications that make multiple connections for a single operation such as MS Query and MS Excel, can use a single license. Unchecking this setting may provide improved performance in high activity applications.

Use SSL

 Indicates whether the ODBC Driver and server should communicate using SSL. Note that the server must be set to use SSL for this setting to work. An incorrect setting will cause connection failures.

Character Set Translation

Set this option if the data from the BASIS DBMS must be translated to a different character set using a code page translator. For additional information on code page translators, see the Microsoft ODBC documentation.

About Button

Displays a dialog providing information about the driver, such as version information.

It is also possible to connect to the BASIS DBMS using the BBj ODBC Driver without explicitly creating a new data source using the ODBC Driver Manager. To do this, the ODBC application must build a connect string used to tell the ODBC Driver Manager the driver to use and the connection options needed to establish a connection to the desired database. The following are the options that can be set in an ODBC connect string using the BBj ODBC Driver:

Option

Description

Driver

DRIVER. Creating a custom connect string requires specifying the name of the ODBC driver to use. For the BBj ODBC Driver, the name is "BBj ODBC Driver."

Server

SERVER

Port

PORT

Database

DATABASE, DBQ

User

USER, USERID, UID

Password

PASSWORD, PWD

Translation DLL

TRANSLATEDLL

Translation Option

TRANSLATEOPTION


UNICODE Characters

In BBj 12.0 and higher, there are two methods for returning UNICODE characters from string operations in the BBj ODBC Driver: ANSI to UNICODE mapping, and using server side character set configuration.  

Server-Side Character Set Configuration

By far, the simplest and most reliable approach is to select a server side character set.  Using this method removes the necessity for client side configuration on each station.  Further, selecting the character set on the server makes the UNICODE characters available in BBj, JDBC applications, and ODBC applications. See Database - Information Tab for more information.

ANSI to UNICODE Mapping

The ANSI to UNICODE mapping option has very limited use and is still available for legacy purposes.  This option gives the ability to select from Cyrillic or Thai code pages which translate certain single ASCII characters to the appropriate UNICODE character.  Because of this limited use, BASIS recommends using the server-side character set configuration option for dealing with UNICODE characters in ODBC applications.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.