Top
Symfoware Server V12.0.0 Application Development Guide
FUJITSU Software

Linux3.2.3 Registering ODBC Data Sources(for Linux)

This section describes how to register ODBC data sources on Linux.

  1. Registering data sources

    Edit the odbc.ini definition file for the data source.

    Information

    Edit the file in the installation directory for the ODBC driver manager (unixODBC)

    unixOdbcInstallationDir/etc/etc/odbc.ini

    Or

    Create a new file in the HOME directory

    ~/.odbc.ini

    Point

    If unixOdbcInstallationDir is edited, these will be used as the shared settings for all users that log into the system. If created in the HOME directory (~/), the settings are used only by the single user.

    Set the following content:

    Definition name

    Setting value

    [Data source name]

    Set the name for the ODBC data source.

    Description

    Set a description for the ODBC data source. Any description may be set.

    Driver

    Set the following as the name of the ODBC driver. Do not change this value.

    • When the character set is EUC_JP or Shift-JIS on Linux (32-bit)

      "SymfowareServerV12.0ansi"

    • When the character set is UTF-8 on Linux (32-bit)

      "SymfowareServerV12.0unicode"

    • When the character set is EUC_JP or Shift-JIS on Linux (64-bit)

      "SymfowareServerV12.0x64ansi"

    • When the character set is UTF-8 on Linux (64-bit)

      "SymfowareServerV12.0x64unicode"

    Database

    Specify the database name to be connected.

    Servername

    Specify the host name for the database server.

    Username

    Specify the user ID that will connect with the database.

    Password

    Specify the password for the user that will connect to the database.

    Port

    Specify the port number for the database server.

    The default is "26500".

    SSLMode

    The setting values for SSLMode are as follows:

    • disable: Connect without SSL

    • allow: Connect without SSL, and if it fails, connect using SSL

    • prefer: Connect using SSL, and if it fails, connect without SSL

    • require: Connect always using SSL

    • verify-ca: Connect using SSL, and use a certificate issued by a trusted CA (*1)

    • verify-full: Connect using SSL, and use a certificate issued by a trusted CA to verify if the server host name matches the certificate (*1)

    ReadOnly

    Specify whether to set the database as read-only.

    • 1: Set read-only

    • 0: Do not set read-only

    *1: If specifying either "verify-ca" or "verify-full", use the environment variable PGSSLROOTCERT to specify the CA certificate file as shown below.

    Example

    export PGSSLROOTCERT=caCertificateFileStorageDir/root.crt
    Example:

    Linux 32-bit

    [MyDataSource]
    Description    = SymfowareServer
    Driver         = SymfowareServerV12.0ansi
    Database       = db01
    Servername     = sv1
    Port           = 26500
    ReadOnly       = 0

    Note

    In consideration of security, specify the UserName and the Password by the application.

  2. Environment variable settings

    The LD_LIBRARY_PATH environment variable needs to be set to execute applications that use ODBC drivers.

    Example:

    The following are examples of setting the LD_LIBRARY_PATH:

    • Linux (32-bit)

      Setting example (TC shell)

      setenv LD_LIBRARY_PATH /usr/local/lib(*1)(*2):/opt/symfoclient32/lib:${LD_LIBRARY_PATH}

      Setting example (bash)

      LD_LIBRARY_PATH=/usr/local/lib(*1)(*2):/opt/symfoclient32/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH
    • Linux (64-bit)

      Setting example (TC shell)

      setenv LD_LIBRARY_PATH /usr/local/lib(*1)(*2):/opt/symfoclient64/lib:${LD_LIBRARY_PATH}

      Setting example (bash)

      LD_LIBRARY_PATH=/usr/local/lib(*1)(*2):/opt/symfoclient64/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH

    *1: This is an example of building and installing from the source without specifying an installation directory for unixODBC. If you wish to specify a location, set the installation directory.

    *2: This is an example of building and installing from the source without specifying an installation directory for libtool. If you wish to specify a location, set the installation directory.