Prepare the runtime environment - connecting to the database
- In order to connect to SAP® ASE, you must have a SAP ASE database driver "dbmase" in FGLDIR/dbdrivers.
-
If you want to connect to a remote database server, you must have the SAP ASE Client Software installed on the computer running BDL
applications.
The SAP Open Client Library is required.
- Make sure that the SAP 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 SAP ASE documentation for more details.
-
Verify the environment variable defining the search path for SAP ASE 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 SAP ASE SAP ASE version Shared library environment setting SAP 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 SAP ASE Open Client Software.
-
The name of the SAP ASE 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 SAP ASE 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.
-
Check the SAP ASE database client locale
settings.
The SAP ASE client locale must match the locale used by the runtime system (LC_ALL, LANG on UNIX, ANSI code page on Windows).
By default, SAP ASE 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 your 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 SAP ASE OCS documentation regarding localization and character set definition.
- Test the SAP ASE Client Software: Make sure the server
is started and try to connect to a database by using the SAP ASE
command interpreter:
$ isql -S server -U appadmin -P password
- Set up the fglprofile entries for database connections:
-
Define the SAP ASE database driver:
dbi.database.dbname.driver = "dbmase"
- 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.
- Define the number of rows to be pre-fetched for result
sets:
dbi.database.dbname.ase.prefetch.rows = integer
Default is 10 rows.
-
Define the SAP ASE database driver: