Enabling Access to Public Windows as External Databases

A description of how to use CCL-enabled public windows to communicate with external databases.

The public windows feature creates a special CCL window, with which you may do the following:

If you plan to access a public window with adapters, CCL database subqueries, or one of the Sybase CEP SDKs, you must first create one or more database service entries for the Sybase CEP Engine projects containing the public windows, as described here.

  1. For every project that contains a public window to which you want to connect, add a database service entry to the c8-services.xml file.

    The c8-services.xml file contains a sample service entry section for this purpose. You can either customize this section, or make a copy of it elsewhere in the file and customize the copy.

    Here is the sample public window database service entry that appears in the c8-services.xml file. As with other examples in this guide, some items appear in italics. These are stand-in values, for which you must provide the actual information. For example, replace
    
    user-name
    
    with the appropriate user name.
    <!-- Sample Service Configuration for Public Window  -->
    	<Service Name="
    MyPublicWindowDB
    " 1 Type="DATABASE"2 >
    	   
    	  <Description>
    	    Sample Service Configuration for DB Subqueries (Public Windows)
    	  </Description>3	   
    	  <!-- DBDriverType should be set to DBDriverPublicWindows -->
    	  <Param Name="DBDriverType">DBDriverPublicWindows4</Param>
    	  <!-- DBDriverConnectString should be set to:
    	       ccl://<your-manager-host>:<your-manager-port>/Project/
    	             <your-workspace-name>/<your-project-name>
    	       with <your-workspace-name> and <your-project-name> 
    	       corresponding to the workspace and name of the 
    	       top-level module containing the Public Window(s) 
    	       that you want to query -->
    	  <Param Name="DBDriverConnectString">
       \
    	            ccl://mymanager:1234/Project/MyWorkspace/MyProject5
    	  </Param>
    	  
    	  <!-- Set to an integer > 0 to enable caching -->
    	  <Param Name="CacheMaximumAge">06</Param>
    	  <!-- Set your Username and Password Appropriately if 
    	    your server configuration requires authentication
    	  -->
    	  <Param Name="Username">
    user-name7
    </Param>
    	  <Param Name="Password">
    password8
    </Param>
    	</Service>
    

    1

    Provide a unique service name for the public window service in the "Service Name" preference on this line. This name is case-sensitive, must begin with a letter and may contain letters, digits, underscores, dots and/or colons. The service name should be the same name as the name of the "database" service you use in your CCL queries. For example, if your database subquery is:

    ... 
    	FROM (DATABASE "PublicWindow1" SCHEMA "valuation.ccs" 
    	SELECT * FROM Stocks WHERE T.symbol=Stocks.symbol)
    

    The database name (PublicWindow1) in the database subquery should match the service name in the c8-services.xml file.

    2

    Set the "Type" preference on this line to DATABASE .

    3

    Optionally, add a description of your service entry in the "Description" element.

    4

    Set the "DBDriverType" preference on this line to DBDriverPublicWindows. This preference indicates the type of driver used to communicate with the external "database".

    5

    Enter the ccl: URI of the project that contains the public window in the "DBDriverConnectString" preference on this line.

    6

    This line allows you to specify how long the Sybase CEP Server should keep a cached copy of the information that it read from the public window.

    For more information about caching, see "Caching Data from an External Database, RPC Server, or Public Window".

    7

    If the public window being set up as a service is using the Sybase CEP Server's user authentication feature, indicate the user name that Sybase CEP Engineshould use when communicating with the Sybase CEP Server that contains the public window in the "Username" preference on this line.

    Note that this value is unencrypted: anyone who has access to the c8-services.xml file will be able to read the user name.

    8

    If the public window being set up as a service is using the Sybase CEP Server's user authentication feature, indicate the password that Sybase CEP Engine should use when communicating with the Sybase CEP Server that contains the public window in the "Password" preference, on this line.

    Like the user name above it, the password is unencrypted.

    If you want to connect to public windows in more than one project, create a separate section for each project.

    Here is an example of how you might set the configuration preferences.

    <Service Name="MyPublicWindowDB" Type="DATABASE">
    	  <Description>Sample Service Configuration for DB Subqueries (Public Windows)</Description>
    	  <!-- DBDriverType should be set to DBDriverPublicWindows -->
    	  <Param Name="DBDriverType">DBDriverPublicWindows</Param>
    	     
    	  <Param Name="DBDriverConnectString">ccl://mymanager:1234/Project/MyWorkspace/MyProject</Param>
    	  <!-- Set to an integer > 0 to enable caching -->
    	  <Param Name="CacheMaximumAge">0</Param>
    	  <!-- Set your Username and Password Appropriately if 
    	    your server configuration requires authentication 
    	  -->
    	  <Param Name="Username">Helen</Param>
    	  <Param Name="Password">Troy450BC</Param>
    	</Service>
    
  2. Set any desired optional preferences for the service entries you just created in the c8-services.xml file.

    Optional preferences are discussed further in "Setting Optional Preferences for Services". (Note that "MaxCallExecutionTime" and "DisableAbort" preferences do not apply to queries of public windows.)

Make sure that the project to which you are connecting is running properly before attempting to connect to it from another project.