1
[csql.git] / demo / gateway / jdbc / README
blob86acef9518f137120a655f8c3ee9202977450973
1 ----------------------------------README---------------------------------------
2 This contains an example program that demonstrates usage of jdbc interface through gateway on cached table.
5 What it does?
6 -------------
7 It inserts 10 rows in cached table t1.
8 Select rows with f1 value 0 to 9 and displays
9 Update rows where f1 value is 0,2,4,6,8
10 Select rows with f1 value 0 to 9 and displays
11 Delete rows where f1 value is 0,3,6,9
12 Select rows with f1 value 0 to 9 and displays
15 How to compile
16 ----------
17 Use the make command to compile
19         $ make
21 How to run
22 ----------
23 1. Set CACHE_TABLE=true in csql.conf file
25 2. Set the necessary enviroment variables using the setup script
26    under the csql root directory
28         $ . ./setupenv.ksh
30 3. Add an entry into csqlds.conf using csqlds tool mentioned as below.
32     $ csqlds -U <tdbusername> -P <password> -D <dsnname> -N <tdbname> -a
34 4. Start the server 
35     $ csqlserver
36 Note# tdb->target database
38 5. Create table t1 with two fields f1 integer(primary key) and f2 of length 10 string in mysql and cache the table.
40         $ cachetable -t t1
42 6.  Run the class file created by make
44         $ java GwStmt
46 Output of example:
47 ------------------
48 Tuple value is 0 100
49 Tuple value is 1 101
50 Tuple value is 2 102
51 Tuple value is 3 103
52 Tuple value is 4 104
53 Tuple value is 5 105
54 Tuple value is 6 106
55 Tuple value is 7 107
56 Tuple value is 8 108
57 Tuple value is 9 109
58 After update, listing tuples:
59 Tuple value is 0 200
60 Tuple value is 1 101
61 Tuple value is 2 202
62 Tuple value is 3 103
63 Tuple value is 4 204
64 Tuple value is 5 105
65 Tuple value is 6 206
66 Tuple value is 7 107
67 Tuple value is 8 208
68 Tuple value is 9 109
69 After delete, listing tuples:
70 Tuple value is 1 101
71 Tuple value is 2 202
72 Tuple value is 4 204
73 Tuple value is 5 105
74 Tuple value is 7 107
75 Tuple value is 8 208