O'Reilly logo

Getting Started with Oracle Event Processing 11g by Lloyd Williams, Robin J. Smith, Alexandre Alves

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Blending CQL and Java

We explore the CQL and Java integration by walking through several scenarios. Let's start with a simple scenario, where we want to get a sub-string from the symbol event property, whose type is the CHAR native type. This is illustrated in the following example:

SELECT symbol.substring(0,2)
FROM marketFeed

First, CQL performs an implicit conversion between the CQL native CHAR data type and the Java String class. Next, you can invoke an instance method of a Java class instance in CQL by using the . (dot) operator, very much like you would do normally in Java. In other words, the expression symbol.substring(…) invokes the method String java.lang.String.substring(intbeginIndex, intendIndex) in the object represented by the property ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required