Prepare the runtime environment - connecting to the database
- In order to connect to SAP HANA®, you must have the
database driver "
dbmhdb
" in $FGLDIR/dbdrivers. - Make sure that the SAP HANA client software is
installed and check that SAP HANA environment variables are properly set.See SAP HANA documentation for more details.
-
The database client locale does not need to be defined with the SAP HANA ODI driver: The driver will automatically do the required code
set conversions from/to the application client locale and UTF-16LE, with the wide char (SQL_C_WCHAR)
ODBC APIs.
Only define the application locale for the runtime system (LC_ALL, LANG).
- Verify the environment variable defining the search path for the SAP HANA database client shared library (libodbcHDB.so on UNIX™, libodbcHDB.DLL on Windows™).
Table 1. Shared library environment setting for SAP HANA version SAP HANA version Shared library environment setting SAP HANA 2.x and higher UNIX: Add $HDBDIR to LD_LIBRARY_PATH (or its equivalent).
Windows: Add %HDBDIR% to PATH.
- To verify if the SAP HANA client environment is
correct, you can start the hdbsql command interpreter and connect to the server:
$ hdbsql -i 90 -d SystemDB -u SYSTEM -p password
-
Setup the FGLPROFILE entries for database
connections.
-
Define the SAP HANA database driver:
dbi.database.dbname.driver = "dbmhdb"
-
The "
source
" parameter defines the name of the SAP HANA ODBC data source.dbi.database.dbname.source = "test1"
-
Define the database schema selection if needed:
Use the following entry to define the database schema to be used by the application. The database interface will automatically perform a
SET SCHEMA name
instruction to switch to a specific schema:dbi.database.dbname.hdb.schema = 'name'
Here dbname identifies the database name used in the BDL program (
DATABASE dbname
) and name is the schema name to be used in the SET SCHEMA instruction. If this entry is not defined, no "SET SCHEMA" instruction is executed and the current schema defaults to the user's name.
-
Define the SAP HANA database driver: