Prepare the runtime environment - connecting to the database

  1. In order to connect to SQLite, you must have a database driver "dbmsqt" in FGLDIR/dbdrivers. On most platforms, the SQLite driver is linked statically with the SQLite library, in other word SQLite is embedded in the ODI driver. However, on some platforms such as Linux® and Max OS X, where the SQLite library is usually present.
  2. Make sure that the SQLite environment variables are properly set. You may want to define an environment variable such as SQLITEDIR to hold the installation directory of SQLite, which can then be used to set PATH and LD_LIBRARY_PATH. See SQLite documentation for more details.
  3. If the SQLite library is not embedded in the dbmsqt* driver, the environment must be set to find the SQLite library. Verify the environment variable defining the search path for the SQLite shared library.
    Table 1. Shared library environment setting for SQLite
    SQLite version Shared library environment setting (if SQLite lib not built-in driver)
    SQLite 3.6 and higher

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

    Windows®: Add %SQLITEDIR%\bin to PATH.

  4. Make sure that all operating system users running the application have read/write access to the database file.
  5. SQLite uses UTF-8 encoding. If the locale used by the runtime system (LANG/LC_ALL) is not compatible to UTF-8 (for example, fr_FR.iso88591), Genero will do the appropriate character set conversions.
  6. Set up the fglprofile entries for database connections.
    1. Define the SQLite database driver:
      dbi.database.dbname.driver = "dbmsqt"
    2. The "source" parameter defines the path to the SQLite database file. Note that the database file must reside on the local disk (SQLite does not support network file systems). SQLite also supports in-memory database creation with the :memory: db specification. See SQLite documentation (sqlite3_open) for more details.
      dbi.database.dbname.source = "/opt/myapp/stock.dbs"
    3. If the "source" parameter defines a relative path or a simple file name and the SQLite database file does not reside in that location based on the current directory of the fglrun process, define the DBPATH environment variable to find the database file. See DBPATH documentation for more details about this environment variable.
      DBPATH="/opt/myapp"