Statistics
| Revision:

root / tmp / org.txm.core / src / groovy / org / txm / scripts / HSQLFunctions.groovy @ 187

History | View | Annotate | Download (18.5 kB)

1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate: 2016-07-04 16:11:30 +0200 (Mon, 04 Jul 2016) $
25
// $LastChangedRevision: 3257 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.scripts;
29

    
30
import java.util.LinkedList;
31

    
32
import groovy.sql.Sql;
33

    
34
import java.sql.*;
35
import java.util.HashMap;
36
import java.util.LinkedHashSet;
37
import java.util.logging.Level;
38

    
39
import org.txm.utils.logger.Log;
40

    
41
// TODO: Auto-generated Javadoc
42
/**
43
 * set of Sql function for HSQL.
44
 *
45
 * @return the connection
46
 * @author mdecorde
47
 */
48
class HSQLFunctions {
49
        
50
        Connection c
51
        String path;
52
        
53
        public HSQLFunctions(String path) {
54
                this.path = path;
55
                
56
                String urlProperty = "jdbc:hsqldb:file:"+path+"/db;shutdown=true;hsqldb.write_delay=false;"
57
                if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
58
                        urlProperty += "";
59
                } else {
60
                        urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0";
61
                }
62
                
63
                this.c = DriverManager.getConnection(urlProperty, "SA", "")
64
        }
65

    
66
        public Connection getConnection() {
67
                return c;
68
        }
69
        
70
        /**
71
         * Creates the table.
72
         *
73
         * @param name the name
74
         * @param argsname the argsname
75
         * @param types the types
76
         */
77
        public void CreateTable(String name)
78
        {
79
                Statement statement = c.createStatement();
80
                String query ="CREATE TABLE "+name+";";
81
                
82
                println("query : "+query);
83
                statement.executeUpdate(query);
84
                
85
                statement.close();
86
                c.commit();
87
        }
88
        
89
        /**
90
         * Creates the table.
91
         *
92
         * @param name the name
93
         * @param argsname the argsname
94
         * @param types the types
95
         */
96
        public void CreateTable(String name, String idColumn)
97
        {
98
                Statement statement = c.createStatement();
99
                String query = "CREATE TABLE \""+name+"\" (\""+idColumn+"\" INTEGER IDENTITY PRIMARY KEY);";
100
        
101
                println("query : "+query);
102
                statement.executeUpdate(query);
103
                
104
                statement.close();
105
                c.commit();
106
        }
107
        
108
        public boolean IsTableExisting(String name) {
109
                boolean e = false;
110
                
111
                DatabaseMetaData dbm = c.getMetaData();
112
                ResultSet tables = dbm.getTables(null, null, name, null);
113
                e = tables.next();
114
                tables.close()
115
                
116
                return e;                
117
        }
118
        
119
        
120
        /**
121
         * Creates the table.
122
         *
123
         * @param name the name
124
         * @param argsname the argsname
125
         * @param types the types
126
         */
127
        public void CreateTable(String name, def argsname, def types)
128
        {
129
                assert(argsname.size() == types.size());
130
                
131
                Statement statement = c.createStatement();
132
                String query ="CREATE TABLE "+name+" ( ";
133
                for (int i=0; i < types.size() ; i++) {
134
                        query += argsname[i]+" "+types[i]
135
                        if (i < types.size()-1)        {query += ",";}
136
                }
137
                query +=")";
138
                
139
                println("query : "+query);
140
                statement.executeUpdate(query);
141
                
142
                statement.close();
143
                c.commit();
144
        }
145
        
146
        
147
        public void DeleteTable(String name) {
148
                Statement statement = c.createStatement();
149
                statement.executeUpdate("DROP TABLE entries;");
150
                statement.close();
151
                c.commit();
152
        }
153

    
154
        /**
155
         * Insert csv col.
156
         *
157
         * @param TableName the table name
158
         * @param argsnames the argsnames
159
         * @param types the types
160
         * @param csvFile the csv file
161
         * @param separator the separator
162
         * @param encoding the encoding
163
         */
164
        public void InsertCsvCol(String TableName, def argsnames, def types, File csvFile, String separator, String encoding)
