ODBC Driver for Microsoft Excel

Build 24.0.8963

Configuring JNI

Java Native Interface (JNI) is a standard programming interface for writing Java native methods and embedding the Java virtual machine into native applications.

The driver leverages the JNI for improved performance.

Configure the INI File

The Linux edition of the Microsoft Excel ODBC driver is shipped with a configuration file. This file is used to several parameters, including JNI behavior. By default, this is found in:

/opt/cdata/cdata-odbc-driver-for-excel/lib/cdata.odbc.excel.ini

Configure the JNI driver's behavior by editing the properties in the driver's INI file. The driver can be configured as follows:

  • DriverManagerEncoding: Can be either UTF-8, UTF-16, or UTF-32. This will typically need to be specified when using the Unicode ODBC API.
  • AnsiCodePage: Set this to the name of the encoding used for the ANSI ODBC API. Acceptable values are: Shift_JIS, GB2312, and all Java charset names. This will need to be configured if the application is using the ANSI ODBC API.
  • LibODBCINST: Set this to be the path to the libodbcinst library that is used to read/write the ODBC DSN. Configure this when the target machine has installed too many intances of ODBCINST.
  • JVM: Configure the JVM library location used to launch the JVM. Users usually need to configure it when the application is a Java program.
  • ClassPath: Configure the paths to the third-party jar libraries, separated by colon characters.

Ensure that these properties are placed in the .ini file, one per line, under the Drivers section name:

[Drivers]
DriverManagerEncoding = UTF-16

Configure Environment Variables

Additionally, set the following environment variables:

  • CDATA_JVM: This is the path to the JVM.
  • CDATA_JVM_OPTIONS: Place JVM options here.
  • CDATA_ODBC_LOG: Set this in the following scheme: <SCHEME>://<TAG>[|<LEVEL>]

    • SCHEME: The options are SYSLOG, STDOUT, FILE
      • SYSLOG: The native ODBC wrapper (cdata.odbc.excel.so) logs into syslogs.
      • STDOUT: Both the native ODBC wrapper and odbc core(cdata.odbcm.excel.jar) logs into stdout. The Logfile and Verbosity properties can override the behavior of ODBC core.
      • FILE: The native odbc wrapper logs into <FILENAME> while the odbc core logs into <FILENAME>.driver.log. The Logfile and Verbosity properties can override the behavior of ODBC core.
    • TAG
      • The ident for SYSLOG. For STDOUT, this will be N/A. If it is FILE, the it is the filename.
    • LEVEL
      • Set to one of: FATAL | ERROR | WARNING | INFO | DEBUG

The following are some examples of this syntax:

  • STDOUT://1|DEBUG
  • SYSLOG://[CData Microsoft Excel ODBC]|DEBUG
  • FILE:///var/my_odbc.log|DEBUG

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.8963