Compiling and Running in Java

This section describes the steps and commands you need to compile and run projects in Java.

Navigate to the examples directory under the installation: sdk/java5/examples.

Enter the following command:

javac com/sybasec8/sdk/examples/Example_01_GettingDataFromAStream.java

Run the compiled project by entering the following command, replacing <PathToC8Compiler> with the full path to and name of the Sybase CEP compiler on your system, typically bin/c8_compiler under the installation directory:

java –Dc8.compilerPath=
<PathToC8Compiler>
 
 com.sybase.c8.sdk.examples.Example_01_GettingDataFromAStream

Running the example produces output that looks similar to this:

Ts,SensorID,Reading
1206999928816643,Rw,2.08615
1206999928926019,YH,9.3957
1206999929035394,Xo,6.69305
1206999929144770,qj,5.507
1206999929254146,N4,2.71035
1206999929363521,UF,4.9583
1206999929472897,rk,0.62637
1206999929582273,eV,4.72496
1206999929691649,TY,3.39727
1206999929801024,Mn,8.46074
1206999929910400,pY,1.80193
1206999930019776,OR,8.98612
1206999930129151,by,6.31523

The first line lists the column names from the schema, while the remaining output is a list of the rows from the data stream.