165
        {
166
                Statement statement = c.createStatement();
167
                statement.setEscapeProcessing(true);
168
                Reader reader = new InputStreamReader(new FileInputStream(csvFile),encoding);
169
                reader.splitEachLine(separator) {fields ->
170
                        //println("fields size "+fields.size())
171
                        String query ="INSERT INTO "+TableName+" (";
172
                        for(int i=0;i< argsname.size; i++)
173
                        {
174
                                query+= argsname[i];
175
                                if(i < argsnames.size-1)        {query += ",";}
176
                        }
177
                        query +=") VALUES (";
178
                        for(int i=0;i< fields.size(); i++)
179
                        {
180
                                if(fields[i].contains("'"))
181
                                        query+= "'"+fields[i].replace("'","''")+"'";
182
                                else
183
                                        query+= "'"+fields[i]+"'";
184
                                
185
                                if(i < argsnames.size-1)        {query += ",";}
186
                        }
187
                        query +=")";
188
                        
189
                        //println("query : "+query);
190
                        statement.executeUpdate(query);
191
                }
192
                statement.close();
193
                c.commit();
194
        }
195

    
196
        /**
197
         * Import ordered csv table.
198
         *
199
         * @param TableName the table name
200
         * @param argsname the argsname
201
         * @param types the types
202
         * @param csvFile the csv file
203
         * @param separator the separator
204
         * @param encoding the encoding
205
         * @return the int
206
         */
207
        public int ImportOrderedCSVTable(String TableName, List<String> argsname, List<String> types, File csvFile, String separator, String encoding)
208
        {
209
                argsname.add("n");
210
                types.add("INT");
211
                HSQLFunctions.CreateTable( TableName, argsname, types);
212
                argsname.remove("n");
213
                types.remove("INT");
214
                Statement statement = c.createStatement();
215
                statement.setEscapeProcessing(true);
216
                Reader reader = new InputStreamReader(new FileInputStream(csvFile),encoding);
217
                int n=0;
218
                reader.splitEachLine(separator) {fields ->
219
                        n++;
220
                        //println("fields size "+fields.size())
221
                        String query ="INSERT INTO "+TableName+" (n,";
222
                        for(int i=0;i< argsname.size(); i++)
223
                        {
224
                                query+= argsname[i];
225
                                if(i < argsname.size()-1)        {query += ",";}
226
                        }
227
                        query +=") VALUES ('"+n+"',";
228
                        for(int i=0;i< argsname.size(); i++)
229
                        {
230
                                if( i >= fields.size())
231
                                {
232
                                        query+= "''";
233
                                }
234
                                else
235
                                {
236
                                        if(fields[i].contains("'"))
237
                                                query+= "'"+fields[i].replace("'","''")+"'";
238
                                        else
239
                                                query+= "'"+fields[i]+"'";
240
                                }
241
                                if(i < argsname.size()-1)        {query += ",";}
242
                        }
243
                        query +=")";
244
                        
245
                        //println("query : "+query);
246
                        statement.executeUpdate(query);
247
                }
248
                statement.close();
249
                c.commit();
250
                return n;
251
        }
252

    
253
        /**
254
         * Import csv table.
255
         *
256
         * @param TableName the table name
257
         * @param argsname the argsname
258
         * @param types the types
259
         * @param csvFile the csv file
260
         * @param separator the separator
261
         * @param encoding the encoding
262
         */
263
        public void ImportCSVTable(String TableName, def argsname, def types, File csvFile, String separator, String encoding)
264
        {
265
                HSQLFunctions.CreateTable( TableName, argsname, types);
266
                
267
                Statement statement = c.createStatement();
268
                statement.setEscapeProcessing(true);
269
                Reader reader = new InputStreamReader(new FileInputStream(csvFile),encoding);
270
                reader.splitEachLine(separator) {fields ->
271
                        //println("fields size "+fields.size())
272
                        String query ="INSERT INTO "+TableName+" (";
273
                        for(int i=0;i< argsname.size; i++)
274
                        {
275
                                query+= argsname[i];
276
                                if(i < argsname.size-1)        {query += ",";}
277
                        }
278
                        query +=") VALUES (";
279
                        for(int i=0;i< argsname.size; i++)
280
                        {
281
                                if( i >= fields.size())
282
                                {
283
                                        query+= "''";
284
                                }
285
                                else
286
                                {
287
                                        if(fields[i].contains("'"))
288
                                                query+= "'"+fields[i].replace("'","''")+"'";
289
                                        else
290
                                                query+= "'"+fields[i]+"'";
291
                                }
292
                                if(i < argsname.size-1)        {query += ",";}
293
                        }
294
                        query +=")";
295
                        
296
                        //println("query : "+query);
297
                        statement.executeUpdate(query);
298
                }
299
                statement.close();
300
                c.commit();
301
        }
