jBASE ODBC

Open Database Connectivity (ODBC) is an open standard Application Programming Interface (API) for accessing a database. By using ODBC statements in a program, you can access files in a number of different common databases.

In addition to the ODBC software, you need a separate module or driver to access each database.

jBASE ODBC Connector Architecture

jAgent on jBASE Database Server

Setting up jBASE ODBC

This section describes the system requirements, Installer package, how to install and manage the jBASE ODBC Driver.

Configuring DSN

ODBC applications usually obtain the connection details from DSNs, which may be configured via Microsoft’s ODBC Data Source Administrator (also known as ODBC Manager, odbcad32.exe or Control Panel à Administrative Tools à Data Sources (ODBC)).

Use the following steps to add a DSN for jBASE connectivity:

  1. Click Add in the ODBC Data Source Administrator, select jBASE ODBC Driver, and click Finish.

  2. In the jBASE ODBC Data Source screen, specify the Data Source Name and Connection details.

  3. Parameter Use

    Server  

    IP address or hostname of the machine on which the jBase_agent or tafc_agent is running.

    Port 

    Port number on which the jBase_agent or tafc_agent is listening.

    User   

    User login ID

    Password

    Login Password

  4. Start the jbase_agent or tafc_agent on the jBASE Server machine to listen on the port defined in the last step.

  5. Click the Test button to see if the connection can be established from the client machine to the jBASE Server.

Extracting Data from jBASE Server

You can extract data from jBASE server using any ODBC compliant application, such as Microsoft Excel, Crystal Reports, Microsoft Access, etc. When MS Excel is used, the following steps needs to be performed:

  1. In MS Excel, navigate to Data > From Other Sources and select From Microsoft Query.

  2. Select the DSN that was created earlier and click OK.

  3. You will see all the jBASE tables available in the current directory where jBASE_Agent is running.

  4. Select the file or table from which the data need to be imported. Also, select the fields of the table that are to be exported.

  5. Select a field for sorting in the Sort by option and click Next.

  6. Click Finish.

  7. Click OK on the Import Data dialog box to produce the output in Table format.

  8. You will see the jBASE table data exported and displayed in excel.

Additional Connection Properties

In R12, two additional properties are included in jBASE ODBC driver. They are

  • Timeout – To set the connection timeout for jAgent running on jBASE Server. If this property is not set, then the default connection timeout of jAgent will be used.

  • Env.Variables – To set the JEDIFILEPATH on jBASE Server. This will help you to query any table available in the specified path. By default, the query looks for tables or files in the default JEDIFILEPATH or the tables or files in the current directory, where jAgent is running.

  • These properties can be defined using the DSN configuration options in ODBC Data Source Admin.

jBASE Locale Configuration

Locales can be configured for the user id through the JBASE_LOCALE environment variable. The jlocales command displays a full list of available locales from the command line.

Configured locales are only applicable when executing an application in international mode or the JBASE_I18N environment variable is configured. The locale is based on the underlying OS locale configuration and the configured locale for the user id has no effect.

As configuration of the international mode is on an account basis, the state of international mode can change on execution of a LOGTO. If configuring an account with international mode false, then the JBASE_I18N environment variable will be unset as the result of the LOGTO.

Developing Client Applications

ODBC CLI is an API written in C but other frameworks like .NET provide ODBC wrapper classes. The following Visual Basic .NET examples use .NET’s Microsoft.Data.Odbc module.

Enabling TABLEFILE functionality for jODBC

The previous jDP functionality allowed a list of files accessible to the current datasource to be specified in the connections string. Similar functionality is now provided via the TABLEFILE functionality.

To use:

  • Create and populate a catalog file on the jAgent server in the normal way.

  • When creating a new data source, specify the full path of the of the catalog file in either the advanced options dialog of odbcad32 or the USER_CATALOG parameter of the connection string. For example,

    jODBCManager -add="DSN=MyTestjODBC;SERVER=localhost;UID=test;USER_CATALOG=c:\data\myCatalog"

Bookmark Name Actions
Feedback
x