Datatype Mapping Understanding the Oracle CEP JDBC Data Cartridge
17.2 Using the Oracle CEP JDBC Data Cartridge
In general, you use the Oracle CEP JDBC data cartridge as follows: 1. Define the data sources in the Oracle CEP server config.xml file that are referenced by the Oracle CEP JDBC data cartridge contexts. The name used for a data source during its configuration in Oracle CEP server config.xml is used while configuring the JDBC cartridge context, using the data-source property, as shown in Example 17–4 . To use the Oracle JDBC version 11.2 driver bundled with Oracle CEP, in the Oracle CEP server config.xml file, create a data-source element for your driver version and add a driver-params child element as Example 17–5 shows. Example 17–5 driver-params Child Element driver-params urljdbc:oracle:thin:lcw2k18:1531:lcw101url driver-nameoracle.jdbc.xa.client.OracleXADataSourcedriver-name properties elementnameusernamevaluescottvalueelement elementnamepasswordnamevalue{3DES}EoIfSBMhnW8=valueelement elementnamecom.bea.core.datasource.serviceNamenamevalueoracle11.2gvalueelement elementnamecom.bea.core.datasource.serviceVersionnamevalue11.2.0valueelement elementnamecom.bea.core.datasource.serviceObjectClassnamevaluejava.sql.Drivervalueelement properties use-xa-data-source-interfacetrueuse-xa-data-source-interface driver-params For more information, see: ■ Configuring JDBC for Oracle CEP in the Oracle Complex Event Processing Administrators Guide ■ Configuring Access to a Different Database Driver or Driver Version in the Oracle Complex Event Processing Administrators Guide 2. Declare and define an Oracle CEP JDBC cartridge application-scoped context. For more information, see Section 17.1.4, Oracle CEP JDBC Data Cartridge Application Context . Note: To use the Oracle CEP JDBC data cartridge, your data source must use Oracle JDBC driver version 11.2 or higher. 17-6 Oracle Complex Event Processing CQL Language Reference 3. Define one or more SQL statements in the jc:jdbc-ctx element in the component configuration file. For more information, see Section 17.2.1, Defining SQL Statements: function Element. 4. If you specify the function element return-component-type child element as a Java bean, implement the bean and ensure that the class is on your Oracle CEP application classpath. Example 17–6 shows a typical implementation. Example 17–6 Example return-component-type Class package com.oracle.cep.example.jdbc_cartridge; public class RetEvent { public String employeeName; public String employeeEmail; public String description; Default constructor is mandatory public RetEvent1 {} May contain getters and setters for the fields public String getEmployeeName { return this.employeeName; } public void setEmployeeNameString employeeName { this.employeeName = employeeName; } ... May contain other helper methods public int getEmployeeNameLength { return employeeName.length; } } You must declare the fields as public. The return-component-type class for a JDBC cartridge context function must have a one-to-one mapping for fields in the SELECT list of the SQL query that defines the function. In other words, every field in the SELECT list of the SQL query defining a function must have a corresponding field matching name in the Java class that is declared to be the return-component-type for that function; otherwise Oracle CEP throws an error. For example, note how the SELECT items in the function in Example 17–4 match the field names in Example 17–6 . For more information, see: ■ Section 17.2.1.2.2, return-component-type ■ Oracle CEP IDE for Eclipse Projects in the Oracle Complex Event Processing Developers Guide for Eclipse 5. Define one or more Oracle CQL queries that call the SQL statements defined in the jc:jdbc-ctx element using the Oracle CQL TABLE clause and access the returned results by SQL SELECT list alias names.Parts
» Oracle Fusion Middleware Online Documentation Library
» Streams and Channels Oracle CEP represents a stream as a channel as
» Channel Schema The event source you connect to a stream determines the
» Querying a Channel Once the event source, channel, and processor are
» Controlling Which Queries Output to a Downstream Channel If you specify more
» Relations Relations and Oracle CEP Tuple Kind Indicator
» Range, Rows, and Slide at Query Start-Up and for Empty Relations The descriptions
» Partition Stream-to-Relation Operators Windows
» Default Stream-to-Relation Operator Stream-to-Relation Operators Windows
» Relation-to-Relation Operators Stream-to-Stream Operators
» Event Sources Event Sources and Event Sinks
» Relational Database Table Event Sources
» Function Table Event Sources
» Pattern Recognition Cache Event Sources Functions
» Data Cartridges Fundamentals of Oracle CQL
» Lexical Conventions Oracle CQL Statements
» Oracle CQL and SQL Standards
» Oracle CEP Visualizer Oracle CEP Tools
» Oracle CQL Built-in Datatypes
» Numeric Values Datatype Comparison Rules
» Date Values Datatype Comparison Rules
» Implicit Datatype Conversion Datatype Conversion
» Explicit Datatype Conversion Datatype Conversion
» SQL Datatype Conversion Datatype Conversion
» Oracle Data Cartridge Datatype Conversion
» User-Defined Function Datatype Conversion
» Integer Literals Numeric Literals
» Floating-Point Literals Numeric Literals
» Text Literals Datetime Literals
» Number Format Models Format Models
» Aliases in the relation_variable Clause
» How to Define a Data Type Alias Using the Aliases Element
» Schema Object Naming Guidelines Schema Object Naming Examples
» ELEMENT_TIME for a System-Timestamped Stream
» Using ELEMENT_TIME With SELECT
» Using ELEMENT_TIME With GROUP BY
» Using ELEMENT_TIME With PATTERN
» What You May Need to Know About Unary and Binary Operators
» What You May Need to Know About Operator Precedence
» Comparison Conditions Oracle Fusion Middleware Online Documentation Library
» Logical Conditions Oracle Fusion Middleware Online Documentation Library
» Range Conditions Oracle Fusion Middleware Online Documentation Library
» Null Conditions Compound Conditions
» Using IN and NOT IN as a Set Operation Using IN and NOT IN as a Membership Condition
» Introduction to Common Oracle CQL DDL Clauses
» Introduction to Oracle CQL Built-In Single-Row Functions
» Built-In Aggregate Functions and the Where, Group By, and Having Clauses
» Introduction to Oracle CQLBuilt-In Single-Row Colt Functions
» double c Oracle Fusion Middleware Online Documentation Library
» Introduction to Oracle CQL Built-In java.lang.Math Functions
» User-Defined Single-Row Functions Types of User-Defined Functions
» How to Implement a User-Defined Single-Row Function
» How to Implement a User-Defined Aggregate Function
» Data Cartridge Name Data Cartridge Application Context
» Oracle CQL Data Cartridge Types
» Application Class Space Policy
» No Automatic Import Class Space Policy Server Class Space Policy
» Class Loading Example Class Loading
» Data Cartridge Name Method Resolution
» How to Query Using the Java API How to Query Using Exported Java Classes
» Data Cartridge Name Understanding Oracle Spatial
» Element Info Array Ordinates and Coordinate Systems and the SDO_SRID
» Geometric Relation Operators Scope
» com.oracle.cep.cartridge.spatial.Geometry Methods
» oracle.spatial.geometry.JGeometry Methods The following JGeometry public
» Datatype Mapping Oracle Spatial Application Context
» How to Access the Geometry Types That the Oracle Spatial Java API Supports
» How to Create a Geometry How to Access Geometry Type Public Methods and Fields
» Data Cartridge Name Understanding the Oracle CEP JDBC Data Cartridge
» Scope Understanding the Oracle CEP JDBC Data Cartridge
» Datatype Mapping Understanding the Oracle CEP JDBC Data Cartridge
» function Element Attributes Defining SQL Statements: function Element
» Multiple Parameter JDBC Cartridge Context Functions Using the Oracle CEP
» Overloading JDBC Cartridge Context Functions Using the Oracle CEP JDBC data
» Using SELECT List Aliases Using the TABLE Clause
» Using a Native CQL Type as a return-component-type
» How to Create an Oracle CQL Query
» Where Clause Query Building Blocks
» MATCH_RECOGNIZE Query Queries
» Relational Database Table Query XMLTable Query
» Function TABLE Query Queries
» Sorting Query Results Queries
» Detecting Differences in Query Results
» Parameterized Queries in Oracle CQL Statements
» The bindings Element Parameterized Queries
» Run-Time Query Naming Lexical Conventions for Parameter Values
» Views and Joins Views and Schemas
» Cache Key First and Simple Equality No Arithmetic Operations on Cache Keys
» Oracle CQL Queries and Oracle Data Cartridges
» MATCH_RECOGNIZE and the WHERE Clause Referencing Singleton and Group Matches
» Running Aggregates and Final Aggregates
» Operating on the Same Correlation Variable Referencing Variables That Have not Been Matched Yet
» Using prev Understanding Pattern Recognition With MATCH_RECOGNIZE
» Functions Over Correlation Variables in the MEASURES Clause
» Pattern Quantifiers and Regular Expressions
» Referencing One Correlation Variable From Another in the DEFINE Clause
» PARTITION BY Clause Oracle Fusion Middleware Online Documentation Library
» ORDER BY Clause ALL MATCHES Clause
» WITHIN Clause Oracle Fusion Middleware Online Documentation Library
» Fixed Duration Non-Event Detection
» Recurring Non-Event Detection DURATION Clause
» INCLUDE TIMER EVENTS Clause SUBSET Clause
» Pattern Detection MATCH_RECOGNIZE Examples
» Pattern Detection With PARTITION BY
Show more