The most common way of configuring CCL queries to interact with an external relational database includes a database user name, password, and Database Source Name (DSN).
To set up this type of connection from within Sybase CEP Engine:
Here are three examples of how you might set the configuration preferences.
This is an example of an entry that uses the Oracle OCI driver:
<Service Name="OracleDb" Type="DATABASE" > <Description>local oracle dod db</Description> <Param Name="DBDriverType">DBDriverOracle</Param> <Param Name="DBDriverConnectString">myhost:6789/mydb</Param> <Param Name="CacheMaximumAge">0</Param> <Param Name="Username">myuser</Param> <Param Name="Password">mypass</Param> </Service>
This example uses an ODBC driver. Note the different value for DBDriverType:
<Service Name="MyDB" Type="DATABASE" > <Description>sample odbc db</Description> <Param Name="DBDriverType">DBDriverODBC</Param> <Param Name="DBDriverConnectString">MyDSNName</Param> <Param Name="CacheMaximumAge">0</Param> <Param Name="Username">myuser</Param> <Param Name="Password">mypass</Param> </Service>
This example uses a Sybase IQ driver. Note the different value for DBDriverType:
<Service Name="MyIQDB" Type="DATABASE" > <Description>sample sybase iq db</Description> <Param Name="DBDriverType">DBDriverODBCSybaseIQUnix</Param> <Param Name="DBDriverConnectString">MyDSNName</Param> <Param Name="CacheMaximumAge">0</Param> <Param Name="Username">myuser</Param> <Param Name="Password">mypass</Param> </Service>
Finally, here is an example using the kdb+ driver:
<Service Name="MyKdbService" Type="DATABASE" > <Description>sample kdb</Description> <Param Name="DBDriverType">DBDriverKDB</Param> <Param Name="DBDriverConnectString">myhostname.mydomain.com</Param> <Param Name="Port">12345</Param> <Param Name="CacheMaximumAge">0</Param> <Param Name="Username">myuser</Param> <Param Name="Password">mypass</Param> </Service>
If you are using a driver other than the ones discussed here, consult the driver documentation for the correct database driver connect string.
Make sure that the external database to which you are connecting is running properly before attempting to connect to it from Sybase CEP Engine.