1.2 Beta release changes
[csql.git] / examples / jdbc / README
blob7dbaa4ca9f82ccb3d4e0b530f8f01209cf582420
1 ----------------------------------README---------------------------------------
2 This contains an example program that demonstates usage of jdbc interface.
4 What it does?
5 -------------
6 It creates table T1 with two fields f1 integer and f2 string.
7 Creates index on f1 field of T1 table.
8 Inserts 10 rows into the table T1, 1 insert per transaction
9 Update all rows where f1 field have even numbers
10 Delete all rows where f1 value is 0,3,6,9
11 Select rows with f1 value 0 to 9 and displays
12 Drop the table
14 How to compile
15 --------------
16 1. Make a copy of this directory in a writable area
17 2. Edit the Makefile and set the JAVAC variable to point to the javac
18    compiler on your system.
19 3. Use the make command to compile
20         $make
22 How to run
23 ----------
24 1. Set the CSQL_CONFIG_FILE environment variable to absolute path of csql.conf file.
25         $export CSQL_CONFIG_FILE=/tmp/csql.conf
26 2. Set the LD_LIBRARY_PATH environment variable to csql library path
27         $export LD_LIBRARY_PATH=$CSQL_INSTALL_ROOT/lib:$LD_LIBRARY_PATH
29 3. Set the CLASSPATH environment variable to csql jdbc jar 
30         $export CLASSPATH=.:$CLASSPATH:$CSQL_INSTALL_ROOT/lib/CSqlJdbcDriver.jar
31 4. Run the class file created by make
32         $java jdbcexample
34 Output of example:
35 ------------------
36 Table t1 created
37 Index created on T1 (f1) 
38 Total Rows inserted 10
39 Total Rows updated 5
40 Total Rows deleted 4
41 Tuple value is 1 101
42 Tuple value is 2 202
43 Tuple value is 4 204
44 Tuple value is 5 105
45 Tuple value is 7 107
46 Tuple value is 8 208
47 Total Rows selected 6
48 Dropped table T1