302

    
303
        // word column val column val2 column val3
304
        
305
        /**
306
         * Import ref table.
307
         *
308
         * @param TableName the table name
309
         * @param argsname the argsname
310
         * @param types the types
311
         * @param csvFile the csv file
312
         * @param separator the separator
313
         * @param encoding the encoding
314
         */
315
        public void ImportRefTable(String TableName, def argsname, def types, File csvFile, String separator, String encoding)
316
        {
317
                HSQLFunctions.CreateTable( TableName, argsname, types);
318
                
319
                Statement statement = c.createStatement();
320
                statement.setEscapeProcessing(true);
321
                Reader reader = new InputStreamReader(new FileInputStream(csvFile),encoding);
322
                reader.splitEachLine(separator) 
323
                                {fields ->
324
                                        String ref;
325
                                        if(fields[0].contains("'"))
326
                                                ref= "'"+fields[0].replace("'","''")+"'";
327
                                        else
328
                                                ref= "'"+fields[0]+"'";
329
                                        
330
                                        for(int j=1 ; j < fields.size() ; j +=argsname.size -1)
331
                                        {
332
                                                String query ="INSERT INTO "+TableName+" (";
333
                                                for(int i=0;i< argsname.size; i++)
334
                                                {
335
                                                        query+= argsname[i];
336
                                                        if(i < types.size-1)        {query += ",";}
337
                                                }
338
                                                query +=") VALUES (";
339
                                                query+= ref+",";
340
                                                for(int i=j;i < j+argsname.size -1; i++)
341
                                                {
342
                                                        if(fields[i].contains("'"))
343
                                                                query+= "'"+fields[i].replace("'","''")+"'";
344
                                                        else
345
                                                                query+= "'"+fields[i]+"'";
346
                                                        
347
                                                        if(i < j+argsname.size -2)        {query += ",";}
348
                                                }
349
                                                query +=")";
350
                                                
351
                                                //println("query : "+query);
352
                                                statement.executeUpdate(query);
353
                                        }
354
                                }
355
                statement.close();
356
                c.commit();
357
        }
358

    
359
        /**
360
         * Creates the simple table.
361
         *
362
         * @param TableName the table name
363
         * @param argsname the argsname
364
         * @param type the type
365
         * @param values the values
366
         */
367
        public void CreateSimpleTable(String TableName, String argsname , String type, def values)
368
        {
369
                def argsnames = [argsname];
370
                def types = [type]
371
                HSQLFunctions.CreateTable( TableName, argsnames, types);
372
                
373
                Statement statement = c.createStatement();
374
                for(int i=0; i < values.size; i++)
375
                {
376
                        String query ="INSERT INTO "+TableName+" (";
377
                        query+= argsname;
378
                        query +=") VALUES ('";
379
                        query+= values[i];
380
                        query +="')";
381
                        
382
                        println("query : "+query);
383
                        statement.executeUpdate(query);
384
                }
385
                statement.close();
386
                c.commit();
387
        }
388

    
389
        /**
390
         * Test.
391
         *
392
         * @param table the table
393
         * @param file the file
394
         * @return the java.lang. object
395
         */
396
        public test(String table, String file) {
397
                Statement statement = c.createStatement();
398

    
399
                statement.execute("SET TABLE " + table + " SOURCE \"" + file
400
                                + ";ignore_first=false;all_quoted=false\"");
401
                statement.close();
402
                c.commit();
403
        }
404

    
405
        // fonction temporaire, j'ai rien trouvé de mieux -_-
