xlang v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
xsql.xcs
浏览该文件的文档.
1//xlang
2
3package Sql{
4 public class SqlException : Exception{
5 public SqlException(){
6
7 }
8 public SqlException(int err, String sqlmessage){
9 errcode = err;
10 message = sqlmessage;
11 }
12 };
13
14 public class DatabaseNotSupportException : SqlException{
16 errcode = 0;
17 message = "not support method:" + sqlmessage;
18 }
19 };
20
21 public interface ConnPoolCallback{
22 Connection createConnection();
23 bool alive(Connection conn);
24 };
25
26 public class ConnectionPool{
27 static class connectorMgr{
28 public Connection pconnection;
29 public long timestamp;
30 };
31
32 List<connectorMgr> _pool = new List<connectorMgr>();
33 Map<int, bool> _error_map = new Map<int, bool>();
34
35 static const int TIMEOU_LIMIT = 300000;
36
38 int _active_cnt, _wait_time;
39 int _validtesttime, _maxIdleTime, _maxIdle;
40
41 ConnPoolCallback callback;
42
43
44 Connection allocate(){
45 Connection connector = callback.createConnection();
46 if (connector != nilptr){
47 _active_cnt++;
48 }
49 return connector;
50 }
51
52 public Connection getConnector(){
53 Connection connector = nilptr;
54 long lastactive = 0;
55
56 synchronized(_pool){
57 if (_maxConnect != 0){
58 while ((_pool.size() == 0) && (_active_cnt >= _maxConnect)){
59 _pool.wait();
60 }
61 }
62
63 do{
64 if (connector != nilptr){
65 _active_cnt--;
66 connector.close();
67 connector = nilptr;
68 }
69
70 lastactive = 0;
71
72 List.Iterator<connectorMgr> iter = _pool.iterator();
73 if (iter.hasNext()){
74 connectorMgr mgr = iter.get();
75 connector = mgr.pconnection;
76 lastactive = mgr.timestamp;
77 _pool.remove(iter);
78 }else{
79 break;
80 }
81
82 } while (test(connector, lastactive) == false);
83
84 if (connector == nilptr){
85 if ((_maxConnect == 0) || (_active_cnt < _maxConnect)){
86 connector = allocate();
87 }
88 }
89 }
90 return connector;
91 }
92
93 bool test(Connection conn, long lastactive){
94 if ( (_system_.currentTimeMillis() - lastactive) > _validtesttime){
95 return callback.alive(conn);
96 }
97 return true;
98 }
99
100 public void recycle(Connection connection){
101
102 int mysql_error = connection.getErrorCode();
103
104 if (_error_map.containsKey(mysql_error) == false){
105 synchronized(_pool){
106 connectorMgr mgr = new connectorMgr();
107 mgr.pconnection = connection;
108 mgr.timestamp = _system_.currentTimeMillis();
109
110 if (_maxIdleTime != 0){
111 List.Iterator<connectorMgr> it = _pool.iterator();
112
113 while (it != nilptr && it.hasNext()){
114 List.Iterator<connectorMgr> tmp = it.getNext();
115 connectorMgr pmt = it.get();
116
117 if ((mgr.timestamp - pmt.timestamp) > _maxIdleTime){
118 pmt.pconnection.close();
119 _pool.remove(it);
120 _active_cnt--;
121 }
122 it = tmp;
123 }
124 }
125
126
127
128 if (_maxIdle != 0){
129 while (_pool.size() > _maxIdle){
130 List.Iterator<connectorMgr> tmp = _pool.iterator();
131 connectorMgr pmt = tmp.get();
132 pmt.pconnection.close();
133 _pool.remove(tmp);
134 _active_cnt--;
135 }
136 }
137 _pool.add(mgr);
138 _pool.notify();
139 }
140 } else{
141 connection.close();
142 synchronized(_pool){
143 _active_cnt--;
144 }
145 }
146 }
147
159 public bool config(ConnPoolCallback _callback, String reset_error, int maxWait, int maxConnect, int maxIdle, int maxIdleTime, int validtesttime){
160
161 if (maxIdle != 0 && maxConnect != 0 && maxIdle >= maxConnect){
162 throw new IllegalArgumentException("Connector config failed : maxIdle >= maxConnect\n");
163 return false;
164 }
165
166 if (_callback == nilptr){
167 return false;
168 }
169
170 callback = _callback;
171
172 _validtesttime = validtesttime;
173
174 if (reset_error != nilptr){
175 String err_list = reset_error;
176 String[] elist = err_list.split(',');
177 for (int i = 0; i < elist.length; i++){
178 String str = elist[i];
179 str.trim(true);
180 _error_map.put(str.parseInt(), true);
181 }
182 }
183
184 if (maxWait != -1){
185 _wait_time = maxWait;
186 }
187
188 _maxIdle = maxIdle;
189 _maxConnect = maxConnect;
190 _maxIdleTime = maxIdleTime;
191 return true;
192 }
193
194 public void clear(){
195 synchronized(_pool){
196 _pool.clear();
197 _error_map.clear();
198 _wait_time = 0;
199 _maxConnect = 0;
200 _maxIdle = 0;
201 _active_cnt = 0;
202 _maxIdleTime = TIMEOU_LIMIT;
203 }
204 }
205 };
206
207 public class Database{
208 static Map<String, ConnectionRegister> _database = new Map<String, ConnectionRegister>();
209
210 public static bool reigstry(String name, ConnectionRegister reg){
211 synchronized(_database){
212 if (_database.containsKey(name) == false){
213 _database.put(name, reg);
214 return true;
215 }
216 }
217 return false;
218 }
219
220 public static Connection getConnection(String driverName){
221 synchronized(_database){
222 try{
223 ConnectionRegister cr = _database.get(driverName);
224 return cr.allocConnection(driverName);
225 }catch(Exception e){
226
227 }
228 }
229 return nilptr;
230 }
231
232
233 };
234
235 public interface ConnectionRegister{
236 Connection allocConnection(String drivername);
237 };
238
239 public interface Connection{
244 void create(String uri, String username, String pwd);
245
250 void setOption(int opt, Object option);
251
253
254 PreparedStatement prepareStatement(String sql);
255
256 Statement createStatement();
257
259
261
262 bool isClosed();
263
264 void close();
265 };
266
267
268 public class ResultSet{
269 public bool first();
270 public bool last();
271
272 public bool next();
273 public bool previous();
274
275 public bool isFirst();
276 public bool isLast();
277 public bool isEof();
278 public bool isValid();
279
280 public int getInt(String columnlabel);
281 public long getLong(String columnlabel);
282 public float getFloat(String columnlabel);
283 public double getDouble(String columnlabel);
284 public byte getByte(String columnlabel);
285 public bool getBoolean(String columnlabel);
286 public String getString(String columnlabel);
287
288 public int getInt(int columnIndex);
289 public long getLong(int columnIndex);
290 public float getFloat(int columnIndex);
291 public double getDouble(int columnIndex);
292 public byte getByte(int columnIndex);
293 public bool getBoolean(int columnIndex);
294 public String getString(int columnIndex);
295 public String getColumnName(int i);
296 public int findColumn(String);
297 public int getColumnCount();
298 public long getRowCount();
299 public int getRow();
300 public void close();
301 public int getColumnType(int ){return 0;}
302 };
303
304 public class Statement{
305 public int execute(String sql);
306 public ResultSet executeQuery(String sql);
307 public int executeUpdate(String sql);
308 public ResultSet getResult();
309 public void close();
310 public int get_changes(){return 0; }
311 public int get_lastInsertId(){return 0 ;}
312 };
313
314 public static class PreparedStatement : Statement{
315
319 int paramid = 0;
322 textSql = " " + sql + " ";
323 strsplit = textSql.split('?');
324 if (strsplit.length == 0){
325 throw new IllegalArgumentException("invalid sql");
326 }
327 strparams = new String[strsplit.length - 1];
328 }
329
330 public String safety(String str){
331 str = str.replace("\\", "\\\\");
332 str = str.replace("\"", "\\\"");
333 str = str.replace("\'", "\\\'");
334 str = str.replace("\`", "\\\`");
335 return "'" + str + "'";
336 }
337
338 public int execute(){
339 return execute(getSql());
340 }
341
342 public String getSql(){
343 String sqlout = strsplit[0];
344 int i = 1, c = strsplit.length;
345 for (; i < c; i++){
346 sqlout = sqlout + (strparams[i - 1] + strsplit[i]);
347 }
348 return sqlout;
349 }
350
351 public ResultSet executeQuery(){
352 return executeQuery(getSql());
353 }
354
355 public int executeUpdate(){
356 return executeUpdate(getSql());
357 }
358
359 public void setValue(String value){
360 if (paramid < strparams.length){
361 strparams[paramid++] = safety(value);
362 }else{
363 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
364 }
365 }
366
367 public void setValue(int value){
368 if (paramid < strparams.length){
369 strparams[paramid++] = String.format("%d",value);
370 }else{
371 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
372 }
373 }
374
375 public void setValue(long value){
376 if (paramid < strparams.length){
377 strparams[paramid++] = String.format("%d",value);
378 }else{
379 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
380 }
381 }
382
383 public void setValue(byte value){
384 if (paramid < strparams.length){
385 strparams[paramid++] = String.format("%02u",value & 0xff);
386 }else{
387 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
388 }
389 }
390
391 public void setValue(float value){
392 if (paramid < strparams.length){
393 strparams[paramid++] = "" + value;
394 }else{
395 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
396 }
397 }
398
399 public void setValue(double value){
400 if (paramid < strparams.length){
401 strparams[paramid++] = "" + value;
402 }else{
403 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
404 }
405 }
406
407 //--
408 public void setString(String value){
409 setValue(value);
410 }
411
412 public void setInt(int value){
413 setValue(value);
414 }
415
416 public void setLong(long value){
417 setValue(value);
418 }
419
420 public void setByte(byte value){
421 setValue(value);
422 }
423
424 public void setDouble(double value){
425 setValue(value);
426 }
427
428 public void setFloat(float value){
429 setValue((double)value);
430 }
431
432
433 public void setValue(int id, String value){
434 if ((id > 0) && (id - 1 < strparams.length)){
435 strparams[id - 1] = safety(value);
436 }else{
437 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
438 }
439 }
440
441 public void setValue(int id, int value){
442 if ((id > 0) && (id - 1 < strparams.length)){
443 strparams[id - 1] = String.format("%d",value);
444 }else{
445 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
446 }
447 }
448
449 public void setValue(int id, long value){
450 if ((id > 0) && (id - 1 < strparams.length)){
451 strparams[id - 1] = String.format("%d",value);
452 }else{
453 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
454 }
455 }
456
457 public void setValue(int id, byte value){
458 if ((id > 0) && (id - 1 < strparams.length)){
459 strparams[id - 1] = String.format("%02u",value & 0xff);
460 }else{
461 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
462 }
463 }
464
465 public void setValue(int id, float value){
466 if ((id > 0) && (id - 1 < strparams.length)){
467 strparams[id - 1] = "" + value;
468 }else{
469 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
470 }
471 }
472
473 public void setValue(int id, double value){
474 if ((id > 0) && (id - 1 < strparams.length)){
475 strparams[id - 1] = "" + value;
476 }else{
477 throw new SqlException(-1, "sql " +textSql + " dont need value:" + value);
478 }
479 }
480
481 //---
482 public void setString(int id, String value){
483 setValue(id, value);
484 }
485
486 public void setInt(int id, int value){
487 setValue(id, value);
488 }
489
490 public void setLong(int id, long value){
491 setValue(id, value);
492 }
493
494 public void setByte(int id, byte value){
495 setValue(id, value);
496 }
497
498 public void setFloat(int id, float value){
499 setValue(id, value);
500 }
501
502 public void setDouble(int id, double value){
503 setValue(id, value);
504 }
505
506 public void setValues(Object [] args){
507 for (int i = 0; i < args.length; i++){
508 if (args[i].instanceOf(String)){
509 setValue((String)args[i]);
510 }else
511 if (args[i].instanceOf(int)){
512 setValue((int)args[i]);
513 }else
514 if (args[i].instanceOf(long)){
515 setValue((long)args[i]);
516 }else
517 if (args[i].instanceOf(byte)){
518 setValue((byte)args[i]);
519 }else
520 if (args[i].instanceOf(double)){
521 setValue((double)args[i]);
522 }else{
523 throw new SqlException(-1, "sql " +textSql + " dont accept type:" + i);
524 }
525 }
526 }
527
528 public int get_changes()override{
529 throw new SqlException(-1, "get_changes");
530 return 0;
531 }
532
533 public void finalize(){
534 close();
535 }
536 };
537};
538
539
540/*
541
542void testSql1(){
543 Sql.ConnectionPool pool = new Sql.ConnectionPool();
544 pool.config(new Sql.ConnPoolCallback(){
545
546 Sql.Connection createConnection()override{
547 //TODO
548 Sql.Connection conn = Sql.Database.getConnection("sqlserver");
549 if (conn != nilptr){
550 conn.create("192.168.10.128", "sa", "233276111");
551 }
552 return conn;
553 }
554
555 bool alive(Sql.Connection conn)override{
556 //TODO
557 Sql.Statement state = conn.createStatement();
558 try{
559 state.execute("select 1;");
560 return true;
561 }catch(Exception e){
562
563 }
564 return false;
565 }
566 },"2006,2014",50, 50, 3, 300000, 10000);
567
568 for (int i = 0; i < 30; i++){
569 new Thread(){
570 void run()override{
571 testSqlite(pool);
572 }
573 }.start();
574 }
575}
576
577int testSqlite(Sql.ConnectionPool pool){
578
579 Sqlite.registry();
580
581 _system_.createConsole();
582
583 long before = _system_.currentTimeMillis();
584
585 for (int cx = 0; cx < 100;cx ++){
586 Sql.Connection slite = pool.getConnector();
587
588 if (slite != nilptr){
589
590 //slite.create("sqlite.db", nilptr, nilptr);
591 //slite.create("127.0.0.1", "root", "233276111");
592
593 //slite.setOption(Mysql.MysqlOption.CHARSET,"utf8");
594
595 //slite.setOption(Mysql.MysqlOption.SELECTDB, "test");
596
597
598 // 创建表
599 Sql.PreparedStatement stmt = slite.prepareStatement("CREATE table member(name varchar(32),age int) CHARSET=utf8");
600
601 //_system_.consoleWrite("time:" + (_system_.currentTimeMillis() - before) + " - 1\n");
602
603 try{
604 stmt.execute();
605 }catch(Exception e){
606 //_system_.consoleWrite("SqlException:" + e.getErrorCode() + "," + e.getMessage() + "\n");
607 }
608
609 String [] names = {
610 "嘉懿","煜城","懿轩","烨伟","苑博","伟泽","熠彤","鸿煊","博涛","烨霖","烨华","煜祺","智宸","正豪",
611 "昊然","明杰","立诚","立轩","立辉","峻熙","弘文","熠彤","鸿煊","烨霖","哲瀚","鑫鹏","致远","俊驰"
612 };
613
614 _system_.consoleWrite("time:" + (_system_.currentTimeMillis() - before) + " - before insert\n");
615
616 try{
617 //插入人名 年龄随机
618
619 for(int i = 0, c = names.length; i < c; i ++){
620 stmt = slite.prepareStatement("insert into member (name,age)VALUES(?, ?)");
621 stmt.setValue(names[i]);
622 stmt.setValue((int)(Math.random() * 80));
623 stmt.execute();
624 }
625 }catch(Exception e){
626 _system_.consoleWrite(e.getMessage() + "\n");
627 }
628 _system_.consoleWrite("time:" + (_system_.currentTimeMillis() - before) + " - after insert\n");
629
630
631 stmt = slite.prepareStatement("select * from member where age < ? limit 10");
632 stmt.setValue(40);
633
634 try{
635 Sql.ResultSet rs = stmt.executeQuery();
636 int c = rs.getRowCount();
637 while (rs.next()){
638 //_system_.consoleWrite(new String(rs.getString("name").getBytes("GB18030//IGNORE")) + ":" + rs.getString("age") + "\n");
639 }
640 }catch(Exception e){
641 _system_.consoleWrite(e.getMessage() + "\n");
642 }
643 }
644 pool.recycle(slite);
645 }
646
647 _system_.consoleWrite("done time:" + (_system_.currentTimeMillis() - before) + " - 4\n");
648
649 Thread.sleep(100);
650
651 return 0;
652}
653
654
655
656void testSql(){
657 //SqlServer.registry();
658
659 Sql.ConnectionPool pool = new Sql.ConnectionPool();
660 pool.config(new Sql.ConnPoolCallback(){
661
662 Sql.Connection createConnection()override{
663 //TODO
664 Sql.Connection conn = Sql.Database.getConnection("sqlserver");
665 if (conn != nilptr){
666 conn.create("192.168.10.128", "sa", "233276111");
667 }
668 return conn;
669 }
670
671 bool alive(Sql.Connection conn)override{
672 //TODO
673 Sql.Statement state = conn.createStatement();
674 try{
675 state.execute("select 1;");
676 return true;
677 }catch(Exception e){
678
679 }
680 return false;
681 }
682 },"2006,2014",50, 50, 3, 300000, 10000);
683
684 for (int i = 0; i < 30; i++){
685 new Thread(){
686 void run()override{
687 testSqlserver(pool);
688 }
689 }.start();
690 }
691}
692
693int testSqlserver(Sql.ConnectionPool pool){
694 _system_.createConsole();
695
696 for (int aa = 0;aa < 1000; aa++){
697 long before = _system_.currentTimeMillis();
698
699 Sql.Connection slite = pool.getConnector();
700 if (slite != nilptr){
701 Sql.PreparedStatement stmt = slite.prepareStatement("CREATE table blog..member(name varchar(32),age int)");
702
703 _system_.consoleWrite("time:" + (_system_.currentTimeMillis() - before) + " - 1\n");
704
705 try{
706 stmt.execute();
707 }catch(Exception e){
708 _system_.consoleWrite("SqlException:" + e.getErrorCode() + "," + new String(e.getMessage().getBytes("GB18030//IGNORE")) + "\n");
709 }
710
711 String [] names = {
712 "嘉懿","煜城","懿轩","烨伟","苑博","伟泽","熠彤","鸿煊","博涛","烨霖","烨华","煜祺","智宸","正豪",
713 "昊然","明杰","立诚","立轩","立辉","峻熙","弘文","熠彤","鸿煊","烨霖","哲瀚","鑫鹏","致远","俊驰"
714 };
715
716 _system_.consoleWrite("time:" + (_system_.currentTimeMillis() - before) + " - before insert\n");
717
718 try{
719 //插入人名 年龄随机
720
721 for(int i = 0, c = names.length; i < c; i ++){
722 stmt = slite.prepareStatement("insert into blog..member (name,age)VALUES(?, ?)");
723 stmt.setValue(names[i]);
724 stmt.setValue((int)(Math.random() * 80));
725 stmt.execute();
726 }
727 }catch(Exception e){
728 _system_.consoleWrite(new String(e.getMessage().getBytes("GB18030//IGNORE")) + "\n");
729 }
730 _system_.consoleWrite("time:" + (_system_.currentTimeMillis() - before) + " - after insert\n");
731
732
733 stmt = slite.prepareStatement("select top 10 * from blog..member where age < ?");
734 stmt.setValue(40);
735
736 try{
737 Sql.ResultSet rs = stmt.executeQuery();
738 int c = rs.getRowCount();
739 while (rs.isEof() == false){
740 _system_.consoleWrite(new String(rs.getString("name").getBytes("GB18030//IGNORE")) + ":" + rs.getString("age") + "\n");
741 rs.next();
742 }
743 }catch(Exception e){
744 _system_.consoleWrite(new String(e.getMessage().getBytes("GB18030//IGNORE")) + "\n");
745 }
746 pool.recycle(slite);
747 }
748 _system_.consoleWrite("done time:" + (_system_.currentTimeMillis() - before) + " - 4\n");
749 }
750
751 Thread.sleep(100);
752 return 0;
753}
754*/
755
756/*int main(String [] args){
757
758 Mysql m = new Mysql();
759 m.create("127.0.0.1","root","zt54TmMoRNLgf77M");
760 m.setOption(Mysql.MysqlOption.CHARSET,"utf8");
761 m.setOption(Mysql.MysqlOption.SELECTDB, "dcb");
762 m.setOption(Mysql.MysqlOption.RET_CHANGES,0);
763 Sql.PreparedStatement state = m.prepareStatement("select * from `db_branch` where id = ? limit 1");
764 state.setValue(4);
765 Sql.ResultSet res = state.executeQuery();
766 while (res.next()){
767 for (int i = 0; i < res.getColumnCount(); i++){
768 String str = res.getString(i);
769 _system_.output(str);
770 }
771 }
772
773 state = m.prepareStatement("insert into `db_branch` (`cid`, `address`)values(?, ?)");
774 state.setValue(1475);
775 state.setValue("asdsasda");
776 int rt = state.executeUpdate();
777 int nid = state.get_lastInsertId();
778
779 Sql.Statement stm = m.createStatement();
780 stm.executeUpdate("insert into `db_branch` (`cid`, `address`)values(15365, 'weqw')");
781 nid = stm.get_lastInsertId();
782
783 return 0;
784}
785*/
static final long currentTimeMillis()
Definition Object.x:1
void recycle(Connection connection)
Definition xsql.xcs:100
ConnPoolCallback callback
Definition xsql.xcs:41
bool config(ConnPoolCallback _callback, String reset_error, int maxWait, int maxConnect, int maxIdle, int maxIdleTime, int validtesttime)
Definition xsql.xcs:159
Connection allocate()
Definition xsql.xcs:44
Connection getConnector()
Definition xsql.xcs:52
bool test(Connection conn, long lastactive)
Definition xsql.xcs:93
static bool reigstry(String name, ConnectionRegister reg)
Definition xsql.xcs:210
static Connection getConnection(String driverName)
Definition xsql.xcs:220
DatabaseNotSupportException(String sqlmessage)
Definition xsql.xcs:15
void setInt(int value)
Definition xsql.xcs:412
void setLong(long value)
Definition xsql.xcs:416
int get_changes() override
Definition xsql.xcs:528
void setValue(double value)
Definition xsql.xcs:399
void setValue(byte value)
Definition xsql.xcs:383
void setValue(int value)
Definition xsql.xcs:367
void setDouble(int id, double value)
Definition xsql.xcs:502
void setString(int id, String value)
Definition xsql.xcs:482
void setValue(int id, String value)
Definition xsql.xcs:433
PreparedStatement(String sql)
Definition xsql.xcs:321
void setLong(int id, long value)
Definition xsql.xcs:490
void setValue(String value)
Definition xsql.xcs:359
String safety(String str)
Definition xsql.xcs:330
void setValue(float value)
Definition xsql.xcs:391
void setValue(int id, double value)
Definition xsql.xcs:473
void setValue(int id, int value)
Definition xsql.xcs:441
void setValue(int id, byte value)
Definition xsql.xcs:457
String [] strsplit
Definition xsql.xcs:317
void setDouble(double value)
Definition xsql.xcs:424
void setValue(int id, float value)
Definition xsql.xcs:465
String [] strparams
Definition xsql.xcs:318
void setInt(int id, int value)
Definition xsql.xcs:486
void setByte(int id, byte value)
Definition xsql.xcs:494
void setValues(Object [] args)
Definition xsql.xcs:506
void setFloat(int id, float value)
Definition xsql.xcs:498
void setString(String value)
Definition xsql.xcs:408
ResultSet executeQuery()
Definition xsql.xcs:351
void setValue(long value)
Definition xsql.xcs:375
void setFloat(float value)
Definition xsql.xcs:428
void setValue(int id, long value)
Definition xsql.xcs:449
void setByte(byte value)
Definition xsql.xcs:420
bool previous()
double getDouble(int columnIndex)
String getString(int columnIndex)
int getColumnCount()
String getString(String columnlabel)
int getInt(int columnIndex)
bool getBoolean(String columnlabel)
int getInt(String columnlabel)
float getFloat(String columnlabel)
long getRowCount()
long getLong(String columnlabel)
long getLong(int columnIndex)
bool isFirst()
int getColumnType(int )
Definition xsql.xcs:301
byte getByte(int columnIndex)
String getColumnName(int i)
byte getByte(String columnlabel)
double getDouble(String columnlabel)
float getFloat(int columnIndex)
int findColumn(String)
bool getBoolean(int columnIndex)
bool isValid()
int execute(String sql)
int executeUpdate(String sql)
ResultSet executeQuery(String sql)
ResultSet getResult()
int get_lastInsertId()
Definition xsql.xcs:311
int get_changes()
Definition xsql.xcs:310
Definition String.x:5
int length()
static final String format(String, Object[])
String replace(int, int, String)
String trim(bool)
String [] split(String)
int parseInt()
Connection createConnection()
bool alive(Connection conn)
void setOption(int opt, Object option)
String getError()
PreparedStatement prepareStatement(String sql)
Object getOption(int opt)
int getErrorCode()
void create(String uri, String username, String pwd)
Statement createStatement()
Connection allocConnection(String drivername)