Configuring JDBC for Oracle CEP 13-9
Each service registration will be made with a name property set to oracle11g and a version property with a value of 11.2.0.
Example 13–5 shows the Oracle
CEP server log messages showing the registration of the services.
Example 13–5 Service Registration Log Messages
... INFO: [Jun 29, 2006 5:54:18 PM] Service REGISTERED: { version=11.2.0, name=oracle11g,
objectClass=[ javax.sql.XADataSource ], service.id=23 } INFO: [Jun 29, 2006 5:54:18 PM] Service REGISTERED: { version=11.2.0, name=oracle11g,
objectClass=[ java.sql.Driver ], service.id=24 } INFO: [Jun 29, 2006 5:54:18 PM] Bundle oracle11g STARTED
...
3. Copy the bundler JAR to the Oracle CEP server library extensions directory.
Because your Oracle CEP application is an application library which contains a driver, you copy it to the Oracle CEP server library extensions directory is the
DOMAIN_DIR servernamemodulesext directory, where DOMAIN_DIR refers
to the domain directory such as oracle_cepuser_ projectsdomainsmydomain and servername refers to the server instance,
such as myserver. For example:
c:\oracle_cep\user_projects\domains\mydomain\myserver\modules\ext For more information, see Library Extensions Directory in the Oracle Complex
Event Processing Developers Guide for Eclipse.
4. In the Oracle CEP server config.xml file, create a custom data-source
element for your driver version and add a driver-params child element as Example 13–6
shows. For more information, see Section 1.3.1, Oracle CEP Server
Configuration Files .
Example 13–6 driver-params Child Element
driver-params urljdbc:oracle:thin:lcw2k18:1531:lcw101url
driver-nameoracle.jdbc.xa.client.OracleXADataSourcedriver-name properties
element nameusername
valuescottvalue element
element namepasswordname
value{3DES}EoIfSBMhnW8=value element
element
namecom.bea.core.datasource.serviceNamename valueoracle11gvalue
element element
namecom.bea.core.datasource.serviceVersionname value11.2.0value
Table 13–2 Factory Class and Service Interfacee
Factory Class Service Interface
oracle.jdbc.xa.client.OracleXADataSource javax.sql.XADataSource
oracle.jdbc.OracleDriver java.sql.Driver
13-10 Oracle Complex Event Processing Administrators Guide
element element
namecom.bea.core.datasource.serviceObjectClassname valuejavax.sql.XADataSourcevalue
element properties
use-xa-data-source-interfacetrueuse-xa-data-source-interface driver-params
Table 13–4 describes the relevant properties.
For more information, see Section 13.2.2, Custom Data Source Configuration
.
5. Stop and start the Oracle CEP server.
For more information, see Section 1.5.4, Starting and Stopping Oracle CEP
Servers .
13.5.2 How to Access a Database Driver Using an Application Library Built With Oracle CEP IDE for Eclipse
This procedure describes how to create an OSGi bundle for your driver using the Oracle CEP IDE for Eclipse and deploy it on the Oracle CEP server.
This is the preferred method. If do not wish to manually configure the activator implementation, see
Section 13.5.1, How to Access a Database Driver Using an Application Library Built With bundler.sh
. For more information, see Creating Application Libraries in the Oracle Complex Event
Processing Developers Guide for Eclipse.
To access a database driver using an application library built with Oracle CEP IDE for Eclipse:
1. Using the Oracle CEP IDE for Eclipse, create a new Oracle CEP project.
For more information, see Creating Oracle CEP Projects in the Oracle Complex Event Processing Developers Guide for Eclipse.
2. Right-click your project folder and select New Folder.
3. Enter lib in the Folder name field and click Finish.
4. Outside of the Oracle CEP IDE for Eclipse, copy your JDBC JAR file into the lib
folder.
5. Inside the Oracle CEP IDE for Eclipse, right-click the lib folder and select
Refresh
. The JAR file appears in the lib folder as
Figure 13–2 shows.
Table 13–3 driver-params Child Element Properties
Property Description
com.bea.core.datasource.serviceName Specifies the value of the serviceName registration property.
This must match the NAME property in your Activator class. com.bea.core.datasource.serviceVersion
Specifies the value of the serviceVersion registration property. This must match the VERSION property in your Activator class.
com.bea.core.datasource.serviceObjectClass Specifies the interface name of the OSGI service registration.