406
        
407
        /**
408
         * Gets the column number.
409
         *
410
         * @param TableName the table name
411
         * @return the column number
412
         */
413
        public int getColumnNumber(String TableName)
414
        {
415
                Sql sql = Sql.newInstance(c)
416
                int i =0;
417
                try {
418
                        sql.eachRow("select * from "+TableName) {
419
                                for(i=0;;i++)
420
                                        it.getAt(i);
421
                        }
422
                }
423
                catch(Exception e)
424
                {
425
                        return i;
426
                }
427
                
428
                c.close();
429
                return 0;
430
        }
431

    
432
        /**
433
         * Prints the table.
434
         *
435
         * @param TableName the table name
436
         */
437
        public void printTable(String TableName)
438
        {
439
                Sql sql = Sql.newInstance(c)
440
                int colnum = getColumnNumber(TableName);
441
                sql.eachRow("select * from "+TableName) {
442
                        for(int i=0;i< colnum; i++)
443
                        {
444
                                print(it.getAt(i));
445
                                if(i < colnum -1)print("\t");
446
                        }
447
                        println();
448
                }
449
                
450
                c.commit();
451
        }
452

    
453
        /**
454
         * Execute query.
455
         *
456
         * @param query the query
457
         */
458
        public void executeQuery(String query) {
459
                Statement statement = c.createStatement();
460
                statement.setEscapeProcessing(true);
461
                println("query : " + query);
462
                statement.execute(query);
463
                statement.close();
464
                c.commit();
465
        }
466

    
467
        /**
468
         * Gets the groovy sql.
469
         *
470
         * @return the groovy sql
471
         */
472
        public Sql getGroovySql() {
473
                return Sql.newInstance(c)
474
        }
475

    
476
        /**
477
         * To cvs file.
478
         *
479
         * @param TableName the table name
480
         * @param outfile the outfile
481
         */
482
        public void toCVSFile(String TableName, String outfile) {
483
                def sql = Sql.newInstance(c)
484
                
485
                Writer writer = new FileWriter(outfile);
486
                
487
                int colnum = getColumnNumber(TableName);
488
                sql.eachRow("select * from "+TableName) {
489
                        for(int i=0;i< colnum; i++)
490
                        {
491
                                //println('get at '+i)
492
                                writer.write(it.getAt(i));
493
                                if(i < colnum -1)writer.write("\t");
494
                        }
495
                        writer.write("\n");
496
                }
497
                
498
                writer.close();
499
                c.commit();
500
        }
501

    
502
        // only for sql result with 3 columns
503
        
504
        /**
505
         * To ref file.
506
         *
507
         * @param TableName the table name
508
         * @param outfile the outfile
509
         * @param groupcolumn the groupcolumn
510
         * @param argname the argname
511
         * @param encoding the encoding
512
         * @return the int
513
         */
514
        public int toRefFile(String TableName, String outfile, String groupcolumn,def argname, String encoding)
515
        {
516
                assert(argname.size() == 2);
517
                def sql = Sql.newInstance(c)
518
                LinkedList<String> linkset;
519
                File f = new File(outfile);
520
                Writer writer = new BufferedWriter(new OutputStreamWriter(new PrintStream(new FileOutputStream(f),true,encoding)));
521
                def content = new File(outfile).getText(encoding) 
522
                int colnum = getColumnNumber(TableName);
523
                String ref = "";
524
                String line ="";
525
                boolean firstline = true;
526
                HashMap<String,LinkedList<String>> reftable = new HashMap<String,LinkedList<String>>();
527
                HashMap<String,LinkedList<String>> lemmetable = new HashMap<String,LinkedList<String>>();
528
                
529
                String query = "SELECT "+groupcolumn;
530
                for (String s : argname)
531
                        query +=","+s
532
                //System.out.println(query+" FROM "+TableName)
533
                sql.eachRow(query+" FROM "+TableName){
534
                        String currentref = it.getAt(0);
535
                        if (!reftable.containsKey(currentref)) {
536
                                linkset = new LinkedHashSet<String>();
537
                                reftable.put(currentref,linkset)
538
                                linkset = new LinkedHashSet<String>();
539
                                lemmetable.put(currentref,linkset)
540
                        }
541
                        
542
                        linkset = reftable.get(currentref)
543
                        if (!linkset.contains(it.getAt(1))) {
544
                                linkset.add(""+it.getAt(1))
545
                                linkset = lemmetable.get(currentref)
546
                                linkset.add(""+it.getAt(2))
547
                        }
548
                }
549
                //println("ref : "+reftable)
550
                for (String key : reftable.keySet()) {
551
                        writer.write (key)
552
                        for (int i = 0 ; i < reftable.get(key).size(); i++) {
553
                                String s = (reftable.get(key)).get(i);
554
                                String l = (lemmetable.get(key)).get(i);
555
                                writer.write ("\t"+s+"\t"+l);
556
                        }
557
                        writer.write ("\n")
558
                }
559
                
560
                writer.close();
561
                c.commit();
562
                return reftable.size();
563
        }
