Configuring the ASE Database Driver

Configure the Sybase CEP Server to communicate with an ASE database.

Set up the Sybase CEP Server to communicate with an ASE database by configuring the c8-server.conf and c8-services.xml files. Before starting the CEP server, source the Sybase ASE/OCS environment (SYBASE.csh/sh) in the console and ensure Sybase Open Client (OC) version 15.5 is installed.

Note: ASE v15.5 is installed with the necissary OC elements, so any workstation with both ASE and Sybase CEP installed will be fully functional. If you do not have ASE or Sybase Open Client installed on your Sybase CEP workstation, you have a number of options depending on your operating system:
  • Windows users can install the ASE v15.5 Network Client, which includesOC v15.5 . This client is only available for Windows platforms.
  • Unix users can install the OC components from ASE v15.5 or download and install the Sybase Developers Kit (SDK) v15.5, which contains the same components.

To configure the ASE Database Driver:

  1. Open the c8-server.conf configuration file.
  2. Locate the <section name> element.
    <section name="C8/General"><section name="Plugins">
    Within this section, add the libary:
    <preference name="AdditionalLibraries">c8_db_driver_sybase_ocs_lib</preference>
  3. Save and close c8-server.conf.
  4. Open c8-services.xml.
  5. Add:
    <!-- Sybase CEP OCS Driver - testing -->
    
       <Service Name="SybaseC8_OCS_Driver" Type="DATABASE" >
    
         <Description>Sybase CEP OCS Database</Description>
    
         <Param Name="DBDriverType">DBDriverSybaseOCS</Param>
    
         <Param Name="DBDriverConnectString">pdrepsybase 5000</Param>
    
    	 <Param Name="Username">user</Param>
    
         <Param Name="Password">password</Param>
    
         <Param Name="Timezone">timezone that exists in server/plugins/c8_timezones.csv</Param>
    
         <Param Name="OCSDatabaseName">dbname</Param>
    
         <Param Name="OCSAppName">appname</Param>
    
         <Param Name="OCSConfigFile">filename</Param>
    
         <Param Name="OCSServerAddress">hostname port</Param>
    
         <Param Name="OCSServerName">servername</Param>
    
         <Param Name="OCSNoTransactions">true/false</Param>
    
         <Param Name="OCSFetchMultipleResultSets">true/false</Param>
    
         <Param Name="OCSInlineTimestampParamFormat">timestamp format</Param>
    
      </Service>
    
    
  6. Define the following parameters:
    • Timezone – specifies the timezone the ASE database is running in. If set to a timezone other than GMT, the timestamp value will be corrected by the standard time GMT offset.
    • OCSDatabaseName – (optional) sets the database name.
    • OCSAppName – (optional) specifies the stanza of an external OCS configuration file to read for properties and options.
    • OCSConfig File – (optional) allows an external OCS configuration file to be used. If this value is set and the file does not exist, an error occurs. If this value is not set, a platform-specific default file is used.

      On UNIX platforms, the default configuration file is $SYBASE/$SYBASE_OCS/config/ocs.cfg.

      $SYBASE is the path to the Sybase installation directory, specified in the SYBASE environment variable. $SYBASE_OCS is the Open Client and Open Server subdirectory, specified in the SYBASE_OCS environment variable.

      On Windows platforms, the default configuration file is %SYBASE%\%SYBASE_OCS%\ini\ocs.cfg.

      %SYBASE% is the path to the Sybase installation directory, specified in the SYBASE environment variable. %SYBASE_OCS% is the Open Client and Open Server subdirectory, specified in the SYBASE_OCS environment variable.

      CT_ OPTIONS that govern transaction isolation and transaction chaining can be set in one of the platform-dependant external configuration files listed above.

      Do not set the option CS_NETIO=CS_ASYNC_IO in the external configuration file. It is possible to set CS_NETIO=CS_SYNC_10, but this causes the “abort" feature for long-lived calls not to function. The driver sets the default value for this option to CS_NETIO=CS_DEFER_IO.

      If the driver detects that CS_OPT_CHAINXACTS is true, the driver does not issue “begin transaction” commands.

    • OCSServer Address and OCSServerName – specifies the server to connect to. Only one of the parameters is necessary. Values set in the external configuration file overrride these settings.
    • OCSNoTransactions – (optional) prevents the driver from issuing transaction commands. This is useful for achieving “autocommit” functionality. The default value is false, which means the driver can issue transaction commands.
    • OCSFetchMultipleResultSets – (optional) governs whether multiple result sets are fetched at once. All result sets must have identical schema. The default value is false, which means the result sets are fetched independently.
    • OCSInlineTimestampParamFormat – (optional) specifies a string format to convert the timestamp into when parameter inlining is required for an SQL statement, such as "exec sp_some_stored_proc ?CepVar". The default value is YYYY-MM-DD HH24:MI:SS.FF.
    Note: If you are working on a Solaris platform, ensure that the LD_LIBRARY_PATH_64 environment variable is not set. Setting the variable will cause an error.
    For more information on database drivers and external configuration files, consult the Open Server 15.5 Client/Library C Reference Manual.