Prepare the runtime environment - connecting to the database

  1. In order to connect to Sybase ASE, you must have a Sybase ASE database driver "dbmase" in FGLDIR/dbdrivers.
  2. If you want to connect to a remote database server, you must have the Sybase ASE Client Software installed on the computer running BDL applications. The Sybase Open Client Library is required.
  3. Make sure that the Sybase ASE client environment variables are properly set. Check for example SYBASE (the path to the installation directory), SYBASE_ASE (the name of the server sub-directory), SYBASE_OCS (the name of the client sub-directory), etc. See Sybase ASE documentation for more details.
  4. Verify the environment variable defining the search path for Sybase OCS database client shared libraries (libsybct[64].so, libsybcs[64].so UNIX™, LIBSYBCT[64].DLL and LIBSYBCS[64].DLL on Windows™).
    Table 1. Shared library environment setting for Sybase ASE
    Sybase ASE version Shared library environment setting
    Sybase ASE 16.0 and higher

    UNIX: Add $SYBASE_OCS/lib to LD_LIBRARY_PATH (or its equivalent).

    Windows: Add %SYBASE_OCS%\dll to PATH.

    Where SYBASE_OCS is the directory of the Sybase Open Client Software.

  5. The name of the Sybase server must be registered in a configuration file. On UNIX, the server name must be defined in the "interfaces" file located in $SYBASE. On Windows, the server name must be defined in the "sql.ini" file located in %SYBASE%\ini. You may want to define the DSQUERY environment variable to the name of the server. See Sybase documentation for more details.

    When connecting from a Genero program, both database and server names can be specified with:

    database@server

    For more details see the description for the connection data source parameter in DATABASE and CONNECT instructions.

  6. Check the database client locale settings of Sybase.

    The Sybase client locale must match the locale used by the runtime system (LC_ALL, LANG on UNIX, ANSI code page on Windows).

    By default, Sybase OCS uses the character set defined by the operating system. On Windows, this is the ANSI code page, on UNIX it is defined by LC_CTYPE, LC_ALL or LANG environment variables. Note that Genero BDL allows to define the LANG environment variable also on Windows. The value of the LANG environment variable must be listed in the "locales.dat" file under the $SYBASE/locales directory, otherwise you will get an error when connecting to the database.

    Note: Check the $SYBROOT/locales/locales.dat file, to make sure that your current locale (LANG/LC_ALL) is listed in the file. You may want to add the following lines for UTF-8 support, under the section of your operating system:
      locale = POSIX, us_english, utf8
      locale = en_US.utf8, us_english, utf8
    ; Windows only:
      locale = .fglutf8, us_english, utf8

    See also Sybase OCS documentation regarding localization and character set definition.

  7. Test the Sybase ASE Client Software: Make sure the server is started and try to connect to a database by using the Sybase ASE command interpreter:
    $ isql -S server -U appadmin -P password
  8. Set up the fglprofile entries for database connections:
    1. Define the Sybase ASE database driver:
      dbi.database.dbname.driver = "dbmase"
    2. Define the connection timeout with the following fglprofile entry:
      dbi.database.dbname.ase.logintime = integer

      This entry defines the number of seconds to wait for a connection.

      Default is 5 seconds.

    3. Define the number of rows to be pre-fetched for result sets:
      dbi.database.dbname.ase.prefetch.rows = integer

      Default is 10 rows.