564

    
565
        /**
566
         * To ref hierarchical file.
567
         *
568
         * @param TableName the table name
569
         * @param outfile the outfile
570
         * @param groupcolumn the groupcolumn
571
         * @param argname the argname
572
         * @param encoding the encoding
573
         * @return the int
574
         */
575
        public int toRefHierarchicalFile(String TableName, String outfile, String groupcolumn,def argname, String encoding)
576
        {
577
                assert(argname.size() == 2);
578
                def sql = Sql.newInstance(c);
579
                LinkedList<String> linkset;
580
                File f = new File(outfile);
581
                Writer writer = new BufferedWriter(new OutputStreamWriter(new PrintStream(new FileOutputStream(f),true,encoding)));
582
                def content = new File(outfile).getText(encoding);
583
                int colnum = getColumnNumber(TableName);
584
                String ref = "";
585
                String line ="";
586
                boolean firstline = true;
587
                HashMap<String,LinkedList<String>> reftable = new HashMap<String,LinkedList<String>>();
588
                //HashMap<String,HashMap<String,Integer>> counttable = new HashMap<String,HashMap<String,Integer>>();
589
                HashMap<String,LinkedList<Integer>> counttable = new HashMap<String,LinkedList<Integer>>();
590
                HashMap<String,LinkedList<String>> lemmetable = new HashMap<String,LinkedList<String>>();
591
                
592
                String query = "SELECT "+groupcolumn;
593
                for(String s : argname)
594
                        query +=","+s;
595
                //System.out.println(query+" FROM "+TableName)
596
                sql.eachRow(query+" FROM "+TableName){
597
                        String currentref = it.getAt(0);
598
                        if (!reftable.containsKey(currentref)) {
599
                                linkset = new LinkedHashSet<String>();
600
                                reftable.put(currentref,linkset);
601
                                linkset = new LinkedHashSet<String>();
602
                                lemmetable.put(currentref,linkset);
603
                        }
604
                        
605
                        linkset = reftable.get(currentref);
606
                        if (!linkset.contains(it.getAt(1))) {
607
                                linkset.add(""+it.getAt(1));
608
                                linkset = lemmetable.get(currentref);
609
                                linkset.add(""+it.getAt(2));
610
                        }
611
                        
612
                        
613
                        //if(it.getAt(2) != "-")
614
                        //{
615
                        if(!counttable.containsKey(currentref))
616
                                counttable.put(currentref, new HashMap<String,Integer>());
617
                        
618
                        HashMap<String,Integer> ht = counttable.get(currentref);
619
                        if(!ht.containsKey(it.getAt(1)))
620
                                ht.put(it.getAt(1),0);
621
                        
622
                        ht.put(it.getAt(1),ht.get(it.getAt(1)) +1)        
623
                        
624
                        //}
625
                }
626
                //println("countable : "+counttable)
627
                for (String key : counttable.keySet()) {
628
                        HashMap<String,Integer> ht = counttable.get(key);
629
                        LinkedList<String> indexorder = new LinkedList<Integer>();
630
                        
631
                        for(String cat : counttable.get(key).keySet())
632
                        {
633
                                if(indexorder.size() == 0)
634
                                {
635
                                        indexorder.add(cat)
636
                                }
637
                                else
638
                                {
639
                                        boolean inserted= false;
640
                                        for(int j = 0 ; j < indexorder.size();j++)
641
                                        {
642
                                                String comp = indexorder.get(j);
643
                                                if(ht.get(cat) > ht.get(comp))
644
                                                {
645
                                                        indexorder.add(j, cat);
646
                                                        inserted=true;
647
                                                        break;
648
                                                }
649
                                        }
650
                                        if(!inserted)
651
                                                indexorder.addLast(cat);
652
                                }
653
                        }
654
                        writer.write(key);
655
                        for (String cat : indexorder) {
656
                                
657
                                int i=0;
658
                                for(int r=0; r < reftable.get(key).size();r++)
659
                                        if((reftable.get(key)).get(r) == cat)
660
                                        {
661
                                                i=r;
662
                                                break;
663
                                        }
664
                                String s = (reftable.get(key)).get(i);
665
                                String l = (lemmetable.get(key)).get(i);
666
                                writer.write ("\t"+s+"\t"+l);
667
                        }
668
                        writer.write ("\n")
669
                }
670
                
671
                writer.close();
672
                c.commit();
673
                return reftable.size();
674
        }
