This section contains information on the following subjects:
Note: | This section describes in general how to configure database access using JDBC data sources. Oracle CEP includes a Type 4 JDBC drivers from DataDirect for SQL Server; for specific information about them, see Oracle CEP Type 4 JDBC Drivers. |
Oracle Complex Event Processing, or Oracle CEP for short, supports Java Database Connectivity (JDBC) 3.0 for relational database access.
The
JDBC API provides a standard, vendor-neutral mechanism for connecting to and interacting with database servers and other types of tabular resources that support the API. The JDBC javax.sql.DataSource
interface specifies a database connection factory that is implemented by a driver. Instances of DataSource
objects are used by applications to obtain database connections (instances of java.sql.Connection
). After obtaining a connection, an application interacts with the resource by sending SQL commands and receiving results.
WebLogic Event Server provides the following JDBC drivers:
ORACLE_CEP_HOME
/modules/com.bea.oracle.ojdbc5_11.1.0.6.jar
and ORACLE_CEP_HOME
/modules/com.bea.oracle.ojdbc6_11.1.0.6.jar
files)
WebLogic Event Server also provides a DataSource
abstraction that encapsulates a JDBC driver DataSource
object and manages a pool of pre-established connections.
Oracle CEP provides a Type 4 JDBC driver from DataDirect for high-performance JDBC access to the SQL Server database. The Type 4 JDBC driver is optimized for the Java environment, allowing you to incorporate Java technology and extend the functionality and performance of your existing system. For detailed information about using the two drivers, see Oracle CEP Type 4 JDBC Drivers.
The Oracle CEP Type 4 JDBC drivers from DataDirect are proven drivers that:
Table 10-1 shows the databases supported by each of the Oracle CEP Type 4 JDBC drivers.
Oracle CEP DataSource
provides a JDBC data source connection pooling implementation that supports the Java Database Connectivity (JDBC 3.0) specification. Applications reserve and release Connection
objects from a data source using the standard DataSource.getConnection
and Connection.close
APIs respectively.
You are required to configure an Oracle CEP DataSource
in the server's config.xml
file if you want to access a relational database from an EPL rule
; for details, see
Configuring the Complex Event Processor. You do not have to configure a DataSource in the server's config.xml
file if you use the JDBC driver's API, such as DriverManager
, directly in your application code.
The Oracle CEP config.xml
file requires a configuration element for each data source that is to be created at runtime that references an external JDBC module descriptor.
When you create an Oracle CEP domain using the Configuration Wizard, you can optionally configure a JDBC data source that uses one of the two DataDirect JDBC drivers; in this case the wizard updates the config.xml
file for you. You configure the data source with basic information, such as the database you want to connect to and the connection username and password. You can also use the Configuration Wizard to update an existing server in a domain and add new data sources. For details about using the Configuration Wizard, see
Creating and Updating an Oracle CEP Standalone-Server Domain.
You can also update the config.xml file manually by adding a <data-source> element. The following snippet shows a sample data source configuration:
<data-source>
<name>epcisDS</name>
<driver-params>
<url>jdbc:sqlserver://localhost:1433;databaseName=myDB;SelectMethod=cursor</url>
<driver-name>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-name>
<properties>
<element>
<name>user</name>
<value>juliet</value>
</element>
<element>
<name>password</name>
<value>{Salted-3DES}hVgC5iZ3nZA=</value>
</element>
</properties>
</driver-params>
</data-source>
<transaction-manager>
<name>TM</name>
<rmi-service-name>RMI</rmi-service-name>
</transaction-manager>
A data source depends on the availability of a local transaction manager, which you configure using the <transaction-manager>
element of config.xml
as shown above. The transaction manager in turn depends on a configured RMI object, as described in rmi Configuration Object.
For the full list of child elements of the <data-source>
element, in particular the <connection-pool-params>
and <data-source-params>
elements, see the
Schema.
The two type 4 JDBC drivers from DataDirect (Oracle and SQL Server) are automatically installed with Oracle CEP and ready to use.
config.xml
file by either using the Configuration Wizard or updating the config.xml
file manually.For details, see Data Source Configuration.
Follow these steps to configure and use your own JDBC driver with Oracle CEP:
The name of the server start script is startwlevs.cmd
(Windows) or startwlevs.sh
(UNIX), and the script is located in the server directory of your domain directory. The out-of-the-box sample domains are located in ORACLE_CEP_HOME
/ocep_10.3/samples/domains
, and the user domains are located in ORACLE_CEP_HOME
/user_projects/domains
, where ORACLE_CEP_HOME
refers to the Oracle CEP installation directory, such as d:\oracle_cep
.
Update the start script by adding the -Xbootclasspath/a
option to the Java command that executes the wlevs_3.0.jar
file. Set the -Xbootclasspath/a
option to the full pathname of the JDBC driver you are going to use.
For example, if you want to use the Windows Oracle thin driver, update the java
command in the start script as follows (updated section shown in bold):
%JAVA_HOME%\bin\java -Dwlevs.home=%USER_INSTALL_DIR% -Dbea.home=%BEA_HOME% -Xbootclasspath/a:%USER_INSTALL_DIR%\bin\com.bea.oracle.ojdbc14_10.2.0.jar
-jar "%USER_INSTALL_DIR%\bin\wlevs_3.0.jar" -disablesecurity %1 %2 %3 %4 %5 %6
In the example, %USER_INSTALL_DIR%
points to ORACLE_CEP_HOME
\ocep_10.3
.
config.xml
file by either using the Configuration Wizard or updating the config.xml
file manually.For details, see Data Source Configuration.
java
option and data source information. See
Stopping and Starting the Server.