Configuring Connections to Databases with User Name, Password, and Database Source Name

Configure CCL queries to interact with a kdb+ database using a database user name, password, and Database Source Name (DSN).

To set up a connection from within Sybase CEP Engine.

  1. In the c8-services.xml file, create a separate service entry section for every kdb+ database you wish to connect to. This entry provides information to enable Sybase CEP Server to communicate with the kdb+ database server. To connect to multiple kdb+ database servers or to multiple kdb+ databases on a single server, create a separate section for each kdb+ database.
    The c8-services.xml file contains several sample database service entry sections, each for a different type of database service. To find these entries, search for the string Type="DATABASE" inside the file. You can customize one of these sections, or make a copy of it in the file and customize the copy.
  2. Set the "Service Name" preference to a unique service name for the remote service. This name is case-sensitive, and may contain a character string consisting of letters, numbers, underscores, dots and colons. Ensure that the service name begins with a letter, and that it is the same name as the name of the database used in your CCL queries. For example, if the database subquery is:
    ...
    FROM (DATABASE "Database1" SCHEMA "valuation.ccs" [[SELECT * FROM Stocks WHERE T.symbol=Stocks.symbol]])
    
    the database name (Database1) in the database subquery should match the service name in the c8-services.xml file.
  3. Set the "Type" preference to DATABASE.
  4. (Optional) Add a description of your service entry in the "Description" element.
  5. Set the "DBDriverType" preference to "DBDriverKDB" to connect to a kdb+ database.
  6. Set the "DBDriverConnectString" preference to the information necessary to connect to the external database. For DBDriverKDB, the "DBDriverConnectString" is the name of the host name of the kdb+ server.
    Most database servers allow a single server to contain multiple databases. To perform queries on more than one database on a given server, you may need to configure a separate connection for each database.
    Note: If your "DBDriverConnectString" contains a semicolon (;), forward slash (/), question mark (?), colon (:), at sign (@), ampersand (&), equal sign (=), plus sign (+), dollar sign ($), or comma (,), the character must be preceded by a back slash escape character (\).
  7. For kdb+ services, set the "Port" preference to the port number of the kdb+ server.
  8. (Optional) Set the "CacheMaximumAge" preference to specify how long Sybase CEP Server keeps a cached copy of the information it reads from the kdb+ database.
  9. Set the "Username" preference to the user name that is used when communicating with the kdb+ database.
    Note: Note that this value is unencrypted, so anyone with access to the c8-services.xml file may read the user name.
  10. Set the "Password" preference to the password for the user name specified in the "Username" preference. The password is unencrypted.
  11. Set any desired optional preferences for your database service entry in the c8-services.xml file.