675

    
676
        /**
677
         * Clear all.
678
         */
679
        public void clearAll() {
680
                new File(path, "db.script").delete();
681
                new File(path, "db.properties").delete();
682
                new File(path, "db.log").delete();
683
                new File(path, "db.tmp").deleteDir();
684
        }
685
        
686
        /**
687
         * Clear all.
688
         */
689
        public void close() {
690
                c.close();
691
        }
692

    
693
        /**
694
         * Main.
695
         *
696
         * @param args the args
697
         */
698
        public static void main(String[] args)
699
        {
700
                HSQLFunctions hsql = new HSQLFunctions("/home/mdecorde/TEMP")
701
                //hsql.clearAll();
702
                
703
        //        hsql.executeQuery("SELECT col1 from test where col1 LIKE '@'' ESCAPE '@' ")
704
                
705
                def argsname = ["n","col1","col2"];
706
                def types = ["INT","VARCHAR(30)","VARCHAR(30)"];
707
                
708
                hsql.CreateTable( "test", argsname, types);
709
                hsql.CreateTable( "test2", argsname, types);
710
                hsql.executeQuery("INSERT INTO test VALUES (1,'poeut',1)");
711
                hsql.executeQuery("INSERT INTO test VALUES (2,'poeut',2)");
712
                hsql.executeQuery("INSERT INTO test VALUES (3,'poeut',3)");
713
                hsql.executeQuery("INSERT INTO test VALUES (4,'poeut',4)");
714
                hsql.executeQuery("INSERT INTO test VALUES (5,'poeut',5)");
715
                hsql.executeQuery("INSERT INTO test VALUES (5,'poeut',1)");
716
                
717
                hsql.executeQuery("INSERT INTO test2 VALUES (11,'poeut',52)");
718
                hsql.executeQuery("INSERT INTO test2 VALUES (22,'poeut',42)");
719
                hsql.executeQuery("INSERT INTO test2 VALUES (33,'poeut',32)");
720
                hsql.executeQuery("INSERT INTO test2 VALUES (44,'poeut',22)");
721
                hsql.executeQuery("INSERT INTO test2 VALUES (45,'poeut',22)");
722
                hsql.executeQuery("INSERT INTO test2 VALUES (55,'poeut',12)");
723
                
724
                hsql.printTable("test")
725
                hsql.printTable("test2")
726

    
727
                hsql.close();
728
                
729
                //
730
                //hsql.CreateTable( "test", argsname, types);
731
                //        hsql.ImportOrderedCSVTable( "test", argsname, types, new File("~/xml/rgaqcj/lexicon/lex_R"),"\t","UTF-8");
732
                //hsql.test("test","test.csv");
733
                //def forms=["hello","pouet","truc"]
734
                //hsql.CreateSimpleTable("test","form","VARCHAR(20)",forms)
735
                //hsql.printTable("test");
736
                //hsql.executeQuery("SELECT col1 from test where col1 LIKE '@'' ESCAPE '@' ");
737
                
738

    
739
        }
740
}