Top
Symfoware Server V12.1.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)

    unixOdbcInstallDir/etc/odbc.ini

    Or

    Create a new file in the HOME directory

    ~/.odbc.ini

    Point

    If unixOdbcInstallDir 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.

    Select the two strings below that correspond to the application type. Concatenate the strings with no spaces and then specify this as the driver name.

    Note

    The placeholders shown below are enclosed in angle brackets '<>' to avoid confusion with literal text. Do not include the angle brackets in the string.

    • Application architecture

      • For data sources used by 32-bit applications

        "SymfowareServer<symfowareServerClientVersAndLvl>"

      • For data sources used by 64-bit applications

        "SymfowareServer<symfowareServerClientVersAndLvl>x64"

    • Encoding system used by the application

      • In Unicode (only UTF-8 can be used)

        "unicode"

      • Other than Unicode

        "ansi"

    Example: In a 32-bit application, where the encoding system used by the application is Unicode:

    "SymfowareServer<symfowareServerClientVersAndLvl>unicode"

    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.1.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

    To execute applications that use ODBC drivers, all of the following settings must be configured in the LD_LIBRARY_PATH environment variable:

    • symfowareServerClientInstallDir/lib

    • unixOdbcInstallDir(*1)/lib

    • libtoolInstallDir(*1)/lib

    *1: If the installation directory is not specified when unixODBC and libtool are installed, they will be installed in /usr/local.