Before Setting up Sybase CEP Engine for Database Connections

This section describes the preliminary steps you must complete before you try to establish communication between Sybase CEP Server and an external database, except if you are using kdb+.

The Sybase CEP kdb+ driver is automatically installed when you install Sybase CEP Server. If you are using kdb+, skip this section and proceed to "Configuring Connections to Databases with User Name, Password, and DSN".

  1. Install the appropriate ODBC or native Oracle driver for the external database you want to query. Contact the appropriate vendor to obtain the driver.
    Note: If you are planning to connect to an Oracle database, keep in mind that Sybase CEP Engine does not support stored procedure calls that return values when using the native Oracle driver.

    If you have installed an Oracle native driver, skip the rest of the steps in this section.

    If you have installed an ODBC driver on a UNIX-like operating system, proceed to the next step.

  2. If you are using an ODBC driver on a UNIX-like operating system, install the ODBC Driver Manager, if it is not already installed. The Driver Manager controls the access to the ODBC drivers.

    Sybase CEP Engine has been tested and is supported with the unixODBC Driver Manager. It should also work with the iODBC Driver Manager, but this configuration has not been tested.

    For more information on UNIX ODBC, see: http://www.easysoft.com/developer/interfaces/odbc/linux.html.

  3. If you are using an ODBC driver on a UNIX-like operating system, register the installed driver with the Driver Manager. You can either use the ODBCConfig graphical program, or the odbcinst command, both of which come with unixODBC, to register the program. The instructions in this section assume that you are using the odbcinst command:
    1. Create a file called tds.driver.template in the /usr/local/etc directory.
    2. Add a few lines describing the driver to this file. For example:
      [FreeTDS]
      		Description = v0.64 with protocol v8.0
      		Driver = /usr/local/freetds/lib/libtdsodbc.so
      

      This example configures an SQL Server connection on a UNIX-like operating system, using the FreeTDS driver. If you are using a different database, your entry should correspond to your driver.

    3. Execute odbcinst , using one of the commands listed in this step, to install a driver entry using the tds.driver.template file. (Use the odbcinst -help command for instructions on which of the two commands to use). The commands are:
      odbcinst -i -d -t tds.driver.template
      

      with a space between the -t flag and the file name, or:

      odbcinst -i -d -f tds.driver.template
      
  4. (Optional). If you are using ODBC, you may create a Database Source Name (DSN) for each database to which you want to connect, however, Sybase CEP Engine allows connections to the database with or without a DSN. If you do not want to create a DSN, skip this step and proceed to "Enabling External Database Access".
    • Creating the DSN on Microsoft Windows:

      1. Open Windows Control Panel.

      2. Double-click Administrative Tools.

      3. Double-click Data Sources (ODBC).

      4. Click the Add button to add a system, or click user DSN and select the appropriate ODBC driver from the displayed list.

      5. Click the Finish button once you have selected the driver.

      6. Provide the appropriate database connection information on the page that appears. The specific page depends on the driver you select.

        When the installing program prompts you to provide the Data Source Name, enter the name you want to use to access the database. This is also the name you will provide when setting the DBDriverConnectString value in the c8-services.xml file.

    • Creating the DSN on a UNIX-like operating system:

      Add a DSN entry to the odbc.ini file, for every system DSN that you or any other user plans to access from your system, or add a user DSN entry to the .odbc.ini file, for every user DSN that a specific user will access.

      If you are using unixODBC 2.2.12, the default location of the odbc.ini is in the /usr/local/etc directory. The default location of the .odbc.ini is in the user's home directory. The contents of every DSN entry depend on the ODBC driver that is required by the specific data source.

      Note that the Driver line of the DSN entry in the odbc.ini or .odbc.ini file must match the appropriate section entry in the odbcinst.ini file, which describes all the available installed ODBC drivers. The odbcinst.ini file is also located in the /usr/local/etc directory.