Mercurial > hg > monetdb-java
annotate tests/JDBC_API_Tester.java @ 469:53911f29093c
Change output to stderr when differences are found.
Also exit with -1 when differences are found.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 14 Apr 2021 20:52:50 +0200 (2021-04-14) |
parents | 3e28de1c4f81 |
children | e239f02fe8b6 |
rev | line source |
---|---|
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1 /* |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2 * This Source Code Form is subject to the terms of the Mozilla Public |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5 * |
406
bf9f6b6ecf40
Update Copyright year.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
404
diff
changeset
|
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V. |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7 */ |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
8 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
9 import java.sql.*; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
10 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
11 import java.io.StringReader; |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
12 import java.math.BigDecimal; |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
13 import java.math.BigInteger; |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
14 import java.nio.charset.Charset; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
15 import java.text.SimpleDateFormat; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
16 import java.util.ArrayList; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
17 import java.util.Calendar; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
18 import java.util.Iterator; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
19 import java.util.List; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
20 import java.util.TimeZone; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
21 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
22 import org.monetdb.jdbc.types.INET; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
23 import org.monetdb.jdbc.types.URL; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
24 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
25 /** |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
26 * class to test JDBC Driver API methods and behavior of MonetDB server. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
27 * |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
28 * It combines 40+ tests which were previous individual test programs |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
29 * into one large test program, reusing the connection. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
30 * This speeds up testing considerably as the overhead of starting a JVM and |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
31 * loading the java test program class and MonetDB JDBC driver is now reduced |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
32 * to only one time instead of 40+ times. |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
33 * Also all output is no longer send to system out/err but collected in a StringBuilder. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
34 * The contents of it is compared with the expected output at the end of each test. |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
35 * Only when it deviates the output is sent to system err, see compareExpectedOutput(). |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
36 * |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
37 * @author Martin van Dinther |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
38 * @version 0.2 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
39 */ |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
40 final public class JDBC_API_Tester { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
41 StringBuilder sb; // buffer to collect the test output |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
42 final static int sbInitLen = 3712; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
43 Connection con; // main connection shared by all tests |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
44 boolean foundDifferences = false; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
45 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
46 public static void main(String[] args) throws Exception { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
47 String con_URL = args[0]; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
48 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
49 JDBC_API_Tester jt = new JDBC_API_Tester(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
50 jt.sb = new StringBuilder(sbInitLen); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
51 jt.con = DriverManager.getConnection(con_URL); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
52 // we are now connected |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
53 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
54 // run the tests |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
55 jt.Test_Cautocommit(con_URL); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
56 jt.Test_CisValid(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
57 jt.Test_Clargequery(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
58 jt.Test_Cmanycon(con_URL); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
59 jt.Test_Creplysize(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
60 jt.Test_Csavepoints(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
61 jt.Test_Ctransaction(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
62 jt.Test_Dobjects(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
63 jt.Test_FetchSize(); |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
64 jt.Test_Int128(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
65 jt.Test_PSgeneratedkeys(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
66 jt.Test_PSgetObject(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
67 jt.Test_PSlargebatchval(); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
68 jt.Test_PSlargeresponse(con_URL); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
69 jt.Test_PSmanycon(con_URL); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
70 jt.Test_PSmetadata(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
71 jt.Test_PSsomeamount(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
72 jt.Test_PSsqldata(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
73 jt.Test_PStimedate(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
74 jt.Test_PStimezone(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
75 jt.Test_PStypes(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
76 jt.Test_CallableStmt(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
77 jt.Test_Rbooleans(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
78 jt.Test_Rmetadata(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
79 jt.Test_Rpositioning(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
80 jt.Test_Rsqldata(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
81 jt.Test_Rtimedate(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
82 jt.Test_Sbatching(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
83 jt.Test_Smoreresults(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
84 jt.Test_Wrapper(); |
453
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
85 jt.bogus_auto_generated_keys(); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
86 jt.BugConcurrent_clients_SF_1504657(con_URL); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
87 jt.BugConcurrent_sequences(con_URL); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
88 jt.Bug_Connect_as_voc_getMetaData_Failure_Bug_6388(con_URL); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
89 jt.BugDatabaseMetaData_Bug_3356(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
90 jt.BugDecimalRound_Bug_3561(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
91 jt.BugExecuteUpdate_Bug_3350(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
92 jt.Bug_IsValid_Timeout_Bug_6782(con_URL); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
93 jt.Bug_LargeQueries_6571_6693(con_URL); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
94 jt.Bug_PrepStmtSetObject_CLOB_6349(); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
95 jt.Bug_PrepStmtSetString_6382(); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
96 jt.Bug_PrepStmt_With_Errors_Jira292(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
97 jt.BugResultSetMetaData_Bug_6183(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
98 jt.BugSetQueryTimeout_Bug_3357(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
99 jt.SQLcopyinto(); |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
100 /* run next long running test (11 minutes) only before a new release */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
101 /* jt.Test_PSlargeamount(); */ |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
102 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
103 jt.closeConx(jt.con); |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
104 |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
105 if (jt.foundDifferences) |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
106 System.exit(-1); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
107 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
108 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
109 private void Test_Cautocommit(String arg0) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
110 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
111 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
112 Connection con1 = con; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
113 Connection con2 = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
114 Statement stmt1 = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
115 Statement stmt2 = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
116 ResultSet rs = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
117 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
118 con2 = DriverManager.getConnection(arg0); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
119 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
120 // >> true: auto commit should be on by default |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
121 if (con1.getAutoCommit() != true) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
122 sb.append("expecting con1 to have autocommit on/true"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
123 if (con2.getAutoCommit() != true) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
124 sb.append("expecting con2 to have autocommit on/true"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
125 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
126 // test commit by checking if a change is visible in another connection |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
127 stmt1 = con1.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
128 sb.append("1. create..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
129 stmt1.executeUpdate("CREATE TABLE table_Test_Cautocommit ( id int )"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
130 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
131 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
132 stmt2 = con2.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
133 sb.append("2. select..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
134 rs = stmt2.executeQuery("SELECT * FROM table_Test_Cautocommit"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
135 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
136 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
137 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
138 closeStmtResSet(stmt2, rs); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
139 closeStmtResSet(stmt1, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
140 closeConx(con2); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
141 sb.append("ABORTING TEST!!!"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
142 return; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
143 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
144 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
145 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
146 // turn off auto commit |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
147 con1.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
148 con2.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
149 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
150 // >> false: we just disabled it |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
151 if (con1.getAutoCommit() != false) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
152 sb.append("expecting con1 to have autocommit off/false"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
153 if (con2.getAutoCommit() != false) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
154 sb.append("expecting con2 to have autocommit off/false"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
155 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
156 // a change would not be visible now |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
157 sb.append("3. drop..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
158 stmt2.executeUpdate("DROP TABLE table_Test_Cautocommit"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
159 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
160 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
161 sb.append("4. select..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
162 rs = stmt1.executeQuery("SELECT * FROM table_Test_Cautocommit"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
163 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
164 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
165 sb.append("5. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
166 con2.commit(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
167 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
168 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
169 sb.append("6. select..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
170 rs = stmt1.executeQuery("SELECT * FROM table_Test_Cautocommit"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
171 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
172 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
173 sb.append("7. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
174 con1.commit(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
175 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
176 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
177 // restore original auto commit setting |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
178 con1.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
179 con2.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
180 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
181 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
182 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
183 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
184 closeStmtResSet(stmt1, rs); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
185 closeStmtResSet(stmt2, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
186 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
187 closeConx(con2); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
188 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
189 compareExpectedOutput("Test_Cautocommit", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
190 "1. create...passed :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
191 "2. select...passed :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
192 "3. drop...passed :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
193 "4. select...passed :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
194 "5. commit...passed :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
195 "6. select...passed :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
196 "7. commit...passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
197 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
198 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
199 private void Test_CisValid() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
200 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
201 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
202 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
203 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
204 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
205 con.setAutoCommit(false); // start a transaction |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
206 stmt.executeQuery("SELECT COUNT(*) FROM doesnotexist;"); // let's trigger an error |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
207 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
208 // e.printStackTrace(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
209 sb.append("Expected error: ").append(e).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
210 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
211 // test calling conn.isValid() |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
212 sb.append("Validating connection: con.isValid? ").append(con.isValid(30)); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
213 // Can we rollback on this connection without causing an error? |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
214 con.rollback(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
215 } catch (SQLException e2) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
216 sb.append("UnExpected error: ").append(e2); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
217 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
218 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
219 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
220 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
221 // restore auto commit mode |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
222 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
223 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
224 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
225 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
226 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
227 closeStmtResSet(stmt, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
228 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
229 compareExpectedOutput("Test_CisValid", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
230 "Expected error: java.sql.SQLException: SELECT: no such table 'doesnotexist'\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
231 "Validating connection: con.isValid? true"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
232 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
233 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
234 private void Test_Clargequery() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
235 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
236 final String query = |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
237 "-- When a query larger than the send buffer is being " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
238 "sent, a deadlock situation can occur when the server writes " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
239 "data back, blocking because we as client are sending as well " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
240 "and not reading. Hence, to avoid this deadlock, in JDBC a " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
241 "separate thread is started in the background such that results " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
242 "from the server can be read, while data is still being sent to " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
243 "the server. To test this, we need to trigger the SendThread " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
244 "being started, which we do with a quite large query. We " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
245 "construct it by repeating some stupid query plus a comment " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
246 "a lot of times. And as you're guessing by now, you're reading " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
247 "this stupid comment that we use :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
248 "select 1;\n"; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
249 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
250 final int size = 1234; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
251 StringBuilder bigq = new StringBuilder(query.length() * size); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
252 for (int i = 0; i < size; i++) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
253 bigq.append(query); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
254 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
255 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
256 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
257 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
258 // >> true: auto commit should be on by default |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
259 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
260 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
261 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
262 // sending big script with many simple queries |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
263 sb.append("1. executing script\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
264 stmt.execute(bigq.toString()); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
265 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
266 int i = 1; // we skip the first "getResultSet()" |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
267 while (stmt.getMoreResults() != false) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
268 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
269 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
270 if (stmt.getUpdateCount() != -1) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
271 sb.append("Error: found an update count for a SELECT query\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
272 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
273 if (i != size) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
274 sb.append("Error: expecting ").append(size).append(" tuples, only got ").append(i).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
275 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
276 sb.append("2. queries processed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
277 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
278 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
279 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
280 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
281 closeStmtResSet(stmt, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
282 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
283 compareExpectedOutput("Test_Clargequery", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
284 "0. true true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
285 "1. executing script\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
286 "2. queries processed\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
287 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
288 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
289 private void Test_Cmanycon(String arg0) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
290 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
291 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
292 final int maxCons = 60; // default max_clients is 64, 2 connections are already open from this program |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
293 List<Connection> cons = new ArrayList<Connection>(maxCons); // Connections go in here |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
294 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
295 // spawn a lot of Connections, just for fun... |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
296 int i = 1; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
297 sb.append("Establishing Connection "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
298 for (; i <= maxCons; i++) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
299 sb.append(i); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
300 Connection conx = DriverManager.getConnection(arg0); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
301 sb.append(","); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
302 cons.add(conx); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
303 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
304 // do something with the connection to test if it works |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
305 conx.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
306 sb.append(" "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
307 conx.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
308 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
309 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
310 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
311 // now try to nicely close them |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
312 i = 1; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
313 sb.append("Closing Connection "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
314 for (Iterator<Connection> it = cons.iterator(); it.hasNext(); i++) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
315 Connection conx = it.next(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
316 // see if the connection still works |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
317 sb.append(i); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
318 conx.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
319 sb.append(","); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
320 conx.close(); // this will also implicitly close the created statement object |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
321 sb.append(" "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
322 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
323 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
324 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
325 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
326 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
327 compareExpectedOutput("Test_Cmanycon", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
328 "Establishing Connection 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
329 "11, 12, 13, 14, 15, 16, 17, 18, 19, 20, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
330 "21, 22, 23, 24, 25, 26, 27, 28, 29, 30, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
331 "31, 32, 33, 34, 35, 36, 37, 38, 39, 40, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
332 "41, 42, 43, 44, 45, 46, 47, 48, 49, 50, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
333 "51, 52, 53, 54, 55, 56, 57, 58, 59, 60, \n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
334 "Closing Connection 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
335 "11, 12, 13, 14, 15, 16, 17, 18, 19, 20, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
336 "21, 22, 23, 24, 25, 26, 27, 28, 29, 30, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
337 "31, 32, 33, 34, 35, 36, 37, 38, 39, 40, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
338 "41, 42, 43, 44, 45, 46, 47, 48, 49, 50, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
339 "51, 52, 53, 54, 55, 56, 57, 58, 59, 60, "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
340 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
341 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
342 private void Test_Creplysize() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
343 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
344 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
345 Statement stmt1 = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
346 ResultSet rs = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
347 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
348 con.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
349 // >> true: auto commit should be off by now |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
350 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
351 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
352 stmt1 = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
353 // test commit by checking if a change is visible in another connection |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
354 sb.append("1. create... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
355 stmt1.executeUpdate("CREATE TABLE table_Test_Creplysize ( id int )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
356 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
357 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
358 sb.append("2. populating with 21 records... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
359 for (int i = 0; i < 21; i++) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
360 stmt1.executeUpdate("INSERT INTO table_Test_Creplysize (id) values (" + (i + 1) + ")"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
361 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
362 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
363 sb.append("3. hinting the driver to use fetchsize 10... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
364 stmt1.setFetchSize(10); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
365 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
366 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
367 sb.append("4. selecting all values... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
368 rs = stmt1.executeQuery("SELECT * FROM table_Test_Creplysize"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
369 int i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
370 while (rs.next()) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
371 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
372 rs.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
373 if (i == 21) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
374 sb.append("passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
375 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
376 sb.append("got ").append(i).append(" records!!!"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
377 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
378 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
379 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
380 sb.append("5. resetting driver fetchsize hint... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
381 stmt1.setFetchSize(0); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
382 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
383 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
384 sb.append("6. instructing the driver to return at max 10 rows... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
385 stmt1.setMaxRows(10); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
386 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
387 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
388 sb.append("7. selecting all values... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
389 rs = stmt1.executeQuery("SELECT * FROM table_Test_Creplysize"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
390 i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
391 while (rs.next()) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
392 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
393 rs.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
394 if (i == 10) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
395 sb.append("passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
396 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
397 sb.append("got ").append(i).append(" records!!!"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
398 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
399 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
400 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
401 sb.append("8. hinting the driver to use fetchsize 5... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
402 stmt1.setFetchSize(5); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
403 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
404 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
405 sb.append("9. selecting all values... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
406 rs = stmt1.executeQuery("SELECT * FROM table_Test_Creplysize"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
407 i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
408 while (rs.next()) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
409 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
410 rs.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
411 if (i == 10) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
412 sb.append("passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
413 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
414 sb.append("got ").append(i).append(" records!!!"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
415 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
416 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
417 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
418 sb.append("10. drop... "); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
419 stmt1.executeUpdate("DROP TABLE table_Test_Creplysize"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
420 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
421 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
422 con.rollback(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
423 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
424 // restore auto commit mode |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
425 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
426 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
427 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
428 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
429 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
430 closeStmtResSet(stmt1, rs); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
431 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
432 compareExpectedOutput("Test_Creplysize", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
433 "0. true false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
434 "1. create... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
435 "2. populating with 21 records... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
436 "3. hinting the driver to use fetchsize 10... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
437 "4. selecting all values... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
438 "5. resetting driver fetchsize hint... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
439 "6. instructing the driver to return at max 10 rows... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
440 "7. selecting all values... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
441 "8. hinting the driver to use fetchsize 5... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
442 "9. selecting all values... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
443 "10. drop... passed\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
444 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
445 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
446 private void Test_Csavepoints() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
447 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
448 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
449 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
450 ResultSet rs = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
451 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
452 // >> true: auto commit should be on by default |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
453 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
454 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
455 // savepoints require a non-autocommit connection |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
456 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
457 sb.append("1. savepoint..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
458 con.setSavepoint(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
459 sb.append("passed !!"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
460 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
461 sb.append("expected msg: ").append(e.getMessage()); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
462 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
463 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
464 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
465 con.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
466 // >> true: auto commit should be on by default |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
467 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
468 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
469 sb.append("2. savepoint..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
470 /* make a savepoint, and discard it */ |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
471 con.setSavepoint(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
472 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
473 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
474 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
475 stmt.executeUpdate("CREATE TABLE table_Test_Csavepoints ( id int, PRIMARY KEY (id) )"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
476 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
477 sb.append("3. savepoint..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
478 Savepoint sp2 = con.setSavepoint("empty table"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
479 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
480 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
481 rs = stmt.executeQuery("SELECT id FROM table_Test_Csavepoints"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
482 int i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
483 int items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
484 sb.append("4. table ").append(items).append(" items"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
485 while (rs.next()) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
486 sb.append(", ").append(rs.getString("id")); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
487 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
488 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
489 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
490 sb.append(" FAILED (").append(i).append(")"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
491 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
492 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
493 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
494 stmt.executeUpdate("INSERT INTO table_Test_Csavepoints VALUES (1)"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
495 stmt.executeUpdate("INSERT INTO table_Test_Csavepoints VALUES (2)"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
496 stmt.executeUpdate("INSERT INTO table_Test_Csavepoints VALUES (3)"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
497 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
498 sb.append("5. savepoint..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
499 Savepoint sp3 = con.setSavepoint("three values"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
500 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
501 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
502 rs = stmt.executeQuery("SELECT id FROM table_Test_Csavepoints"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
503 i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
504 items = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
505 sb.append("6. table ").append(items).append(" items"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
506 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
507 sb.append(", ").append(rs.getString("id")); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
508 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
509 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
510 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
511 sb.append(" FAILED (").append(i).append(")"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
512 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
513 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
514 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
515 sb.append("7. release..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
516 con.releaseSavepoint(sp3); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
517 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
518 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
519 rs = stmt.executeQuery("SELECT id FROM table_Test_Csavepoints"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
520 i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
521 items = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
522 sb.append("8. table ").append(items).append(" items"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
523 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
524 sb.append(", ").append(rs.getString("id")); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
525 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
526 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
527 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
528 sb.append(" FAILED (").append(i).append(") :("); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
529 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
530 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
531 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
532 sb.append("9. rollback..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
533 con.rollback(sp2); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
534 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
535 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
536 rs = stmt.executeQuery("SELECT id FROM table_Test_Csavepoints"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
537 i = 0; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
538 items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
539 sb.append("10. table ").append(items).append(" items"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
540 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
541 sb.append(", ").append(rs.getString("id")); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
542 i++; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
543 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
544 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
545 sb.append(" FAILED (").append(i).append(") :("); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
546 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
547 sb.append(" passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
548 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
549 con.rollback(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
550 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
551 // restore auto commit mode |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
552 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
553 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
554 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
555 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
556 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
557 closeStmtResSet(stmt, rs); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
558 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
559 compareExpectedOutput("Test_Csavepoints", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
560 "0. true true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
561 "1. savepoint...expected msg: SAVEPOINT: not allowed in auto commit mode\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
562 "0. false false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
563 "2. savepoint...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
564 "3. savepoint...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
565 "4. table 0 items passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
566 "5. savepoint...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
567 "6. table 3 items, 1, 2, 3 passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
568 "7. release...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
569 "8. table 3 items, 1, 2, 3 passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
570 "9. rollback...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
571 "10. table 0 items passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
572 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
573 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
574 private void Test_Ctransaction() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
575 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
576 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
577 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
578 // test commit by checking if a change is visible in another connection |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
579 sb.append("1. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
580 con.commit(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
581 sb.append("passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
582 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
583 // this means we get what we expect |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
584 sb.append("failed as expected: ").append(e.getMessage()); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
585 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
586 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
587 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
588 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
589 // turn off auto commit |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
590 con.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
591 // >> false: we just disabled it |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
592 sb.append("2. false\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
593 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
594 // a change would not be visible now |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
595 sb.append("3. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
596 con.commit(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
597 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
598 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
599 sb.append("4. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
600 con.commit(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
601 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
602 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
603 sb.append("5. rollback..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
604 con.rollback(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
605 sb.append("passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
606 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
607 sb.append("FAILED: ").append(e.getMessage()); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
608 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
609 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
610 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
611 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
612 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
613 // turn off auto commit |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
614 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
615 // >> false: we just disabled it |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
616 sb.append("6. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
617 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
618 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
619 sb.append("7. start transaction..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
620 stmt.executeUpdate("START TRANSACTION"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
621 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
622 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
623 sb.append("8. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
624 con.commit(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
625 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
626 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
627 sb.append("9. true\t").append(con.getAutoCommit()); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
628 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
629 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
630 sb.append("10. start transaction..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
631 stmt.executeUpdate("START TRANSACTION"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
632 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
633 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
634 sb.append("11. rollback..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
635 con.rollback(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
636 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
637 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
638 sb.append("12. true\t").append(con.getAutoCommit()); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
639 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
640 sb.append("FAILED: ").append(e.getMessage()); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
641 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
642 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
643 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
644 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
645 // a commit now should fail |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
646 sb.append("13. commit..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
647 con.commit(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
648 sb.append("passed"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
649 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
650 // this means we get what we expect |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
651 sb.append("failed as expected: ").append(e.getMessage()); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
652 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
653 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
654 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
655 closeStmtResSet(stmt, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
656 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
657 compareExpectedOutput("Test_Ctransaction", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
658 "1. commit...failed as expected: COMMIT: not allowed in auto commit mode\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
659 "2. false false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
660 "3. commit...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
661 "4. commit...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
662 "5. rollback...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
663 "6. true true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
664 "7. start transaction...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
665 "8. commit...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
666 "9. true true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
667 "10. start transaction...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
668 "11. rollback...passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
669 "12. true true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
670 "13. commit...failed as expected: COMMIT: not allowed in auto commit mode\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
671 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
672 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
673 private void Test_Dobjects() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
674 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
675 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
676 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
677 DatabaseMetaData dbmd = con.getMetaData(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
678 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
679 // inspect the catalog by use of dbmd functions |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
680 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
681 "Resultset with 1 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
682 "TABLE_CAT\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
683 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
684 compareResultSet(dbmd.getSchemas(null, "sys"), "getSchemas(null, sys)", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
685 "Resultset with 2 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
686 "TABLE_SCHEM TABLE_CATALOG\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
687 "sys null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
688 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
689 compareResultSet(dbmd.getTables(null, "tmp", null, null), "getTables(null, tmp, null, null)", // schema tmp has 6 tables |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
690 "Resultset with 10 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
691 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
692 "null tmp _columns SYSTEM TABLE null null null null null null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
693 "null tmp _tables SYSTEM TABLE null null null null null null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
694 "null tmp idxs SYSTEM TABLE null null null null null null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
695 "null tmp keys SYSTEM TABLE null null null null null null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
696 "null tmp objects SYSTEM TABLE null null null null null null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
697 "null tmp triggers SYSTEM TABLE null null null null null null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
698 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
699 compareResultSet(dbmd.getTables(null, "sys", "schemas", null), "getTables(null, sys, schemas, null)", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
700 "Resultset with 10 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
701 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
702 "null sys schemas SYSTEM TABLE null null null null null null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
703 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
704 compareResultSet(dbmd.getColumns(null, "sys", "table\\_types", null), "getColumns(null, sys, table\\_types, null)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
705 "Resultset with 24 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
706 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
707 "null sys table_types table_type_id 5 smallint 16 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
708 "null sys table_types table_type_name 12 varchar 25 0 0 0 0 null null 0 0 25 2 NO null null null null NO NO\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
709 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
710 compareResultSet(dbmd.getPrimaryKeys(null, "sys", "table\\_types"), "getPrimaryKeys(null, sys, table\\_types)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
711 "Resultset with 6 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
712 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
713 "null sys table_types table_type_id 1 table_types_table_type_id_pkey\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
714 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
715 compareResultSet(dbmd.getExportedKeys(null, "sys", "table\\_types"), "getExportedKeys(null, sys, table\\_types)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
716 "Resultset with 14 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
717 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
718 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
719 compareResultSet(dbmd.getCrossReference(null, "sys", "tables", null, "sys", "table\\_types"), "getCrossReference(null, sys, tables, null, sys, table\\_types)", |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
720 "Resultset with 14 columns\n" + |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
721 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n"); |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
722 |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
723 compareResultSet(dbmd.getImportedKeys(null, "sys", "table\\_types"), "getImportedKeys(null, sys, table\\_types)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
724 "Resultset with 14 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
725 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
726 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
727 compareResultSet(dbmd.getIndexInfo(null, "sys", "key_types", false, false), "getIndexInfo(null, sys, key_types, false, false)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
728 "Resultset with 13 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
729 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
730 "null sys key_types false null key_types_key_type_id_pkey 2 1 key_type_id null 3 0 null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
731 "null sys key_types false null key_types_key_type_name_unique 2 1 key_type_name null 3 0 null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
732 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
733 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
734 "Resultset with 7 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
735 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
736 "null sys table_types monetdb public SELECT NO\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
737 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
738 compareResultSet(dbmd.getColumnPrivileges(null, "sys", "table\\_types", null), "getColumnPrivileges(null, sys, table\\_types, null)", |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
739 "Resultset with 8 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
740 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
741 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
742 compareResultSet(dbmd.getUDTs(null, "sys", null, null), "getUDTs(null, sys, null, null)", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
743 "Resultset with 7 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
744 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
745 "null sys inet org.monetdb.jdbc.types.INET 2000 inet null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
746 "null sys json java.lang.String 2000 json null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
747 "null sys url org.monetdb.jdbc.types.URL 2000 url null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
748 "null sys uuid java.lang.String 2000 uuid null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
749 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
750 int[] UDTtypes = { Types.STRUCT, Types.DISTINCT }; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
751 compareResultSet(dbmd.getUDTs(null, "sys", null, UDTtypes), "getUDTs(null, sys, null, UDTtypes", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
752 "Resultset with 7 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
753 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
754 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
755 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
756 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
757 sb.setLength(0); // clear the output log buffer |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
758 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
759 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
760 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
761 compareExpectedOutput("Test_Dobjects", ""); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
762 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
763 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
764 private void compareResultSet(ResultSet rs, String methodnm, String expected) throws SQLException { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
765 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
766 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
767 ResultSetMetaData rsmd = rs.getMetaData(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
768 int columnCount = rsmd.getColumnCount(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
769 sb.append("Resultset with ").append(columnCount).append(" columns\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
770 for (int col = 1; col <= columnCount; col++) { |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
771 if (col > 1) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
772 sb.append("\t"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
773 sb.append(rsmd.getColumnName(col)); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
774 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
775 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
776 while (rs.next()) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
777 for (int col = 1; col <= columnCount; col++) { |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
778 if (col > 1) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
779 sb.append("\t"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
780 sb.append(rs.getString(col)); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
781 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
782 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
783 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
784 rs.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
785 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
786 compareExpectedOutput(methodnm, expected); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
787 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
788 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
789 private void Test_FetchSize() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
790 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
791 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
792 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
793 ResultSet rs = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
794 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
795 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
796 rs = stmt.executeQuery("SELECT * FROM _tables"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
797 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
798 sb.append("Statement fetch size before set: ").append(stmt.getFetchSize()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
799 sb.append("ResultSet fetch size before set: ").append(rs.getFetchSize()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
800 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
801 stmt.setFetchSize(40); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
802 rs.setFetchSize(16384); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
803 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
804 sb.append("Statement fetch size after set: ").append(stmt.getFetchSize()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
805 sb.append("ResultSet fetch size after set: ").append(rs.getFetchSize()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
806 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
807 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
808 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
809 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
810 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
811 closeStmtResSet(stmt, rs); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
812 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
813 compareExpectedOutput("Test_FetchSize", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
814 "Statement fetch size before set: 0\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
815 "ResultSet fetch size before set: 250\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
816 "Statement fetch size after set: 40\n" + |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
817 "ResultSet fetch size after set: 16384\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
818 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
819 |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
820 private void Test_Int128() { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
821 sb.setLength(0); // clear the output log buffer |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
822 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
823 Statement stmt = null; |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
824 ResultSet rs = null; |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
825 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
826 // check first if datatype hugeint is supported on this server |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
827 boolean supportsHugeInt = false; |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
828 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
829 stmt = con.createStatement(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
830 // query sys.types to find out if sql datatype hugeint is supported |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
831 rs = stmt.executeQuery("SELECT sqlname from sys.types where sqlname = 'hugeint';"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
832 if (rs != null && rs.next()) { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
833 String sqlname = rs.getString(1); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
834 if ("hugeint".equals(sqlname)) |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
835 supportsHugeInt = true; |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
836 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
837 } catch (SQLException e) { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
838 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
839 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
840 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
841 if (!supportsHugeInt) { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
842 closeStmtResSet(stmt, rs); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
843 compareExpectedOutput("Test_Int128", ""); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
844 return; // skip the rest of the test |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
845 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
846 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
847 // test whether we can represent a full-size int128 as JDBC results |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
848 PreparedStatement insertStatement = null; |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
849 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
850 stmt.executeUpdate("CREATE TABLE HUGEINTT (I HUGEINT)"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
851 stmt.executeUpdate("CREATE TABLE HUGEDECT (I DECIMAL(38,19))"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
852 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
853 BigInteger bi = new BigInteger("123456789012345678909876543210987654321"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
854 BigDecimal bd = new BigDecimal("1234567890123456789.9876543210987654321"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
855 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
856 insertStatement = con.prepareStatement("INSERT INTO HUGEINTT VALUES (?)"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
857 insertStatement.setBigDecimal(1, new BigDecimal(bi)); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
858 insertStatement.executeUpdate(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
859 insertStatement.close(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
860 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
861 stmt.executeUpdate("INSERT INTO HUGEDECT VALUES (" + bd + ");"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
862 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
863 rs = stmt.executeQuery("SELECT I FROM HUGEINTT"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
864 rs.next(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
865 BigInteger biRes = rs.getBigDecimal(1).toBigInteger(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
866 rs.close(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
867 sb.append("Expecting " + bi + ", got " + biRes).append("\n"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
868 if (!bi.equals(biRes)) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
869 sb.append("value of bi is NOT equal to biRes!\n"); |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
870 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
871 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
872 rs = stmt.executeQuery("SELECT I FROM HUGEDECT"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
873 rs.next(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
874 BigDecimal bdRes = rs.getBigDecimal(1); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
875 rs.close(); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
876 sb.append("Expecting " + bd + ", got " + bdRes).append("\n"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
877 if (!bd.equals(bdRes)) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
878 sb.append("value of bd is NOT equal to bdRes!\n"); |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
879 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
880 } catch (SQLException e) { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
881 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
882 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
883 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
884 // cleanup |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
885 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
886 stmt.executeUpdate("DROP TABLE IF EXISTS HUGEINTT"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
887 stmt.executeUpdate("DROP TABLE IF EXISTS HUGEDECT"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
888 sb.append("SUCCESS\n"); |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
889 } catch (SQLException e) { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
890 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
891 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
892 closeStmtResSet(insertStatement, null); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
893 closeStmtResSet(stmt, rs); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
894 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
895 compareExpectedOutput("Test_Int128", |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
896 "Expecting 123456789012345678909876543210987654321, got 123456789012345678909876543210987654321\n" + |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
897 "Expecting 1234567890123456789.9876543210987654321, got 1234567890123456789.9876543210987654321\n" + |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
898 "SUCCESS\n"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
899 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
900 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
901 private void Test_PSgeneratedkeys() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
902 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
903 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
904 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
905 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
906 con.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
907 // >> false: auto commit was just switched off |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
908 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
909 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
910 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
911 stmt.executeUpdate( |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
912 "CREATE TABLE psgenkey (" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
913 " id serial," + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
914 " val varchar(20)" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
915 ")"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
916 stmt.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
917 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
918 sb.append("FAILED to CREATE TABLE psgenkey: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
919 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
920 closeStmtResSet(stmt, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
921 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
922 PreparedStatement pstmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
923 ResultSet keys = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
924 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
925 pstmt = con.prepareStatement( |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
926 "INSERT INTO psgenkey (val) VALUES ('this is a test')", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
927 Statement.RETURN_GENERATED_KEYS); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
928 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
929 sb.append("1. inserting 3 records..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
930 pstmt.executeUpdate(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
931 pstmt.executeUpdate(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
932 pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
933 sb.append("success\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
934 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
935 // now get the generated keys |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
936 sb.append("2. getting generated keys..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
937 keys = pstmt.getGeneratedKeys(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
938 if (keys == null) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
939 sb.append("there are no keys!\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
940 } else { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
941 while (keys.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
942 sb.append("generated key index: ").append(keys.getInt(1)).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
943 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
944 if (keys.getStatement() == null) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
945 sb.append("ResultSet.getStatement() should never return null!\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
946 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
947 keys.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
948 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
949 pstmt.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
950 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
951 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
952 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
953 closeStmtResSet(pstmt, keys); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
954 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
955 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
956 con.rollback(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
957 // restore default setting |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
958 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
959 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
960 sb.append("FAILED to rollback: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
961 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
962 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
963 compareExpectedOutput("Test_PSgeneratedkeys", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
964 "0. false false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
965 "1. inserting 3 records...success\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
966 "2. getting generated keys...generated key index: 3\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
967 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
968 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
969 private void Test_PSgetObject() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
970 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
971 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
972 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
973 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
974 con.setAutoCommit(false); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
975 // >> false: auto commit was just switched off |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
976 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
977 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
978 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
979 sb.append("1. creating test table..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
980 stmt.executeUpdate("CREATE TABLE table_Test_PSgetObject (ti tinyint, si smallint, i int, bi bigint)"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
981 sb.append("success\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
982 stmt.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
983 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
984 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
985 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
986 closeStmtResSet(stmt, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
987 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
988 PreparedStatement pstmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
989 ResultSet rs = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
990 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
991 sb.append("2a. inserting 3 records as batch..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
992 pstmt = con.prepareStatement("INSERT INTO table_Test_PSgetObject (ti,si,i,bi) VALUES (?,?,?,?)"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
993 pstmt.setShort(1, (short)1); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
994 pstmt.setShort(2, (short)1); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
995 pstmt.setInt (3, 1); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
996 pstmt.setLong(4, (long)1); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
997 pstmt.addBatch(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
998 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
999 pstmt.setShort(1, (short)127); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1000 pstmt.setShort(2, (short)12700); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1001 pstmt.setInt (3, 1270000); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1002 pstmt.setLong(4, (long)127000000); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1003 pstmt.addBatch(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1004 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1005 pstmt.setShort(1, (short)-127); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1006 pstmt.setShort(2, (short)-12700); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1007 pstmt.setInt (3, -1270000); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1008 pstmt.setLong(4, (long)-127000000); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1009 pstmt.addBatch(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1010 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1011 pstmt.executeBatch(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1012 sb.append(" passed\n"); |
450
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1013 sb.append(pstmt.toString()); // test showing prepared statement |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1014 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1015 sb.append("2b. closing PreparedStatement..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1016 pstmt.close(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1017 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1018 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1019 sb.append("FAILED to INSERT data: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1020 while ((e = e.getNextException()) != null) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1021 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1022 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1023 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1024 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1025 sb.append("3a. selecting records..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1026 pstmt = con.prepareStatement("SELECT ti,si,i,bi FROM table_Test_PSgetObject ORDER BY ti,si,i,bi"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1027 rs = pstmt.executeQuery(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1028 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1029 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1030 while (rs.next()) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1031 // test fix for https://www.monetdb.org/bugzilla/show_bug.cgi?id=4026 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1032 Short ti = (Short) rs.getObject(1); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1033 Short si = (Short) rs.getObject(2); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1034 Integer i = (Integer) rs.getObject(3); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1035 Long bi = (Long) rs.getObject(4); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1036 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1037 sb.append(" Retrieved row data: ti=").append(ti).append(" si=").append(si).append(" i=").append(i).append(" bi=").append(bi).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1038 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1039 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1040 sb.append("3b. closing ResultSet..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1041 rs.close(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1042 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1043 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1044 sb.append("3c. closing PreparedStatement..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1045 pstmt.close(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1046 sb.append(" passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1047 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1048 sb.append("FAILED to RETRIEVE data: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1049 while ((e = e.getNextException()) != null) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1050 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1051 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1052 closeStmtResSet(pstmt, rs); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1053 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1054 try { |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1055 sb.append("4. Rollback changes..."); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1056 con.rollback(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1057 sb.append(" passed\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1058 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1059 // restore default setting |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1060 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1061 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1062 sb.append("FAILED to rollback: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1063 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1064 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1065 compareExpectedOutput("Test_PSgetObject", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1066 "0. false false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1067 "1. creating test table...success\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1068 "2a. inserting 3 records as batch... passed\n" + |
450
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1069 "Prepared SQL: INSERT INTO table_Test_PSgetObject (ti,si,i,bi) VALUES (?,?,?,?)\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1070 " parameter 1 tinyint, set value: -127\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1071 " parameter 2 smallint, set value: -12700\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1072 " parameter 3 int, set value: -1270000\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1073 " parameter 4 bigint, set value: -127000000\n" + |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1074 "2b. closing PreparedStatement... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1075 "3a. selecting records... passed\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1076 " Retrieved row data: ti=-127 si=-12700 i=-1270000 bi=-127000000\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1077 " Retrieved row data: ti=1 si=1 i=1 bi=1\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1078 " Retrieved row data: ti=127 si=12700 i=1270000 bi=127000000\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1079 "3b. closing ResultSet... passed\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1080 "3c. closing PreparedStatement... passed\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1081 "4. Rollback changes... passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1082 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1083 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1084 private void Test_PSlargebatchval() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1085 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1086 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1087 byte[] errorBytes = new byte[] { (byte) 0xe2, (byte) 0x80, (byte) 0xa7 }; |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1088 String errorStr = new String(errorBytes, Charset.forName("UTF-8")); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1089 StringBuilder repeatedErrorStr = new StringBuilder(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1090 for (int i = 0; i < 8170;i++) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1091 repeatedErrorStr.append(errorStr); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1092 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1093 String largeStr = repeatedErrorStr.toString(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1094 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1095 Statement stmt = null; |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1096 PreparedStatement pstmt = null; |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1097 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1098 try { |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1099 // >> true: auto commit should be on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1100 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1101 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1102 stmt = con.createStatement(); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1103 sb.append("1. creating test table..."); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1104 stmt.execute("CREATE TABLE Test_PSlargebatchval (c INT, a CLOB, b DOUBLE)"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1105 sb.append("success\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1106 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1107 sb.append("2. prepare insert..."); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1108 pstmt = con.prepareStatement("INSERT INTO Test_PSlargebatchval VALUES (?,?,?)"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1109 sb.append("success\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1110 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1111 pstmt.setLong(1, 1L); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1112 pstmt.setString(2, largeStr); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1113 pstmt.setDouble(3, 1.0); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1114 pstmt.addBatch(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1115 pstmt.executeBatch(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1116 sb.append("3. inserted 1 large string\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1117 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1118 /* test issue reported at https://www.monetdb.org/bugzilla/show_bug.cgi?id=3470 */ |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1119 pstmt.setLong(1, -2L); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1120 pstmt.setClob(2, new StringReader(largeStr)); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1121 pstmt.setDouble(3, -2.0); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1122 pstmt.addBatch(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1123 pstmt.executeBatch(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1124 sb.append("4. inserted 1 large clob via StringReader() object\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1125 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1126 Clob myClob = con.createClob(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1127 myClob.setString(1L, largeStr); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1128 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1129 pstmt.setLong(1, 123456789L); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1130 pstmt.setClob(2, myClob); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1131 pstmt.setDouble(3, 12345678901.98765); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1132 pstmt.addBatch(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1133 pstmt.executeBatch(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1134 sb.append("5. inserted 1 large clob via createClob() object\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1135 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1136 pstmt.close(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1137 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1138 sb.append("6. select count(*)... "); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1139 rs = stmt.executeQuery("SELECT COUNT(*) FROM Test_PSlargebatchval"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1140 if (rs.next()) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1141 sb.append(rs.getInt(1)).append(" rows inserted.\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1142 rs.close(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1143 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1144 sb.append("7. drop table..."); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1145 stmt.execute("DROP TABLE Test_PSlargebatchval"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1146 sb.append("success\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1147 stmt.close(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1148 } catch (SQLException e) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1149 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1150 while ((e = e.getNextException()) != null) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1151 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1152 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1153 closeStmtResSet(stmt, rs); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1154 closeStmtResSet(pstmt, null); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1155 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1156 compareExpectedOutput("Test_PSlargebatchval", |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1157 "0. true true\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1158 "1. creating test table...success\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1159 "2. prepare insert...success\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1160 "3. inserted 1 large string\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1161 "4. inserted 1 large clob via StringReader() object\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1162 "5. inserted 1 large clob via createClob() object\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1163 "6. select count(*)... 3 rows inserted.\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1164 "7. drop table...success\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1165 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1166 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1167 private void Test_PSlargeresponse(String conURL) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1168 sb.setLength(0); // clear the output log buffer |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1169 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1170 PreparedStatement pstmt = null; |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1171 try { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1172 sb.append("1. DatabaseMetadata environment retrieval... "); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1173 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1174 // retrieve this to simulate a bug report |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1175 DatabaseMetaData dbmd = con.getMetaData(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1176 if (conURL.startsWith(dbmd.getURL())) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1177 sb.append("oke"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1178 else |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1179 sb.append("not oke ").append(dbmd.getURL()); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1180 sb.append("\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1181 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1182 pstmt = con.prepareStatement("select * from columns"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1183 sb.append("2. empty call..."); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1184 // should succeed (no arguments given) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1185 pstmt.execute(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1186 sb.append(" passed\n"); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1187 } catch (SQLException e) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1188 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1189 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1190 closeStmtResSet(pstmt, null); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1191 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1192 compareExpectedOutput("Test_PSlargeresponse", |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1193 "1. DatabaseMetadata environment retrieval... oke\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1194 "2. empty call... passed\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1195 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1196 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1197 private void Test_PSmanycon(String arg0) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1198 sb.setLength(0); // clear the output log buffer |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1199 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1200 final int maxCons = 60; // default max_clients is 64, 2 connections are already open from this program |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1201 List<PreparedStatement> pss = new ArrayList<PreparedStatement>(maxCons); // PreparedStatements go in here |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1202 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1203 try { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1204 // spawn a lot of Connections with 1 PreparedStatement, just for fun... |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1205 int i = 1; |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1206 sb.append("Establishing Connection "); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1207 for (; i <= maxCons; i++) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1208 sb.append(i); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1209 Connection conx = DriverManager.getConnection(arg0); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1210 sb.append(","); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1211 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1212 // do something with the connection to test if it works |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1213 PreparedStatement pstmt = conx.prepareStatement("select " + i); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1214 sb.append(" "); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1215 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1216 pss.add(pstmt); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1217 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1218 sb.append("\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1219 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1220 // now try to nicely execute them |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1221 i = 1; |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1222 sb.append("Executing PreparedStatement\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1223 for (Iterator<PreparedStatement> it = pss.iterator(); it.hasNext(); i++) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1224 PreparedStatement pstmt = it.next(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1225 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1226 // see if the connection still works |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1227 sb.append(i).append("..."); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1228 if (!pstmt.execute()) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1229 sb.append("should have seen a ResultSet!"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1230 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1231 ResultSet rs = pstmt.getResultSet(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1232 if (!rs.next()) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1233 sb.append("ResultSet is empty"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1234 sb.append(" result: ").append(rs.getString(1)); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1235 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1236 // close the connection and associated resources |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1237 pstmt.getConnection().close(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1238 sb.append(", closed. "); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1239 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1240 if (i % 5 == 0) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1241 // inject a failed transaction |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1242 Connection conZZ = DriverManager.getConnection(arg0); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1243 Statement stmt = con.createStatement(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1244 try { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1245 int affrows = stmt.executeUpdate("update foo where bar is wrong"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1246 sb.append("oops, faulty statement just got through"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1247 } catch (SQLException e) { |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1248 sb.append("Forced transaction failure"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1249 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1250 sb.append("\n"); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1251 closeStmtResSet(stmt, null); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1252 conZZ.close(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1253 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1254 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1255 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1256 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1257 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1258 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1259 compareExpectedOutput("Test_PSmanycon", |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1260 "Establishing Connection 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, " + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1261 "11, 12, 13, 14, 15, 16, 17, 18, 19, 20, " + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1262 "21, 22, 23, 24, 25, 26, 27, 28, 29, 30, " + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1263 "31, 32, 33, 34, 35, 36, 37, 38, 39, 40, " + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1264 "41, 42, 43, 44, 45, 46, 47, 48, 49, 50, " + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1265 "51, 52, 53, 54, 55, 56, 57, 58, 59, 60, \n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1266 "Executing PreparedStatement\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1267 "1... result: 1, closed. 2... result: 2, closed. 3... result: 3, closed. 4... result: 4, closed. 5... result: 5, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1268 "6... result: 6, closed. 7... result: 7, closed. 8... result: 8, closed. 9... result: 9, closed. 10... result: 10, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1269 "11... result: 11, closed. 12... result: 12, closed. 13... result: 13, closed. 14... result: 14, closed. 15... result: 15, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1270 "16... result: 16, closed. 17... result: 17, closed. 18... result: 18, closed. 19... result: 19, closed. 20... result: 20, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1271 "21... result: 21, closed. 22... result: 22, closed. 23... result: 23, closed. 24... result: 24, closed. 25... result: 25, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1272 "26... result: 26, closed. 27... result: 27, closed. 28... result: 28, closed. 29... result: 29, closed. 30... result: 30, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1273 "31... result: 31, closed. 32... result: 32, closed. 33... result: 33, closed. 34... result: 34, closed. 35... result: 35, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1274 "36... result: 36, closed. 37... result: 37, closed. 38... result: 38, closed. 39... result: 39, closed. 40... result: 40, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1275 "41... result: 41, closed. 42... result: 42, closed. 43... result: 43, closed. 44... result: 44, closed. 45... result: 45, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1276 "46... result: 46, closed. 47... result: 47, closed. 48... result: 48, closed. 49... result: 49, closed. 50... result: 50, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1277 "51... result: 51, closed. 52... result: 52, closed. 53... result: 53, closed. 54... result: 54, closed. 55... result: 55, closed. Forced transaction failure\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1278 "56... result: 56, closed. 57... result: 57, closed. 58... result: 58, closed. 59... result: 59, closed. 60... result: 60, closed. Forced transaction failure\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1279 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1280 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1281 private void Test_PSmetadata() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1282 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1283 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1284 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1285 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1286 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1287 // >> false: auto commit was just switched off |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1288 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1289 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1290 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1291 int updates = 0; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1292 updates = stmt.executeUpdate("CREATE TABLE table_Test_PSmetadata ( myint int, mydouble double, mybool boolean, myvarchar varchar(15), myclob clob )"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1293 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1294 sb.append("1. Expected -2 got ").append(updates).append(" instead\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1295 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1296 // all NULLs |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1297 updates = stmt.executeUpdate("INSERT INTO table_Test_PSmetadata VALUES (NULL, NULL, NULL, NULL, NULL)"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1298 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1299 sb.append("2a. Expected 1 got ").append(updates).append(" instead\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1300 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1301 // all filled in |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1302 updates = stmt.executeUpdate("INSERT INTO table_Test_PSmetadata VALUES (2 , 3.0, true, 'A string', 'bla bla bla')"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1303 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1304 sb.append("2b. Expected 1 got ").append(updates).append(" instead\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1305 } catch (SQLException e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1306 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1307 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1308 closeStmtResSet(stmt, null); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1309 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1310 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1311 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1312 pstmt = con.prepareStatement("SELECT CASE WHEN myint IS NULL THEN 0 ELSE 1 END AS intnull, * FROM table_Test_PSmetadata WHERE myint = ?"); |
450
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1313 sb.append(pstmt.toString()); // test showing prepared statement |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1314 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1315 // testing and showing result set meta data |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1316 ResultSetMetaData rsmd = pstmt.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1317 sb.append("rsmd. ").append(rsmd.getColumnCount()).append(" columns:\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1318 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1319 sb.append("RCol ").append(col).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1320 sb.append(" classname ").append(rsmd.getColumnClassName(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1321 sb.append(" displaysize ").append(rsmd.getColumnDisplaySize(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1322 sb.append(" label ").append(rsmd.getColumnLabel(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1323 sb.append(" name ").append(rsmd.getColumnName(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1324 sb.append(" type ").append(rsmd.getColumnType(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1325 sb.append(" typename ").append(rsmd.getColumnTypeName(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1326 sb.append(" precision ").append(rsmd.getPrecision(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1327 sb.append(" scale ").append(rsmd.getScale(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1328 sb.append(" catalogname ").append(rsmd.getCatalogName(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1329 sb.append(" schemaname ").append(rsmd.getSchemaName(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1330 sb.append(" tablename ").append(rsmd.getTableName(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1331 sb.append(" autoincrement ").append(rsmd.isAutoIncrement(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1332 sb.append(" casesensitive ").append(rsmd.isCaseSensitive(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1333 sb.append(" currency ").append(rsmd.isCurrency(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1334 sb.append(" defwritable ").append(rsmd.isDefinitelyWritable(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1335 sb.append(" nullable ").append(rsmd.isNullable(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1336 sb.append(" readonly ").append(rsmd.isReadOnly(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1337 sb.append(" searchable ").append(rsmd.isSearchable(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1338 sb.append(" signed ").append(rsmd.isSigned(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1339 sb.append(" writable ").append(rsmd.isWritable(col)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1340 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1341 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1342 showParams(pstmt); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1343 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1344 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1345 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1346 // >> true: auto commit was just switched on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1347 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1348 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1349 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1350 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1351 closeStmtResSet(pstmt, null); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1352 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1353 compareExpectedOutput("Test_PSmetadata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1354 "0. false\tfalse\n" + |
450
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1355 "Prepared SQL: SELECT CASE WHEN myint IS NULL THEN 0 ELSE 1 END AS intnull, * FROM table_Test_PSmetadata WHERE myint = ?\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1356 " parameter 1 int, set value: <null>\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1357 "rsmd. 6 columns:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1358 "RCol 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1359 " classname java.lang.Short\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1360 " displaysize 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1361 " label intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1362 " name intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1363 " type -6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1364 " typename tinyint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1365 " precision 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1366 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1367 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1368 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1369 " tablename \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1370 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1371 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1372 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1373 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1374 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1375 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1376 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1377 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1378 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1379 "RCol 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1380 " classname java.lang.Integer\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1381 " displaysize 32\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1382 " label myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1383 " name myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1384 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1385 " typename int\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1386 " precision 32\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1387 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1388 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1389 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1390 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1391 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1392 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1393 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1394 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1395 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1396 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1397 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1398 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1399 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1400 "RCol 3\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1401 " classname java.lang.Double\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1402 " displaysize 53\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1403 " label mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1404 " name mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1405 " type 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1406 " typename double\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1407 " precision 53\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1408 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1409 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1410 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1411 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1412 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1413 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1414 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1415 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1416 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1417 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1418 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1419 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1420 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1421 "RCol 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1422 " classname java.lang.Boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1423 " displaysize 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1424 " label mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1425 " name mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1426 " type 16\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1427 " typename boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1428 " precision 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1429 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1430 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1431 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1432 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1433 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1434 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1435 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1436 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1437 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1438 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1439 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1440 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1441 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1442 "RCol 5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1443 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1444 " displaysize 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1445 " label myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1446 " name myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1447 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1448 " typename varchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1449 " precision 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1450 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1451 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1452 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1453 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1454 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1455 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1456 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1457 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1458 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1459 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1460 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1461 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1462 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1463 "RCol 6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1464 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1465 " displaysize 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1466 " label myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1467 " name myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1468 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1469 " typename clob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1470 " precision 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1471 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1472 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1473 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1474 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1475 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1476 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1477 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1478 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1479 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1480 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1481 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1482 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1483 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1484 "pmd. 1 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1485 "Param 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1486 " nullable 2 (UNKNOWN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1487 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1488 " precision 32\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1489 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1490 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1491 " typename int\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1492 " classname java.lang.Integer\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1493 " mode 1 (IN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1494 "0. true\ttrue\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1495 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1496 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1497 private void Test_PSsomeamount() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1498 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1499 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1500 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1501 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1502 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1503 // >> true: auto commit should be on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1504 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1505 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1506 sb.append("1. Preparing and executing a unique statement\n"); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1507 for (int i = 0; i < 120; i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1508 pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1509 pstmt.setInt(1, i); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1510 rs = pstmt.executeQuery(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1511 if (rs.next() && i % 20 == 0) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1512 sb.append(rs.getInt(1)).append(", ").append(rs.getBoolean(2)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1513 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1514 /* next call should cause resources on the server to be freed */ |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1515 pstmt.close(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1516 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1517 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1518 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1519 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1520 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1521 closeStmtResSet(pstmt, rs); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1522 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1523 compareExpectedOutput("Test_PSsomeamount", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1524 "0. true true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1525 "1. Preparing and executing a unique statement\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1526 "0, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1527 "20, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1528 "40, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1529 "60, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1530 "80, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1531 "100, true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1532 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1533 |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1534 /* Create a lot of PreparedStatements, to emulate webloads such as those from Hibernate. */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1535 /* this test is same as Test_PSsomeamount() but for many more PreparedStatements to stress the server */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1536 private void Test_PSlargeamount() { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1537 sb.setLength(0); // clear the output log buffer |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1538 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1539 PreparedStatement pstmt = null; |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1540 ResultSet rs = null; |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1541 try { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1542 // >> true: auto commit should be on |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1543 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1544 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1545 sb.append("1. Preparing and executing a unique statement\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1546 for (int i = 0; i < 50001; i++) { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1547 pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1548 pstmt.setInt(1, i); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1549 rs = pstmt.executeQuery(); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1550 if (rs.next() && i % 1000 == 0) { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1551 sb.append(rs.getInt(1)).append(", ").append(rs.getBoolean(2)).append("\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1552 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1553 /* next call should cause resources on the server to be freed */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1554 pstmt.close(); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1555 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1556 } catch (SQLException e) { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1557 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1558 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1559 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1560 closeStmtResSet(pstmt, rs); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1561 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1562 compareExpectedOutput("Test_PSlargeamount", |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1563 "0. true true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1564 "1. Preparing and executing a unique statement\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1565 "0, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1566 "1000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1567 "2000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1568 "3000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1569 "4000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1570 "5000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1571 "6000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1572 "7000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1573 "8000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1574 "9000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1575 "10000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1576 "11000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1577 "12000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1578 "13000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1579 "14000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1580 "15000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1581 "16000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1582 "17000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1583 "18000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1584 "19000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1585 "20000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1586 "21000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1587 "22000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1588 "23000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1589 "24000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1590 "25000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1591 "26000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1592 "27000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1593 "28000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1594 "29000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1595 "30000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1596 "31000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1597 "32000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1598 "33000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1599 "34000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1600 "35000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1601 "36000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1602 "37000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1603 "38000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1604 "39000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1605 "40000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1606 "41000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1607 "42000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1608 "43000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1609 "44000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1610 "45000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1611 "46000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1612 "47000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1613 "48000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1614 "49000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1615 "50000, true\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1616 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
1617 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1618 private void Test_PSsqldata() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1619 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1620 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1621 Statement stmt = null; |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1622 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1623 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1624 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1625 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1626 // >> false: auto commit should be off now |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1627 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1628 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1629 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1630 int updates = stmt.executeUpdate("CREATE TABLE table_Test_PSsqldata ( myinet inet, myurl url )"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1631 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1632 sb.append("1. Expected -2 got ").append(updates).append(" instead\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1633 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1634 pstmt = con.prepareStatement("INSERT INTO table_Test_PSsqldata VALUES (?, ?)"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1635 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1636 sb.append(pmd.getParameterCount()).append(" parameters:\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1637 for (int parm = 1; parm <= pmd.getParameterCount(); parm++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1638 sb.append("Parm ").append(parm).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1639 sb.append(" type ").append(pmd.getParameterType(parm)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1640 sb.append(" typename ").append(pmd.getParameterTypeName(parm)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1641 sb.append(" classname ").append(pmd.getParameterClassName(parm)).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1642 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1643 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1644 INET tinet = new INET(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1645 tinet.fromString("172.5.5.5/24"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1646 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1647 URL turl = new URL(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1648 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1649 turl.fromString("http://www.monetdb.org/"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1650 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1651 sb.append("conversion failed: ").append(e.getMessage()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1652 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1653 pstmt.setObject(1, tinet); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1654 pstmt.setObject(2, turl); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1655 // insert first record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1656 pstmt.execute(); |
450
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1657 sb.append(pstmt.toString()); // test showing prepared statement |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1658 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1659 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1660 tinet.setNetmaskBits(16); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1661 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1662 sb.append("setNetmaskBits failed: ").append(e.getMessage()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1663 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1664 // insert second record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1665 pstmt.execute(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1666 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1667 rs = stmt.executeQuery("SELECT * FROM table_Test_PSsqldata"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1668 ResultSetMetaData rsmd = rs.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1669 for (int i = 1; rs.next(); i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1670 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1671 Object x = rs.getObject(col); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1672 if (x == null || rs.wasNull()) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1673 sb.append(i).append(".\t<null>\n"); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1674 } else { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1675 sb.append(i).append(".\t").append(x.toString()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1676 if (x instanceof INET) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1677 INET inet = (INET)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1678 sb.append(" ").append(inet.getAddress()).append("/").append(inet.getNetmaskBits()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1679 sb.append(" ").append(inet.getInetAddress().toString()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1680 } else if (x instanceof URL) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1681 URL url = (URL)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1682 sb.append(" ").append(url.getURL().toString()).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1683 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1684 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1685 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1686 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1687 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1688 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1689 // >> true: auto commit was just switched on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1690 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1691 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1692 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1693 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1694 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1695 closeStmtResSet(stmt, rs); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1696 closeStmtResSet(pstmt, null); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1697 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1698 compareExpectedOutput("Test_PSsqldata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1699 "0. false false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1700 "2 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1701 "Parm 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1702 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1703 " typename inet\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1704 " classname org.monetdb.jdbc.types.INET\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1705 "Parm 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1706 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1707 " typename url\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1708 " classname org.monetdb.jdbc.types.URL\n" + |
450
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1709 "Prepared SQL: INSERT INTO table_Test_PSsqldata VALUES (?, ?)\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1710 " parameter 1 inet, set value: inet '172.5.5.5/24'\n" + |
b9f82064fe0c
Implemented PreparedStatement.toString() as requested by https://github.com/MonetDB/monetdb-java/issues/8
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
448
diff
changeset
|
1711 " parameter 2 url, set value: url 'http://www.monetdb.org/'\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1712 "1. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1713 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1714 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1715 "1. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1716 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1717 "2. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1718 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1719 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1720 "2. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1721 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1722 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1723 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1724 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1725 private void Test_PStimedate() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1726 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1727 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1728 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1729 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1730 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1731 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1732 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1733 // >> false: auto commit should be off now |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1734 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1735 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1736 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1737 int updates = stmt.executeUpdate("CREATE TABLE Test_PStimedate (t time, ts timestamp, d date)"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1738 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1739 sb.append("1. Expected -2 got ").append(updates).append(" instead\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1740 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1741 pstmt = con.prepareStatement("INSERT INTO Test_PStimedate VALUES (?, ?, ?)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1742 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1743 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1744 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1745 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1746 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1747 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1748 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1749 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1750 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1751 sb.append("2. inserting a record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1752 java.util.Date d = new java.util.Date(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1753 pstmt.setTime(1, new java.sql.Time(d.getTime())); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1754 pstmt.setTimestamp(2, new java.sql.Timestamp(d.getTime())); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1755 pstmt.setDate(3, new java.sql.Date(d.getTime())); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1756 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1757 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1758 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1759 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1760 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1761 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1762 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1763 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1764 sb.append("4. selecting record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1765 pstmt = con.prepareStatement("SELECT * FROM Test_PStimedate"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1766 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1767 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1768 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1769 while (rs.next()) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1770 for (int j = 1; j <= 3; j++) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1771 sb.append((j+4)).append(". retrieving..."); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1772 java.util.Date x = (java.util.Date)(rs.getObject(j)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1773 boolean matches = false; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1774 if (x instanceof Time) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1775 sb.append(" (Time)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1776 matches = (new Time(d.getTime())).toString().equals(x.toString()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1777 } else if (x instanceof Date) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1778 sb.append(" (Date)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1779 matches = (new Date(d.getTime())).toString().equals(x.toString()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1780 } else if (x instanceof Timestamp) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1781 sb.append(" (Timestamp)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1782 matches = (new Timestamp(d.getTime())).toString().equals(x.toString()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1783 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1784 if (matches) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1785 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1786 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1787 sb.append(" FAILED (").append(x).append(" is not ").append(d).append(")\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1788 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1789 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1790 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1791 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1792 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1793 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1794 // >> true: auto commit was just switched on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1795 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1796 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1797 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1798 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1799 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1800 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1801 closeStmtResSet(pstmt, rs); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1802 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1803 compareExpectedOutput("Test_PStimedate", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1804 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1805 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1806 "2. inserting a record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1807 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1808 "4. selecting record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1809 "5. retrieving... (Time) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1810 "6. retrieving... (Timestamp) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1811 "7. retrieving... (Date) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1812 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1813 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1814 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1815 private void Test_PStimezone() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1816 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1817 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1818 // make sure this test is reproducable regardless timezone |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1819 // setting, by overriding the VM's default |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1820 // we have to make sure that one doesn't have daylight |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1821 // savings corrections |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1822 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1823 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1824 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1825 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1826 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1827 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1828 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1829 // >> false: auto commit should be off now |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1830 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1831 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1832 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1833 int updates = stmt.executeUpdate("CREATE TABLE Test_PStimezone (ts timestamp, tsz timestamp with time zone, t time, tz time with time zone)"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1834 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1835 sb.append("1. Expected -2 got ").append(updates).append(" instead\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1836 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1837 pstmt = con.prepareStatement("INSERT INTO Test_PStimezone VALUES (?, ?, ?, ?)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1838 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1839 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1840 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1841 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1842 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1843 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1844 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1845 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1846 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1847 sb.append("2. inserting records...\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1848 java.sql.Timestamp ts = new java.sql.Timestamp(0L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1849 java.sql.Time t = new java.sql.Time(0L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1850 Calendar c = Calendar.getInstance(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1851 SimpleDateFormat tsz = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1852 SimpleDateFormat tz = new SimpleDateFormat("HH:mm:ss.SSSZ"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1853 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1854 tsz.setTimeZone(c.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1855 tz.setTimeZone(tsz.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1856 sb.append("inserting (").append(c.getTimeZone().getID()).append(") ").append(tsz.format(ts)).append(", ").append(tz.format(t)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1857 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1858 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1859 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1860 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1861 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1862 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1863 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1864 c.setTimeZone(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1865 sb.append("inserting with calendar timezone ").append(c.getTimeZone().getID()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1866 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1867 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1868 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1869 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1870 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1871 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1872 c.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles")); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1873 sb.append("inserting with calendar timezone ").append(c.getTimeZone().getID()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1874 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1875 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1876 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1877 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1878 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1879 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1880 c.setTimeZone(TimeZone.getTimeZone("GMT+04:15")); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1881 sb.append("inserting with calendar timezone ").append(c.getTimeZone().getID()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1882 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1883 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1884 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1885 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1886 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1887 sb.append(" done\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1888 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1889 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1890 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1891 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1892 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1893 sb.append("4. selecting records..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1894 pstmt = con.prepareStatement("SELECT * FROM Test_PStimezone"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1895 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1896 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1897 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1898 // The tz fields should basically always be the same |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1899 // (exactly 1st Jan 1970) since whatever timezone is used, |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1900 // the server retains it, and Java restores it. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1901 // The zoneless fields will show differences since the time |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1902 // is inserted translated to the given timezones, and |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1903 // retrieved as in they were given in those timezones. |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1904 // When the insert zone matches the retrieve zone, Java should |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1905 // eventually see 1st Jan 1970. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1906 while (rs.next()) { |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1907 sb.append("retrieved row (String):\n") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1908 .append(rs.getString("ts")).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1909 // .append(rs.getString("tsz")).append(" | ") -- this values changes when summer or wintertime changes so no stable output |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1910 .append(rs.getString("t")).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1911 // .append(rs.getString("tz")) -- this values changes when summer or wintertime changes so no stable output |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1912 .append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1913 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1914 tsz.setTimeZone(TimeZone.getDefault()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1915 tz.setTimeZone(tsz.getTimeZone()); |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1916 sb.append("default (").append(tsz.getTimeZone().getID()).append("):\n") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1917 .append(tsz.format(rs.getTimestamp("ts"))).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1918 .append(tsz.format(rs.getTimestamp("tsz"))).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1919 .append(tz.format(rs.getTime("t"))).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1920 .append(tz.format(rs.getTime("tz"))).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1921 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1922 c.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles")); |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1923 sb.append(c.getTimeZone().getID()).append(":\n") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1924 .append(rs.getTimestamp("ts", c)).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1925 .append(rs.getTimestamp("tsz", c)).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1926 .append(rs.getTime("t", c)).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1927 .append(rs.getTime("tz", c)).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1928 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1929 c.setTimeZone(TimeZone.getTimeZone("Africa/Windhoek")); |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1930 sb.append(c.getTimeZone().getID()).append(":\n") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1931 .append(rs.getTimestamp("ts", c)).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1932 .append(rs.getTimestamp("tsz", c)).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1933 .append(rs.getTime("t", c)).append(" | ") |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1934 .append(rs.getTime("tz", c)).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1935 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1936 SQLWarning w = rs.getWarnings(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1937 while (w != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1938 sb.append(w.getMessage()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1939 w = w.getNextWarning(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1940 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1941 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1942 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1943 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1944 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1945 // >> true: auto commit was just switched on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1946 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1947 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1948 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1949 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1950 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1951 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1952 closeStmtResSet(pstmt, rs); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1953 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1954 compareExpectedOutput("Test_PStimezone", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1955 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1956 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1957 "2. inserting records...\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1958 "inserting (UTC) 1970-01-01 00:00:00.000+0000, 00:00:00.000+0000\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1959 "inserting with calendar timezone UTC\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1960 "inserting with calendar timezone America/Los_Angeles\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1961 "inserting with calendar timezone GMT+04:15\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1962 " done\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1963 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1964 "4. selecting records... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1965 "retrieved row (String):\n" + |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1966 // old output "1970-01-01 00:00:00.000000 | 1970-01-01 01:00:00.000000+01:00 | 00:00:00 | 01:00:00+01:00\n" + |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1967 "1970-01-01 00:00:00.000000 | 00:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1968 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1969 "1970-01-01 00:00:00.000+0000 | 1970-01-01 00:00:00.000+0000 | 00:00:00.000+0000 | 00:00:00.000+0000\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1970 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1971 "1970-01-01 08:00:00.0 | 1970-01-01 00:00:00.0 | 08:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1972 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1973 "1969-12-31 22:00:00.0 | 1970-01-01 00:00:00.0 | 22:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1974 "retrieved row (String):\n" + |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1975 // old output "1970-01-01 00:00:00.000000 | 1970-01-01 01:00:00.000000+01:00 | 00:00:00 | 01:00:00+01:00\n" + |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1976 "1970-01-01 00:00:00.000000 | 00:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1977 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1978 "1970-01-01 00:00:00.000+0000 | 1970-01-01 00:00:00.000+0000 | 00:00:00.000+0000 | 00:00:00.000+0000\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1979 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1980 "1970-01-01 08:00:00.0 | 1970-01-01 00:00:00.0 | 08:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1981 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1982 "1969-12-31 22:00:00.0 | 1970-01-01 00:00:00.0 | 22:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1983 "retrieved row (String):\n" + |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1984 // old output "1969-12-31 16:00:00.000000 | 1970-01-01 01:00:00.000000+01:00 | 16:00:00 | 01:00:00+01:00\n" + |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1985 "1969-12-31 16:00:00.000000 | 16:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1986 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1987 "1969-12-31 16:00:00.000+0000 | 1970-01-01 00:00:00.000+0000 | 16:00:00.000+0000 | 00:00:00.000+0000\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1988 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1989 "1970-01-01 00:00:00.0 | 1970-01-01 00:00:00.0 | 00:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1990 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1991 "1969-12-31 14:00:00.0 | 1970-01-01 00:00:00.0 | 14:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1992 "retrieved row (String):\n" + |
463
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1993 // old output "1970-01-01 00:00:00.000000 | 1970-01-01 01:00:00.000000+01:00 | 00:00:00 | 01:00:00+01:00\n" + |
cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
458
diff
changeset
|
1994 "1970-01-01 00:00:00.000000 | 00:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1995 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1996 "1970-01-01 00:00:00.000+0000 | 1970-01-01 00:00:00.000+0000 | 00:00:00.000+0000 | 00:00:00.000+0000\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1997 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1998 "1970-01-01 08:00:00.0 | 1970-01-01 00:00:00.0 | 08:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1999 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2000 "1969-12-31 22:00:00.0 | 1970-01-01 00:00:00.0 | 22:00:00 | 00:00:00\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2001 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2002 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2003 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2004 private void Test_PStypes() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2005 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2006 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2007 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2008 PreparedStatement pstmt = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2009 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2010 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2011 // >> false: auto commit should be off now |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2012 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2013 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2014 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2015 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2016 "CREATE TABLE htmtest (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2017 " htmid bigint NOT NULL," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2018 " ra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2019 " decl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2020 " dra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2021 " ddecl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2022 " flux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2023 " dflux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2024 " freq double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2025 " bw double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2026 " type decimal(1,0)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2027 " imageurl varchar(100)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2028 " comment varchar(100)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2029 " CONSTRAINT htmtest_htmid_pkey PRIMARY KEY (htmid)" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2030 ")" ); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2031 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2032 sb.append("1. Expected -2 got ").append(updates).append(" instead\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2033 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2034 // index is not used, but the original bug had it too |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2035 updates = stmt.executeUpdate("CREATE INDEX htmid ON htmtest (htmid)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2036 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2037 sb.append("1. Expected -2 got ").append(updates).append(" instead\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2038 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2039 stmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2040 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2041 pstmt = con.prepareStatement("INSERT INTO HTMTEST (HTMID,RA,DECL,FLUX,COMMENT) VALUES (?,?,?,?,?)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2042 sb.append("1. inserting a record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2043 pstmt.setLong(1, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2044 pstmt.setFloat(2, (float)1.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2045 pstmt.setDouble(3, 2.4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2046 pstmt.setDouble(4, 3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2047 pstmt.setString(5, "vlavbla"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2048 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2049 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2050 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2051 // try an update like bug #1757923 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2052 pstmt = con.prepareStatement("UPDATE HTMTEST set COMMENT=?, TYPE=? WHERE HTMID=?"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2053 sb.append("2. updating record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2054 pstmt.setString(1, "some update"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2055 pstmt.setObject(2, (float)3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2056 pstmt.setLong(3, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2057 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2058 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2059 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2060 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2061 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2062 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2063 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2064 // >> true: auto commit was just switched on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2065 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2066 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2067 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2068 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2069 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2070 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2071 closeStmtResSet(pstmt, null); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2072 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2073 compareExpectedOutput("Test_PStypes", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2074 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2075 "1. inserting a record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2076 "2. updating record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2077 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2078 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2079 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2080 private void Test_CallableStmt() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2081 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2082 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2083 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2084 CallableStatement cstmt = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2085 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2086 String tbl_nm = "tbl6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2087 String proc_nm = "proc6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2088 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2089 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2090 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2091 // create a test table. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2092 stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + tbl_nm + " (tint int, tdouble double, tbool boolean, tvarchar varchar(15), tclob clob, turl url, tclen int);"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2093 sb.append("Created table: ").append(tbl_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2094 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2095 // create a procedure with multiple different IN parameters which inserts a row into a table of which one column is computed. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2096 stmt.executeUpdate("CREATE PROCEDURE " + proc_nm + " (myint int, mydouble double, mybool boolean, myvarchar varchar(15), myclob clob, myurl url) BEGIN" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2097 " INSERT INTO " + tbl_nm + " (tint, tdouble, tbool, tvarchar, tclob, turl, tclen) VALUES (myint, mydouble, mybool, myvarchar, myclob, myurl, LENGTH(myvarchar) + LENGTH(myclob)); " + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2098 "END;"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2099 sb.append("Created procedure: ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2100 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2101 // make sure we can call the procedure the old way (as string) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2102 stmt.executeUpdate("call " + proc_nm + "(1, 1.1, true,'one','ONE', 'www.monetdb.org');"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2103 sb.append("Called procedure (1): ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2104 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2105 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2106 // now use a CallableStament object |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2107 cstmt = con.prepareCall(" { call " + proc_nm + " (?,?, ?, ? , ?,?) } ;"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2108 sb.append("Prepared Callable procedure: ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2109 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2110 // specify first set of params |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2111 cstmt.setInt(1, 2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2112 cstmt.setDouble(2, 2.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2113 cstmt.setBoolean(3, true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2114 cstmt.setString(4, "Two"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2115 Clob myclob = con.createClob(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2116 myclob.setString(1, "TWOs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2117 cstmt.setClob(5, myclob); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2118 cstmt.setString(6, "http://www.monetdb.org/"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2119 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2120 sb.append("Called Prepared procedure (1): ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2121 showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2122 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2123 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2124 myclob.setString(1, "TREEs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2125 // specify second set of params (some (1 and 3 and 5) are left the same) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2126 cstmt.setDouble(2, 3.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2127 cstmt.setString(4, "Tree"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2128 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2129 cstmt.setURL(6, new java.net.URL("https://www.monetdb.org/")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2130 } catch (java.net.MalformedURLException mfue) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2131 sb.append("Invalid URL: ").append(mfue.getMessage()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2132 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2133 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2134 sb.append("Called Prepared procedure (2): ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2135 // showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2136 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2137 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2138 // specify third set of params (some (1 and 2) are left the same) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2139 cstmt.setInt(1, 4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2140 cstmt.setBoolean(3, false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2141 cstmt.setString(4, "Four"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2142 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2143 sb.append("Called Prepared procedure (3): ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2144 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2145 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2146 // test setNull() also |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2147 cstmt.setNull(3, Types.BOOLEAN); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2148 cstmt.setNull(5, Types.CLOB); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2149 cstmt.setNull(2, Types.DOUBLE); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2150 cstmt.setNull(4, Types.VARCHAR); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2151 cstmt.setNull(1, Types.INTEGER); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2152 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2153 sb.append("Called Prepared procedure (with NULLs): ").append(proc_nm).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2154 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2155 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
2156 sb.append("Test completed. Cleanup procedure and table.\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2157 stmt.execute("DROP PROCEDURE IF EXISTS " + proc_nm + ";"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2158 stmt.execute("DROP TABLE IF EXISTS " + tbl_nm + ";"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2159 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2160 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2161 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2162 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2163 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2164 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2165 closeStmtResSet(cstmt, null); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2166 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2167 compareExpectedOutput("Test_CallableStmt", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2168 "Created table: tbl6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2169 "Created procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2170 "Called procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2171 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2172 " tint tdouble tbool tvarchar tclob turl tclen\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2173 " 1 1.1 true one ONE www.monetdb.org 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2174 "Prepared Callable procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2175 "Called Prepared procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2176 "pmd. 6 parameters:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2177 "Param 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2178 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2179 " signed true\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2180 " precision 32\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2181 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2182 " type 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2183 " typename int\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2184 " classname java.lang.Integer\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2185 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2186 "Param 2\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2187 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2188 " signed true\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2189 " precision 53\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2190 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2191 " type 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2192 " typename double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2193 " classname java.lang.Double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2194 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2195 "Param 3\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2196 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2197 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2198 " precision 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2199 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2200 " type 16\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2201 " typename boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2202 " classname java.lang.Boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2203 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2204 "Param 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2205 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2206 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2207 " precision 15\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2208 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2209 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2210 " typename varchar\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2211 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2212 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2213 "Param 5\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2214 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2215 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2216 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2217 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2218 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2219 " typename clob\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2220 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2221 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2222 "Param 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2223 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2224 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2225 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2226 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2227 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2228 " typename url\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2229 " classname org.monetdb.jdbc.types.URL\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2230 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2231 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2232 " tint tdouble tbool tvarchar tclob turl tclen\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2233 " 1 1.1 true one ONE www.monetdb.org 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2234 " 2 2.02 true Two TWOs http://www.monetdb.org/ 7\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2235 "Called Prepared procedure (2): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2236 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2237 " tint tdouble tbool tvarchar tclob turl tclen\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2238 " 1 1.1 true one ONE www.monetdb.org 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2239 " 2 2.02 true Two TWOs http://www.monetdb.org/ 7\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2240 " 2 3.02 true Tree TWOs https://www.monetdb.org/ 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2241 "Called Prepared procedure (3): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2242 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2243 " tint tdouble tbool tvarchar tclob turl tclen\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2244 " 1 1.1 true one ONE www.monetdb.org 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2245 " 2 2.02 true Two TWOs http://www.monetdb.org/ 7\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2246 " 2 3.02 true Tree TWOs https://www.monetdb.org/ 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2247 " 4 3.02 false Four TWOs https://www.monetdb.org/ 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2248 "Called Prepared procedure (with NULLs): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2249 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2250 " tint tdouble tbool tvarchar tclob turl tclen\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2251 " 1 1.1 true one ONE www.monetdb.org 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2252 " 2 2.02 true Two TWOs http://www.monetdb.org/ 7\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2253 " 2 3.02 true Tree TWOs https://www.monetdb.org/ 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2254 " 4 3.02 false Four TWOs https://www.monetdb.org/ 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2255 " null null null null null https://www.monetdb.org/ null\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2256 "Test completed. Cleanup procedure and table.\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2257 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2258 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2259 private void Test_Rbooleans() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2260 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2261 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2262 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2263 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2264 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2265 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2266 // >> false: auto commit should be off now |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2267 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2268 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2269 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2270 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2271 "CREATE TABLE Test_Rbooleans (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2272 " id int, tiny_int tinyint, small_int smallint, medium_int mediumint, \"integer\" int, big_int bigint," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2273 " a_real real, a_float float, a_double double, a_decimal decimal(8,2), a_numeric numeric(8)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2274 " bool boolean, a_char char(4), b_char char(5), a_varchar varchar(20), PRIMARY KEY (id) )"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2275 if (updates != Statement.SUCCESS_NO_INFO) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2276 sb.append("1a. Expected -2 got ").append(updates).append(" instead\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2277 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2278 // all falses |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2279 updates = stmt.executeUpdate("INSERT INTO Test_Rbooleans VALUES (1,0,0,0,0,0,0.0,0.0,0.0,0.0,0,false,'fals','false','false')"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2280 // all trues |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2281 updates += stmt.executeUpdate("INSERT INTO Test_Rbooleans VALUES (2,1,1,1,1,1,1.0,1.0,1.0,1.0,1,true,'true','true ','true')"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2282 // sneakier |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2283 updates += stmt.executeUpdate("INSERT INTO Test_Rbooleans VALUES (3,2,3,4,5,6,7.1,8.2,9.3,10.4,11,true,'TrUe','fAlSe','true/false')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2284 updates += stmt.executeUpdate("INSERT INTO Test_Rbooleans VALUES (4,2,3,4,5,6,7.1,8.2,9.3,10.4,11,true,'t ','f ','TRUE ')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2285 if (updates != 4) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2286 sb.append("1b. Expected 4 got ").append(updates).append(" instead\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2287 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2288 rs = stmt.executeQuery("SELECT * FROM Test_Rbooleans ORDER BY id ASC"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2289 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2290 // all should give false |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2291 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2292 sb.append("1. ").append(rs.getInt("id")).append(", ").append(rs.getBoolean("tiny_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2293 .append(", ").append(rs.getBoolean("small_int")).append(", ").append(rs.getBoolean("medium_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2294 .append(", ").append(rs.getBoolean("integer")).append(", ").append(rs.getBoolean("big_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2295 .append(", ").append(rs.getBoolean("a_real")).append(", ").append(rs.getBoolean("a_double")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2296 .append(", ").append(rs.getBoolean("a_decimal")).append(", ").append(rs.getBoolean("a_numeric")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2297 .append(", ").append(rs.getBoolean("bool")).append(", ").append(rs.getBoolean("a_char")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2298 .append(", ").append(rs.getBoolean("b_char")).append(", ").append(rs.getBoolean("a_varchar")).append("\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2299 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2300 // all should give true except the one before last |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2301 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2302 sb.append("2. ").append(rs.getInt("id")).append(", ").append(rs.getBoolean("tiny_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2303 .append(", ").append(rs.getBoolean("small_int")).append(", ").append(rs.getBoolean("medium_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2304 .append(", ").append(rs.getBoolean("integer")).append(", ").append(rs.getBoolean("big_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2305 .append(", ").append(rs.getBoolean("a_real")).append(", ").append(rs.getBoolean("a_double")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2306 .append(", ").append(rs.getBoolean("a_decimal")).append(", ").append(rs.getBoolean("a_numeric")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2307 .append(", ").append(rs.getBoolean("bool")).append(", ").append(rs.getBoolean("a_char")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2308 .append(", ").append(rs.getBoolean("b_char")).append(", ").append(rs.getBoolean("a_varchar")).append("\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2309 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2310 // should give true for all but the last two |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2311 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2312 sb.append("3. ").append(rs.getInt("id")).append(", ").append(rs.getBoolean("tiny_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2313 .append(", ").append(rs.getBoolean("small_int")).append(", ").append(rs.getBoolean("medium_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2314 .append(", ").append(rs.getBoolean("integer")).append(", ").append(rs.getBoolean("big_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2315 .append(", ").append(rs.getBoolean("a_real")).append(", ").append(rs.getBoolean("a_double")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2316 .append(", ").append(rs.getBoolean("a_decimal")).append(", ").append(rs.getBoolean("a_numeric")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2317 .append(", ").append(rs.getBoolean("bool")).append(", ").append(rs.getBoolean("a_char")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2318 .append(", ").append(rs.getBoolean("b_char")).append(", ").append(rs.getBoolean("a_varchar")).append("\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2319 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2320 // should give true for all but the last three |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2321 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2322 sb.append("4. ").append(rs.getInt("id")).append(", ").append(rs.getBoolean("tiny_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2323 .append(", ").append(rs.getBoolean("small_int")).append(", ").append(rs.getBoolean("medium_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2324 .append(", ").append(rs.getBoolean("integer")).append(", ").append(rs.getBoolean("big_int")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2325 .append(", ").append(rs.getBoolean("a_real")).append(", ").append(rs.getBoolean("a_double")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2326 .append(", ").append(rs.getBoolean("a_decimal")).append(", ").append(rs.getBoolean("a_numeric")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2327 .append(", ").append(rs.getBoolean("bool")).append(", ").append(rs.getBoolean("a_char")) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2328 .append(", ").append(rs.getBoolean("b_char")).append(", ").append(rs.getBoolean("a_varchar")).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2329 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2330 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2331 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2332 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2333 // >> true: auto commit was just switched on |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2334 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2335 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2336 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2337 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2338 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2339 closeStmtResSet(stmt, rs); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2340 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2341 compareExpectedOutput("Test_Rbooleans", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2342 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2343 "1. 1, false, false, false, false, false, false, false, false, false, false, false, false, false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2344 "2. 2, true, true, true, true, true, true, true, true, true, true, true, false, true\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2345 "3. 3, true, true, true, true, true, true, true, true, true, true, true, false, false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2346 "4. 4, true, true, true, true, true, true, true, true, true, true, false, false, false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2347 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2348 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2349 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2350 private void Test_Rmetadata() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2351 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2352 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2353 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2354 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2355 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2356 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2357 // >> false: auto commit should be off now |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2358 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2359 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2360 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2361 stmt.executeUpdate("CREATE TABLE Test_Rmetadata ( myint int, mydouble double, mybool boolean, myvarchar varchar(15), myclob clob )"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2362 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2363 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2364 stmt.executeUpdate("INSERT INTO Test_Rmetadata VALUES (NULL, NULL, NULL, NULL, NULL)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2365 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2366 stmt.executeUpdate("INSERT INTO Test_Rmetadata VALUES (2 , 3.0, true, 'A string', 'bla bla bla')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2367 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2368 rs = stmt.executeQuery("SELECT * FROM Test_Rmetadata"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2369 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2370 ResultSetMetaData rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2371 sb.append("0. ").append(rsmd.getColumnCount()).append(" columns:\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2372 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2373 sb.append("Colnr ").append(col).append(".\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2374 sb.append("\tclassname ").append(rsmd.getColumnClassName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2375 sb.append("\tdisplaysize ").append(rsmd.getColumnDisplaySize(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2376 sb.append("\tlabel ").append(rsmd.getColumnLabel(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2377 sb.append("\tname ").append(rsmd.getColumnName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2378 sb.append("\ttype ").append(rsmd.getColumnType(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2379 sb.append("\ttypename ").append(rsmd.getColumnTypeName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2380 sb.append("\tprecision ").append(rsmd.getPrecision(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2381 sb.append("\tscale ").append(rsmd.getScale(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2382 sb.append("\tcatalogname ").append(rsmd.getCatalogName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2383 sb.append("\tschemaname ").append(rsmd.getSchemaName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2384 sb.append("\ttablename ").append(rsmd.getTableName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2385 sb.append("\tautoincrement ").append(rsmd.isAutoIncrement(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2386 sb.append("\tcasesensitive ").append(rsmd.isCaseSensitive(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2387 sb.append("\tcurrency ").append(rsmd.isCurrency(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2388 sb.append("\tdefwritable ").append(rsmd.isDefinitelyWritable(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2389 sb.append("\tnullable ").append(rsmd.isNullable(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2390 sb.append("\treadonly ").append(rsmd.isReadOnly(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2391 sb.append("\tsearchable ").append(rsmd.isSearchable(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2392 sb.append("\tsigned ").append(rsmd.isSigned(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2393 sb.append("\twritable ").append(rsmd.isWritable(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2394 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2395 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2396 for (int i = 6; rs.next(); i++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2397 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2398 Object obj = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2399 String type = rsmd.getColumnClassName(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2400 String isInstance = "(null)"; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2401 if (obj != null && type != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2402 try { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2403 Class<?> c = Class.forName(type); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2404 if (c.isInstance(obj)) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2405 isInstance = (obj.getClass().getName() + " is an instance of " + type); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2406 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2407 isInstance = (obj.getClass().getName() + " is NOT an instance of " + type); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2408 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2409 } catch (ClassNotFoundException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2410 isInstance = "No such class: " + type; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2411 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2412 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2413 sb.append(i).append(".\t").append(isInstance).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2414 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2415 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2416 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2417 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2418 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2419 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2420 // >> true: auto commit was just switched on |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2421 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2422 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2423 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2424 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2425 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2426 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2427 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2428 compareExpectedOutput("Test_Rmetadata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2429 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2430 "0. 5 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2431 "Colnr 1.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2432 " classname java.lang.Integer\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2433 " displaysize 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2434 " label myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2435 " name myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2436 " type 4\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2437 " typename int\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2438 " precision 10\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2439 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2440 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2441 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2442 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2443 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2444 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2445 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2446 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2447 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2448 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2449 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2450 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2451 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2452 "Colnr 2.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2453 " classname java.lang.Double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2454 " displaysize 24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2455 " label mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2456 " name mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2457 " type 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2458 " typename double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2459 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2460 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2461 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2462 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2463 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2464 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2465 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2466 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2467 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2468 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2469 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2470 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2471 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2472 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2473 "Colnr 3.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2474 " classname java.lang.Boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2475 " displaysize 5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2476 " label mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2477 " name mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2478 " type 16\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2479 " typename boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2480 " precision 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2481 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2482 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2483 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2484 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2485 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2486 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2487 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2488 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2489 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2490 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2491 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2492 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2493 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2494 "Colnr 4.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2495 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2496 " displaysize 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2497 " label myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2498 " name myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2499 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2500 " typename varchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2501 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2502 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2503 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2504 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2505 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2506 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2507 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2508 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2509 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2510 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2511 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2512 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2513 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2514 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2515 "Colnr 5.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2516 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2517 " displaysize 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2518 " label myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2519 " name myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2520 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2521 " typename clob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2522 " precision 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2523 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2524 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2525 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2526 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2527 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2528 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2529 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2530 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2531 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2532 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2533 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2534 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2535 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2536 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2537 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2538 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2539 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2540 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2541 "7. java.lang.Integer is an instance of java.lang.Integer\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2542 "7. java.lang.Double is an instance of java.lang.Double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2543 "7. java.lang.Boolean is an instance of java.lang.Boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2544 "7. java.lang.String is an instance of java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2545 "7. java.lang.String is an instance of java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2546 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2547 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2548 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2549 private void Test_Rpositioning() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2550 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2551 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2552 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2553 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2554 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2555 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2556 // get a one rowed resultset |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2557 rs = stmt.executeQuery("SELECT 1"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2558 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2559 // >> true: we should be before the first result now |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2560 sb.append("1. true\t").append(rs.isBeforeFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2561 // >> false: we're not at the first result |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2562 sb.append("2. false\t").append(rs.isFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2563 // >> true: there is one result, so we can call next once |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2564 sb.append("3. true\t").append(rs.next()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2565 // >> false: we're not before the first row anymore |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2566 sb.append("4. false\t").append(rs.isBeforeFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2567 // >> true: we're at the first result |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2568 sb.append("5. true\t").append(rs.isFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2569 // >> false: we're on the last row |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2570 sb.append("6. false\t").append(rs.isAfterLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2571 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2572 sb.append("7. true\t").append(rs.isLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2573 // >> false: there is one result, so this is it |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2574 sb.append("8. false\t").append(rs.next()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2575 // >> true: yes, we're at the end |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2576 sb.append("9. true\t").append(rs.isAfterLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2577 // >> false: no we're one over it |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2578 sb.append("10. false\t").append(rs.isLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2579 // >> false: another try to move on should still fail |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2580 sb.append("11. false\t").append(rs.next()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2581 // >> true: and we should stay positioned after the last |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2582 sb.append("12.true\t").append(rs.isAfterLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2583 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2584 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2585 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2586 // try the same with a scrollable result set |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2587 DatabaseMetaData dbmd = con.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2588 rs = dbmd.getTableTypes(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2589 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2590 // >> true: we should be before the first result now |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2591 sb.append("1. true\t").append(rs.isBeforeFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2592 // >> false: we're not at the first result |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2593 sb.append("2. false\t").append(rs.isFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2594 // >> true: there is one result, so we can call next once |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2595 sb.append("3. true\t").append(rs.next()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2596 // >> false: we're not before the first row anymore |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2597 sb.append("4. false\t").append(rs.isBeforeFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2598 // >> true: we're at the first result |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2599 sb.append("5. true\t").append(rs.isFirst()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2600 // move to last row |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2601 rs.last(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2602 // >> false: we're on the last row |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2603 sb.append("6. false\t").append(rs.isAfterLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2604 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2605 sb.append("7. true\t").append(rs.isLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2606 // >> false: there is one result, so this is it |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2607 sb.append("8. false\t").append(rs.next()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2608 // >> true: yes, we're at the end |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2609 sb.append("9. true\t").append(rs.isAfterLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2610 // >> false: no we're one over it |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2611 sb.append("10. false\t").append(rs.isLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2612 // >> false: another try to move on should still fail |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2613 sb.append("11. false\t").append(rs.next()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2614 // >> true: and we should stay positioned after the last |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2615 sb.append("12. true\t").append(rs.isAfterLast()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2616 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2617 rs.close(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2618 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2619 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2620 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2621 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2622 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2623 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2624 compareExpectedOutput("Test_Rpositioning", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2625 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2626 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2627 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2628 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2629 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2630 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2631 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2632 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2633 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2634 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2635 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2636 "12.true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2637 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2638 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2639 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2640 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2641 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2642 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2643 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2644 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2645 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2646 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2647 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2648 "12. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2649 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2650 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2651 private void Test_Rsqldata() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2652 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2653 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2654 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2655 ResultSet rs = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2656 ResultSetMetaData rsmd = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2657 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2658 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2659 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2660 // >> false: auto commit should be off now |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2661 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2662 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2663 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2664 stmt.executeUpdate("CREATE TABLE Test_Rsqldata ( myinet inet, myurl url )"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2665 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2666 String InsertInto = "INSERT INTO Test_Rsqldata VALUES "; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2667 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2668 stmt.executeUpdate(InsertInto + "(NULL, NULL)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2669 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2670 stmt.executeUpdate(InsertInto + "('172.5.5.5' , 'http://www.monetdb.org/')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2671 stmt.executeUpdate(InsertInto + "('172.5.5.5/32' , 'http://www.monetdb.org/Home')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2672 stmt.executeUpdate(InsertInto + "('172.5.5.5/16' , 'http://www.monetdb.org/Home#someanchor')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2673 stmt.executeUpdate(InsertInto + "('172.5.5.5/26' , 'http://www.monetdb.org/?query=bla')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2674 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2675 rs = stmt.executeQuery("SELECT * FROM Test_Rsqldata"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2676 rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2677 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2678 sb.append("0. ").append(rsmd.getColumnCount()).append(" columns:\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2679 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2680 sb.append(col).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2681 sb.append("\tclassname ").append(rsmd.getColumnClassName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2682 sb.append("\tcatalogname ").append(rsmd.getCatalogName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2683 sb.append("\tschemaname ").append(rsmd.getSchemaName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2684 sb.append("\ttablename ").append(rsmd.getTableName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2685 sb.append("\tcolumnname ").append(rsmd.getColumnName(col)).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2686 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2687 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2688 for (int i = 1; rs.next(); i++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2689 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2690 sb.append(i).append(".\t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2691 Object x = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2692 if (x == null) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
2693 sb.append("<null>\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2694 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2695 sb.append(x.toString()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2696 if (x instanceof INET) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2697 INET inet = (INET)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2698 sb.append("\t").append(inet.getAddress()).append("/").append(inet.getNetmaskBits()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2699 sb.append("\t").append(inet.getInetAddress().toString()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2700 } else if (x instanceof URL) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2701 URL url = (URL)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2702 sb.append("\t").append(url.getURL().toString()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2703 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2704 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2705 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2706 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2707 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2708 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2709 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2710 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2711 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2712 // >> true: auto commit was just switched on |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2713 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2714 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2715 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2716 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2717 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2718 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2719 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2720 compareExpectedOutput("Test_Rsqldata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2721 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2722 "0. 2 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2723 "1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2724 " classname org.monetdb.jdbc.types.INET\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2725 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2726 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2727 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2728 " columnname myinet\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2729 "2\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2730 " classname org.monetdb.jdbc.types.URL\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2731 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2732 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2733 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2734 " columnname myurl\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2735 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2736 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2737 "2. 172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2738 " 172.5.5.5/32\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2739 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2740 "2. http://www.monetdb.org/\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2741 " http://www.monetdb.org/\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2742 "3. 172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2743 " 172.5.5.5/32\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2744 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2745 "3. http://www.monetdb.org/Home\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2746 " http://www.monetdb.org/Home\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2747 "4. 172.5.5.5/16\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2748 " 172.5.5.5/16\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2749 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2750 "4. http://www.monetdb.org/Home#someanchor\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2751 " http://www.monetdb.org/Home#someanchor\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2752 "5. 172.5.5.5/26\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2753 " 172.5.5.5/26\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2754 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2755 "5. http://www.monetdb.org/?query=bla\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2756 " http://www.monetdb.org/?query=bla\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2757 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2758 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2759 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2760 private void Test_Rtimedate() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2761 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2762 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2763 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2764 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2765 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2766 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2767 // >> false: auto commit should be off now |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2768 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2769 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2770 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2771 stmt.executeUpdate("CREATE TABLE table_Test_Rtimedate ( id int PRIMARY KEY, ts timestamp, t time, d date, vc varchar(30) )"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2772 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2773 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, ts) VALUES (1, timestamp '2004-04-24 11:43:53.123')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2774 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, t) VALUES (2, time '11:43:53.123')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2775 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, d) VALUES (3, date '2004-04-24')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2776 // same values but now as strings to test string to timestamp / time / date object conversions |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2777 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (4, '2004-04-24 11:43:53.654321')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2778 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (5, '11:43:53')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2779 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (6, '2004-04-24')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2780 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2781 // test also with small years (< 1000) (see bug 6468) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2782 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, ts) VALUES (11, timestamp '904-04-24 11:43:53.567')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2783 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, ts) VALUES (12, timestamp '74-04-24 11:43:53.567')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2784 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, ts) VALUES (13, timestamp '4-04-24 11:43:53.567')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2785 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, d) VALUES (14, date '904-04-24')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2786 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, d) VALUES (15, date '74-04-24')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2787 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, d) VALUES (16, date '4-04-24')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2788 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (17, '904-04-24 11:43:53.567')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2789 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (18, '74-04-24 11:43:53.567')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2790 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (19, '4-04-24 11:43:53.567')"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2791 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2792 // test also with negative years (see bug 6468) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2793 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, ts) VALUES (21, timestamp '-4-04-24 11:43:53.567')"); // negative year |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2794 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, ts) VALUES (22, timestamp '-2004-04-24 11:43:53.567')"); // negative year |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2795 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, d) VALUES (23, date '-4-04-24')"); // negative year |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2796 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, d) VALUES (24, date '-3004-04-24')"); // negative year |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2797 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (25, '-2004-04-24 11:43:53.654321')"); // negative year |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2798 stmt.executeUpdate("INSERT INTO table_Test_Rtimedate(id, vc) VALUES (26, '-3004-04-24')"); // negative year |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2799 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2800 rs = stmt.executeQuery("SELECT * FROM table_Test_Rtimedate"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2801 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2802 readNextRow(rs, 1, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2803 readNextRow(rs, 2, "t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2804 readNextRow(rs, 3, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2805 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2806 readNextRow(rs, 4, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2807 readNextRow(rs, 5, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2808 readNextRow(rs, 6, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2809 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2810 readNextRow(rs, 11, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2811 readNextRow(rs, 12, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2812 readNextRow(rs, 13, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2813 readNextRow(rs, 14, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2814 readNextRow(rs, 15, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2815 readNextRow(rs, 16, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2816 readNextRow(rs, 17, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2817 readNextRow(rs, 18, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2818 readNextRow(rs, 19, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2819 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2820 readNextRow(rs, 21, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2821 readNextRow(rs, 22, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2822 readNextRow(rs, 23, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2823 readNextRow(rs, 24, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2824 readNextRow(rs, 25, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2825 readNextRow(rs, 26, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2826 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2827 readWarnings(stmt.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2828 readWarnings(con.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2829 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2830 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2831 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2832 // >> true: auto commit should be on by default |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2833 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2834 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2835 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2836 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2837 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2838 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2839 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2840 compareExpectedOutput("Test_Rtimedate", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2841 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2842 "1. ts 2004-04-24 11:43:53.123000 to ts: 2004-04-24 11:43:53.123\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2843 "1. ts 2004-04-24 11:43:53.123000 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2844 "1. ts 2004-04-24 11:43:53.123000 to dt: 2004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2845 "2. t 11:43:53 to ts: 1970-01-01 11:43:53.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2846 "2. t 11:43:53 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2847 "2. t 11:43:53 to dt: 1970-01-01\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2848 "3. d 2004-04-24 to ts: 2004-04-24 00:00:00.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2849 "3. d 2004-04-24 to tm: 00:00:00\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2850 "3. d 2004-04-24 to dt: 2004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2851 "4. vc 2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2852 "4. vc 2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"2004-04-24 11:43:53.654321\" at pos: 5\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2853 "4. vc 2004-04-24 11:43:53.654321 to dt: 2004-04-24\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2854 "5. vc 11:43:53 to ts: rs.getTimestamp(colnm) failed with error: parsing failed, found: ':' in: \"11:43:53\" at pos: 3\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2855 "5. vc 11:43:53 to tm: 11:43:53\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2856 "5. vc 11:43:53 to dt: rs.getDate(colnm) failed with error: parsing failed, found: ':' in: \"11:43:53\" at pos: 3\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2857 "6. vc 2004-04-24 to ts: 2004-04-24 00:00:00.0\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2858 "6. vc 2004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"2004-04-24\" at pos: 5\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2859 "6. vc 2004-04-24 to dt: 2004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2860 "11. ts 904-04-24 11:43:53.567000 to ts: 0904-04-24 11:43:53.567\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2861 "11. ts 904-04-24 11:43:53.567000 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2862 "11. ts 904-04-24 11:43:53.567000 to dt: 0904-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2863 "12. ts 74-04-24 11:43:53.567000 to ts: 0074-04-24 11:43:53.567\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2864 "12. ts 74-04-24 11:43:53.567000 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2865 "12. ts 74-04-24 11:43:53.567000 to dt: 0074-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2866 "13. ts 4-04-24 11:43:53.567000 to ts: 0004-04-24 11:43:53.567\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2867 "13. ts 4-04-24 11:43:53.567000 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2868 "13. ts 4-04-24 11:43:53.567000 to dt: 0004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2869 "14. d 904-04-24 to ts: 0904-04-24 00:00:00.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2870 "14. d 904-04-24 to tm: 00:00:00\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2871 "14. d 904-04-24 to dt: 0904-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2872 "15. d 74-04-24 to ts: 0074-04-24 00:00:00.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2873 "15. d 74-04-24 to tm: 00:00:00\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2874 "15. d 74-04-24 to dt: 0074-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2875 "16. d 4-04-24 to ts: 0004-04-24 00:00:00.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2876 "16. d 4-04-24 to tm: 00:00:00\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2877 "16. d 4-04-24 to dt: 0004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2878 "17. vc 904-04-24 11:43:53.567 to ts: 0904-04-24 11:43:53.567\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2879 "17. vc 904-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"904-04-24 11:43:53.567\" at pos: 4\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2880 "17. vc 904-04-24 11:43:53.567 to dt: 0904-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2881 "18. vc 74-04-24 11:43:53.567 to ts: 0074-04-24 11:43:53.567\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2882 "18. vc 74-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"74-04-24 11:43:53.567\" at pos: 3\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2883 "18. vc 74-04-24 11:43:53.567 to dt: 0074-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2884 "19. vc 4-04-24 11:43:53.567 to ts: 0004-04-24 11:43:53.567\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2885 "19. vc 4-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"4-04-24 11:43:53.567\" at pos: 2\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2886 "19. vc 4-04-24 11:43:53.567 to dt: 0004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2887 "21. ts -4-04-24 11:43:53.567000 to ts: 0004-04-24 11:43:53.567\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2888 "21. ts -4-04-24 11:43:53.567000 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2889 "21. ts -4-04-24 11:43:53.567000 to dt: 0004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2890 "22. ts -2004-04-24 11:43:53.567000 to ts: 2004-04-24 11:43:53.567\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2891 "22. ts -2004-04-24 11:43:53.567000 to tm: 11:43:53\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2892 "22. ts -2004-04-24 11:43:53.567000 to dt: 2004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2893 "23. d -4-04-24 to ts: 0004-04-24 00:00:00.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2894 "23. d -4-04-24 to tm: 00:00:00\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2895 "23. d -4-04-24 to dt: 0004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2896 "24. d -3004-04-24 to ts: 3004-04-24 00:00:00.0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2897 "24. d -3004-04-24 to tm: 00:00:00\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2898 "24. d -3004-04-24 to dt: 3004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2899 "25. vc -2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2900 "25. vc -2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"-2004-04-24 11:43:53.654321\" at pos: 6\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2901 "25. vc -2004-04-24 11:43:53.654321 to dt: 2004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2902 "26. vc -3004-04-24 to ts: 3004-04-24 00:00:00.0\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2903 "26. vc -3004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"-3004-04-24\" at pos: 6\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2904 "26. vc -3004-04-24 to dt: 3004-04-24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2905 "0. true true\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2906 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2907 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2908 private void readNextRow(ResultSet rs, int rowseq, String colnm) throws SQLException { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2909 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2910 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2911 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2912 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2913 // fetch the column value using multiple methods: getString(), getTimestamp(), getTime() and getDate() |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2914 // to test proper conversion and error reporting |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2915 String data = rs.getString("id") + ". " + colnm + " " + rs.getString(colnm) + " to "; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2916 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2917 // getTimestamp() may raise a conversion warning when the value is of type Time or a String which doesn't match format yyyy-mm-dd hh:mm:ss |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2918 try { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2919 sb.append(data).append("ts: ").append(rs.getTimestamp(colnm)).append("\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2920 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2921 sb.append("rs.getTimestamp(colnm) failed with error: ").append(e.getMessage()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2922 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2923 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2924 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2925 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2926 // getTime() may raise a conversion warning when the value is of type Date or a String which doesn't match format hh:mm:ss |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2927 try { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2928 sb.append(data).append("tm: ").append(rs.getTime(colnm)).append("\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2929 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2930 sb.append("rs.getTime(colnm) failed with error: ").append(e.getMessage()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2931 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2932 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2933 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2934 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2935 // getDate() may raise a conversion warning when the value is of type Time or a String which doesn't match format yyyy-mm-dd |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2936 try { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2937 sb.append(data).append("dt: ").append(rs.getDate(colnm)).append("\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2938 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2939 sb.append("rs.getDate(colnm) failed with error: ").append(e.getMessage()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2940 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2941 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2942 rs.clearWarnings(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2943 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2944 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2945 private void Test_Sbatching() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2946 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2947 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2948 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2949 PreparedStatement pstmt = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2950 ResultSet rs = null; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2951 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2952 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2953 // >> false: auto commit should be off now |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2954 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2955 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2956 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2957 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2958 sb.append("1. create..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2959 if (stmt.executeUpdate("CREATE TABLE Test_Sbatching ( id int )") != Statement.SUCCESS_NO_INFO) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2960 sb.append("Wrong return status\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2961 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2962 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2963 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2964 // start batching a large amount of inserts |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2965 for (int i = 1; i <= 3432; i++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2966 stmt.addBatch("INSERT INTO Test_Sbatching VALUES (" + i + ")"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2967 if (i % 1500 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2968 sb.append("2. executing batch (1500 inserts)..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2969 int[] cnts = stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2970 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2971 sb.append("3. checking number of update counts..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2972 if (cnts.length != 1500) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2973 sb.append("Invalid size: ").append(cnts.length); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2974 sb.append(cnts.length).append(" passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2975 sb.append("4. checking update counts (should all be 1)..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2976 for (int j = 0; j < cnts.length; j++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2977 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2978 sb.append("Unexpected value: ").append(cnts[j]); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2979 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2980 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2981 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2982 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2983 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2984 sb.append("5. executing final batch..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2985 stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2986 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2987 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2988 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2989 pstmt = con.prepareStatement("INSERT INTO Test_Sbatching VALUES (?)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2990 // start batching a large amount of prepared inserts using JDBC 4.2 executeLargeBatch() |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2991 for (int i = 1; i <= 3568; i++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2992 pstmt.setInt(1, i); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2993 pstmt.addBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2994 if (i % 3000 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2995 sb.append("2. executing batch (3000 inserts)..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2996 long[] cnts = pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2997 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2998 sb.append("3. checking number of update counts..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2999 if (cnts.length != 3000) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3000 sb.append("Invalid size: ").append(cnts.length); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3001 sb.append(cnts.length).append(" passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3002 sb.append("4. checking update counts (should all be 1)..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3003 for (int j = 0; j < cnts.length; j++) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3004 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3005 sb.append("Unexpected value: ").append(cnts[j]); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3006 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3007 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3008 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3009 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3010 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3011 sb.append("5. executing final Largebatch..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3012 pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3013 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3014 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3015 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3016 sb.append("6. clearing the batch..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3017 stmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3018 pstmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3019 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3020 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3021 sb.append("7. checking table count..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3022 rs = stmt.executeQuery("SELECT COUNT(*) FROM Test_Sbatching"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3023 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3024 sb.append(rs.getInt(1)).append(" passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3025 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3026 sb.append("8. drop table..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3027 if (stmt.executeUpdate("DROP TABLE Test_Sbatching") != Statement.SUCCESS_NO_INFO) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3028 sb.append("Wrong return status\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3029 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3030 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3031 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3032 // rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3033 stmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3034 pstmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3035 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3036 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3037 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3038 // >> true: auto commit should be on by default |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3039 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3040 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3041 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3042 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3043 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3044 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3045 closeStmtResSet(pstmt, null); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3046 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3047 compareExpectedOutput("Test_Sbatching", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3048 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3049 "1. create...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3050 "2. executing batch (1500 inserts)...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3051 "3. checking number of update counts...1500 passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3052 "4. checking update counts (should all be 1)...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3053 "2. executing batch (1500 inserts)...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3054 "3. checking number of update counts...1500 passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3055 "4. checking update counts (should all be 1)...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3056 "5. executing final batch...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3057 "2. executing batch (3000 inserts)...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3058 "3. checking number of update counts...3000 passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3059 "4. checking update counts (should all be 1)...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3060 "5. executing final Largebatch...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3061 "6. clearing the batch...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3062 "7. checking table count...7000 passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3063 "8. drop table...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3064 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3065 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3066 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3067 private void Test_Smoreresults() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3068 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3069 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3070 Statement stmt = null; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3071 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3072 // >> true: auto commit should be on by default |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3073 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3074 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3075 stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3076 sb.append("1. more results?..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3077 if (stmt.getMoreResults() != false || stmt.getUpdateCount() != -1) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3078 sb.append("more results on an unitialised Statement, how can that be?\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3079 sb.append(" nope :)\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3080 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3081 sb.append("2. SELECT 1..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3082 if (stmt.execute("SELECT 1;") == false) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3083 sb.append("SELECT 1 returns update or no results\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3084 sb.append(" ResultSet :)\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3085 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3086 sb.append("3. more results?..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3087 if (stmt.getMoreResults() != false || stmt.getUpdateCount() != -1) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3088 sb.append("more results after SELECT 1 query, how can that be?\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3089 sb.append(" nope :)\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3090 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3091 sb.append("4. even more results?..."); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3092 if (stmt.getMoreResults() != false) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3093 sb.append("still more results after SELECT 1 query, how can that be?\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3094 sb.append(" nope :)\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3095 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3096 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3097 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3098 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3099 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3100 closeStmtResSet(stmt, null); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3101 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3102 compareExpectedOutput("Test_Smoreresults", |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3103 "0. true true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3104 "1. more results?... nope :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3105 "2. SELECT 1... ResultSet :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3106 "3. more results?... nope :)\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3107 "4. even more results?... nope :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3108 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3109 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3110 private void Test_Wrapper() { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3111 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3112 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3113 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3114 final String jdbc_pkg = "java.sql."; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3115 final String monetdb_jdbc_pkg = "org.monetdb.jdbc."; |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3116 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3117 sb.append("Auto commit is: ").append(con.getAutoCommit()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3118 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3119 checkIsWrapperFor("Connection", con, jdbc_pkg, "Connection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3120 checkIsWrapperFor("Connection", con, monetdb_jdbc_pkg, "MonetConnection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3121 checkIsWrapperFor("Connection", con, jdbc_pkg, "Statement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3122 checkIsWrapperFor("Connection", con, monetdb_jdbc_pkg, "MonetStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3123 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3124 DatabaseMetaData dbmd = con.getMetaData(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3125 checkIsWrapperFor("DatabaseMetaData", dbmd, jdbc_pkg, "DatabaseMetaData"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3126 checkIsWrapperFor("DatabaseMetaData", dbmd, monetdb_jdbc_pkg, "MonetDatabaseMetaData"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3127 checkIsWrapperFor("DatabaseMetaData", dbmd, jdbc_pkg, "Statement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3128 checkIsWrapperFor("DatabaseMetaData", dbmd, monetdb_jdbc_pkg, "MonetStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3129 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3130 ResultSet rs = dbmd.getSchemas(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3131 checkIsWrapperFor("ResultSet", rs, jdbc_pkg, "ResultSet"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3132 checkIsWrapperFor("ResultSet", rs, monetdb_jdbc_pkg, "MonetResultSet"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3133 checkIsWrapperFor("ResultSet", rs, jdbc_pkg, "Statement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3134 checkIsWrapperFor("ResultSet", rs, monetdb_jdbc_pkg, "MonetStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3135 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3136 ResultSetMetaData rsmd = rs.getMetaData(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3137 checkIsWrapperFor("ResultSetMetaData", rsmd, jdbc_pkg, "ResultSetMetaData"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3138 checkIsWrapperFor("ResultSetMetaData", rsmd, monetdb_jdbc_pkg, "MonetResultSet"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3139 checkIsWrapperFor("ResultSetMetaData", rsmd, monetdb_jdbc_pkg, "MonetResultSet$rsmdw"); // it is a private class of MonetResultSet |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3140 checkIsWrapperFor("ResultSetMetaData", rsmd, jdbc_pkg, "Statement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3141 checkIsWrapperFor("ResultSetMetaData", rsmd, monetdb_jdbc_pkg, "MonetStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3142 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3143 rs.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3144 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3145 Statement stmt = con.createStatement(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3146 checkIsWrapperFor("Statement", stmt, jdbc_pkg, "Statement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3147 checkIsWrapperFor("Statement", stmt, monetdb_jdbc_pkg, "MonetStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3148 checkIsWrapperFor("Statement", stmt, jdbc_pkg, "Connection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3149 checkIsWrapperFor("Statement", stmt, monetdb_jdbc_pkg, "MonetConnection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3150 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3151 stmt.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3152 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3153 PreparedStatement pstmt = con.prepareStatement("SELECT name FROM sys.tables WHERE system AND name like ?"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3154 checkIsWrapperFor("PreparedStatement", pstmt, jdbc_pkg, "PreparedStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3155 checkIsWrapperFor("PreparedStatement", pstmt, monetdb_jdbc_pkg, "MonetPreparedStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3156 checkIsWrapperFor("PreparedStatement", pstmt, jdbc_pkg, "Statement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3157 checkIsWrapperFor("PreparedStatement", pstmt, monetdb_jdbc_pkg, "MonetStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3158 checkIsWrapperFor("PreparedStatement", pstmt, jdbc_pkg, "Connection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3159 checkIsWrapperFor("PreparedStatement", pstmt, monetdb_jdbc_pkg, "MonetConnection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3160 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3161 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3162 checkIsWrapperFor("ParameterMetaData", pmd, jdbc_pkg, "ParameterMetaData"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3163 checkIsWrapperFor("ParameterMetaData", pmd, monetdb_jdbc_pkg, "MonetPreparedStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3164 checkIsWrapperFor("ParameterMetaData", pmd, monetdb_jdbc_pkg, "MonetPreparedStatement$pmdw"); // it is a private class of MonetPreparedStatement |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3165 checkIsWrapperFor("ParameterMetaData", pmd, jdbc_pkg, "Connection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3166 checkIsWrapperFor("ParameterMetaData", pmd, monetdb_jdbc_pkg, "MonetConnection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3167 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3168 ResultSetMetaData psrsmd = pstmt.getMetaData(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3169 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, jdbc_pkg, "ResultSetMetaData"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3170 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, monetdb_jdbc_pkg, "MonetPreparedStatement"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3171 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, monetdb_jdbc_pkg, "MonetPreparedStatement$rsmdw"); // it is a private class of MonetPreparedStatement |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3172 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, jdbc_pkg, "Connection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3173 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, monetdb_jdbc_pkg, "MonetConnection"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3174 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3175 pstmt.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3176 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3177 } catch (SQLException e) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3178 while ((e = e.getNextException()) != null) |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3179 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3180 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3181 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3182 compareExpectedOutput("Test_Wrapper", "Auto commit is: true\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3183 "Connection. isWrapperFor(Connection) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3184 "Connection. isWrapperFor(MonetConnection) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3185 "Connection. isWrapperFor(Statement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3186 "Connection. isWrapperFor(MonetStatement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3187 "DatabaseMetaData. isWrapperFor(DatabaseMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3188 "DatabaseMetaData. isWrapperFor(MonetDatabaseMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3189 "DatabaseMetaData. isWrapperFor(Statement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3190 "DatabaseMetaData. isWrapperFor(MonetStatement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3191 "ResultSet. isWrapperFor(ResultSet) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3192 "ResultSet. isWrapperFor(MonetResultSet) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3193 "ResultSet. isWrapperFor(Statement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3194 "ResultSet. isWrapperFor(MonetStatement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3195 "ResultSetMetaData. isWrapperFor(ResultSetMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3196 "ResultSetMetaData. isWrapperFor(MonetResultSet) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3197 "ResultSetMetaData. isWrapperFor(MonetResultSet$rsmdw) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3198 "ResultSetMetaData. isWrapperFor(Statement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3199 "ResultSetMetaData. isWrapperFor(MonetStatement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3200 "Statement. isWrapperFor(Statement) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3201 "Statement. isWrapperFor(MonetStatement) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3202 "Statement. isWrapperFor(Connection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3203 "Statement. isWrapperFor(MonetConnection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3204 "PreparedStatement. isWrapperFor(PreparedStatement) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3205 "PreparedStatement. isWrapperFor(MonetPreparedStatement) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3206 "PreparedStatement. isWrapperFor(Statement) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3207 "PreparedStatement. isWrapperFor(MonetStatement) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3208 "PreparedStatement. isWrapperFor(Connection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3209 "PreparedStatement. isWrapperFor(MonetConnection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3210 "ParameterMetaData. isWrapperFor(ParameterMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3211 "ParameterMetaData. isWrapperFor(MonetPreparedStatement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3212 "ParameterMetaData. isWrapperFor(MonetPreparedStatement$pmdw) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3213 "ParameterMetaData. isWrapperFor(Connection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3214 "ParameterMetaData. isWrapperFor(MonetConnection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3215 "PrepStmt ResultSetMetaData. isWrapperFor(ResultSetMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3216 "PrepStmt ResultSetMetaData. isWrapperFor(MonetPreparedStatement) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3217 "PrepStmt ResultSetMetaData. isWrapperFor(MonetPreparedStatement$rsmdw) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3218 "PrepStmt ResultSetMetaData. isWrapperFor(Connection) returns: false\n" + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3219 "PrepStmt ResultSetMetaData. isWrapperFor(MonetConnection) returns: false\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3220 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3221 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3222 private void checkIsWrapperFor(String objnm, Wrapper obj, String pkgnm, String classnm) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3223 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3224 Class<?> clazz = Class.forName(pkgnm + classnm); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3225 boolean isWrapper = obj.isWrapperFor(clazz); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3226 sb.append(objnm).append(". isWrapperFor(").append(classnm).append(") returns: ").append(isWrapper); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3227 if (isWrapper) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3228 Object wobj = obj.unwrap(clazz); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3229 sb.append("\tCalled unwrap(). Returned object is ").append((wobj != null ? "not null, so oke" : "null !!")); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3230 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3231 sb.append("\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3232 } catch (ClassNotFoundException cnfe) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3233 sb.append(cnfe.toString()); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3234 } catch (SQLException se) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3235 sb.append(se.getMessage()); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3236 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3237 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3238 |
453
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3239 private void bogus_auto_generated_keys() { |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3240 sb.setLength(0); // clear the output log buffer |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3241 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3242 Statement stmt = null; |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3243 ResultSet rs = null; |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3244 int upd = 0; |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3245 try { |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3246 stmt = con.createStatement(); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3247 sb.append("1. create table..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3248 // create a simple table with an auto-generated key (id) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3249 upd = stmt.executeUpdate("CREATE TABLE bogus_gen_keys (\n \"id\" serial,\n \"x\" varchar(12)\n);"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3250 if (upd != Statement.SUCCESS_NO_INFO) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3251 sb.append("Wrong return status: ").append(upd).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3252 else |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3253 sb.append("passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3254 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3255 // perform an update, useless, but illustrates the bug, this time no |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3256 // generated key is reported, which is correct |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3257 sb.append("2. update empty table..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3258 upd = stmt.executeUpdate("UPDATE bogus_gen_keys SET \"x\" = 'bla' WHERE \"id\" = 12;"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3259 if (upd != 0) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3260 sb.append("Wrong return status: ").append(upd).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3261 else |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3262 sb.append("passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3263 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3264 // insert some value, should get a generated key |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3265 sb.append("3. insert 1 row ..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3266 upd = stmt.executeUpdate("INSERT INTO bogus_gen_keys (\"x\") VALUES ('boe');"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3267 if (upd != 1) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3268 sb.append("Wrong return status: ").append(upd).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3269 else |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3270 sb.append("passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3271 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3272 sb.append("4. show values of inserted row ..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3273 rs = stmt.executeQuery("SELECT \"id\", \"x\" from bogus_gen_keys;"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3274 if (rs != null && rs.next()) { |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3275 sb.append(" id: ").append(rs.getString(1)).append(" x: ").append(rs.getString(2)); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3276 } |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3277 sb.append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3278 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3279 // update again, we expect NO generated key, but we DO get one |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3280 sb.append("5. update row 1..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3281 upd = stmt.executeUpdate("UPDATE bogus_gen_keys SET \"x\" = 'bla' WHERE \"id\" = 1;"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3282 if (upd != 1) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3283 sb.append("Wrong return status: ").append(upd).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3284 else |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3285 sb.append("passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3286 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3287 sb.append("6. update row 12..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3288 upd = stmt.executeUpdate("UPDATE bogus_gen_keys SET \"x\" = 'bla' WHERE \"id\" = 12;"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3289 if (upd != 0) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3290 sb.append("Wrong return status: ").append(upd).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3291 else |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3292 sb.append("passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3293 } catch (SQLException e) { |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3294 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3295 } |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3296 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3297 // cleanup |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3298 try { |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3299 sb.append("7. drop table..."); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3300 upd = stmt.executeUpdate("DROP TABLE bogus_gen_keys"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3301 if (upd != Statement.SUCCESS_NO_INFO) |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3302 sb.append("Wrong return status: ").append(upd).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3303 else |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3304 sb.append("passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3305 } catch (SQLException e) { |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3306 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3307 } |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3308 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3309 closeStmtResSet(stmt, rs); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3310 |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3311 compareExpectedOutput("bogus_auto_generated_keys", |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3312 "1. create table...passed\n" + |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3313 "2. update empty table...passed\n" + |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3314 "3. insert 1 row ...passed\n" + |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3315 "4. show values of inserted row ... id: 1 x: boe\n" + |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3316 "5. update row 1...passed\n" + |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3317 "6. update row 12...passed\n" + |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3318 "7. drop table...passed\n"); |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3319 } |
33756aa67a40
Converted and added test bogus-auto-generated-keys (which is currently run via JdbcClient)
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
452
diff
changeset
|
3320 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3321 private void BugConcurrent_clients_SF_1504657(String arg0) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3322 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3323 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3324 Connection con1 = null, con2 = null, con3 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3325 Statement stmt1 = null, stmt2 = null, stmt3 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3326 ResultSet rs1 = null, rs2= null, rs3 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3327 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3328 con1 = DriverManager.getConnection(arg0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3329 con2 = DriverManager.getConnection(arg0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3330 con3 = DriverManager.getConnection(arg0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3331 stmt1 = con1.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3332 stmt2 = con2.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3333 stmt3 = con3.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3334 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3335 // >> true: auto commit should be on by default |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3336 sb.append("0. true\t").append(con1.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3337 sb.append("0. true\t").append(con2.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3338 sb.append("0. true\t").append(con3.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3339 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3340 // test the creation of a table with concurrent clients |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3341 sb.append("1.1. create table t1504657 using client 1...\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3342 stmt1.executeUpdate("CREATE TABLE t1504657 ( id int, name varchar(1024) )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3343 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3344 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3345 sb.append("1.2. check table existence in client 2...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3346 rs2 = stmt2.executeQuery("SELECT name FROM tables where name LIKE 't1504657'"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3347 while (rs2.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3348 sb.append(rs2.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3349 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3350 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3351 sb.append("1.3. check table existence in client 3...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3352 rs3 = stmt3.executeQuery("SELECT name FROM tables where name LIKE 't1504657'"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3353 while (rs3.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3354 sb.append(rs3.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3355 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3356 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3357 // test the insertion of values with concurrent clients |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3358 sb.append("2 insert into t1504657 using client 1...\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3359 stmt1.executeUpdate("INSERT INTO t1504657 values( 1, 'monetdb' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3360 sb.append("passed :)\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3361 stmt1.executeUpdate("INSERT INTO t1504657 values( 2, 'monet' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3362 sb.append("passed :)\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3363 stmt1.executeUpdate("INSERT INTO t1504657 values( 3, 'mon' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3364 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3365 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3366 sb.append("2.1. check table status with client 1...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3367 rs1 = stmt1.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3368 while (rs1.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3369 sb.append(rs1.getInt("id")).append(", ").append(rs1.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3370 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3371 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3372 sb.append("2.2. check table status with client 2...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3373 rs2 = stmt2.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3374 while (rs2.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3375 sb.append(rs2.getInt("id")).append(", ").append(rs2.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3376 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3377 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3378 sb.append("2.3. check table status with client 3...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3379 rs3 = stmt3.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3380 while (rs3.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3381 sb.append(rs3.getInt("id")).append(", ").append(rs3.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3382 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3383 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3384 // test the insertion of values with concurrent clients |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3385 sb.append("3 insert into t1504657 using client 2...\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3386 stmt2.executeUpdate("INSERT INTO t1504657 values( 4, 'monetdb' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3387 sb.append("passed :)\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3388 stmt2.executeUpdate("INSERT INTO t1504657 values( 5, 'monet' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3389 sb.append("passed :)\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3390 stmt2.executeUpdate("INSERT INTO t1504657 values( 6, 'mon' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3391 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3392 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3393 sb.append("3.1. check table status with client 1...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3394 rs1 = stmt1.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3395 while (rs1.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3396 sb.append(rs1.getInt("id")).append(", ").append(rs1.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3397 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3398 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3399 sb.append("3.2. check table status with client 2...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3400 rs2 = stmt2.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3401 while (rs2.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3402 sb.append(rs2.getInt("id")).append(", ").append(rs2.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3403 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3404 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3405 sb.append("3.3. check table status with client 3...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3406 rs3 = stmt3.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3407 while (rs3.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3408 sb.append(rs3.getInt("id")).append(", ").append(rs3.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3409 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3410 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3411 // test the insertion of values with concurrent clients |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3412 sb.append("4 insert into t1504657 using client 3...\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3413 stmt3.executeUpdate("INSERT INTO t1504657 values( 7, 'monetdb' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3414 sb.append("passed :)\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3415 stmt3.executeUpdate("INSERT INTO t1504657 values( 8, 'monet' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3416 sb.append("passed :)\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3417 stmt3.executeUpdate("INSERT INTO t1504657 values( 9, 'mon' )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3418 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3419 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3420 sb.append("4.1. check table status with client 1...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3421 rs1 = stmt1.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3422 while (rs1.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3423 sb.append(rs1.getInt("id")).append(", ").append(rs1.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3424 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3425 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3426 sb.append("4.2. check table status with client 2...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3427 rs2 = stmt2.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3428 while (rs2.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3429 sb.append(rs2.getInt("id")).append(", ").append(rs2.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3430 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3431 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3432 sb.append("4.3. check table status with client 3...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3433 rs3 = stmt3.executeQuery("SELECT * FROM t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3434 while (rs3.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3435 sb.append(rs3.getInt("id")).append(", ").append(rs3.getString("name")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3436 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3437 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3438 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3439 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3440 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3441 // cleanup |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3442 try { |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3443 sb.append("Cleanup TABLE t1504657\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3444 stmt3.executeUpdate("DROP TABLE t1504657"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3445 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3446 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3447 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3448 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3449 closeStmtResSet(stmt3, rs3); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3450 closeStmtResSet(stmt1, rs1); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3451 closeStmtResSet(stmt2, rs2); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3452 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3453 closeConx(con2); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3454 closeConx(con1); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3455 closeConx(con3); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3456 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3457 compareExpectedOutput("BugConcurrent_clients_SF_1504657", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3458 "0. true true\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3459 "0. true true\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3460 "0. true true\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3461 "1.1. create table t1504657 using client 1...\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3462 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3463 "1.2. check table existence in client 2...\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3464 "t1504657\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3465 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3466 "1.3. check table existence in client 3...\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3467 "t1504657\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3468 "passed :)\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3469 "2 insert into t1504657 using client 1...\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3470 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3471 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3472 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3473 "2.1. check table status with client 1...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3474 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3475 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3476 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3477 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3478 "2.2. check table status with client 2...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3479 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3480 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3481 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3482 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3483 "2.3. check table status with client 3...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3484 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3485 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3486 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3487 "passed :)\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3488 "3 insert into t1504657 using client 2...\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3489 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3490 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3491 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3492 "3.1. check table status with client 1...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3493 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3494 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3495 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3496 "4, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3497 "5, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3498 "6, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3499 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3500 "3.2. check table status with client 2...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3501 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3502 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3503 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3504 "4, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3505 "5, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3506 "6, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3507 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3508 "3.3. check table status with client 3...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3509 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3510 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3511 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3512 "4, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3513 "5, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3514 "6, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3515 "passed :)\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3516 "4 insert into t1504657 using client 3...\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3517 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3518 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3519 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3520 "4.1. check table status with client 1...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3521 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3522 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3523 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3524 "4, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3525 "5, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3526 "6, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3527 "7, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3528 "8, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3529 "9, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3530 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3531 "4.2. check table status with client 2...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3532 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3533 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3534 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3535 "4, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3536 "5, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3537 "6, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3538 "7, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3539 "8, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3540 "9, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3541 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3542 "4.3. check table status with client 3...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3543 "1, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3544 "2, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3545 "3, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3546 "4, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3547 "5, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3548 "6, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3549 "7, monetdb\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3550 "8, monet\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3551 "9, mon\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3552 "passed :)\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3553 "Cleanup TABLE t1504657\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3554 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3555 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3556 private void BugConcurrent_sequences(String arg0) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3557 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3558 |
458
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3559 boolean isPostOct2020 = false; |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3560 Connection con1 = null, con2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3561 Statement stmt1 = null, stmt2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3562 ResultSet rs1 = null, rs2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3563 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3564 con1 = DriverManager.getConnection(arg0); |
458
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3565 DatabaseMetaData dbmd = con1.getMetaData(); |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3566 isPostOct2020 = (dbmd.getDatabaseMajorVersion() >=11) && (dbmd.getDatabaseMinorVersion() > 39); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3567 con2 = DriverManager.getConnection(arg0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3568 stmt1 = con1.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3569 stmt2 = con2.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3570 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3571 // >> true: auto commit should be on by default |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3572 sb.append("0. true\t").append(con1.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3573 sb.append("0. true\t").append(con2.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3574 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3575 // create a table |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3576 sb.append("1. create table tconc_seq using client 1... "); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3577 stmt1.executeUpdate("CREATE TABLE tconc_seq ( id serial, who varchar(12) )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3578 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3579 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3580 // test the insertion of values with concurrent clients |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3581 sb.append("2. insert into tconc_seq using client 1 and 2... "); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3582 stmt1.executeUpdate("INSERT INTO tconc_seq(who) VALUES('client1')"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3583 sb.append("client 1 passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3584 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3585 con2.setAutoCommit(false); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3586 stmt2.executeUpdate("INSERT INTO tconc_seq(who) VALUES('client2')"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3587 sb.append("transaction on client 2 :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3588 |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3589 stmt1.executeUpdate("INSERT INTO tconc_seq(who) VALUES('client1')"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3590 sb.append("client 1 passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3591 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3592 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3593 con2.commit(); |
458
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3594 sb.append("transaction client 2 passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3595 } catch (SQLException e) { |
458
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3596 sb.append("transaction client 2 failed!\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3597 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3598 con2.setAutoCommit(true); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3599 stmt2.executeUpdate("INSERT INTO tconc_seq(who) VALUES('client2')"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3600 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3601 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3602 sb.append("2.1. check table status with client 1...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3603 rs1 = stmt1.executeQuery("SELECT * FROM tconc_seq"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3604 while (rs1.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3605 sb.append(rs1.getInt("id")).append(", ").append(rs1.getString("who")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3606 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3607 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3608 sb.append("2.2. check table status with client 2...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3609 rs2 = stmt2.executeQuery("SELECT * FROM tconc_seq"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3610 while (rs2.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3611 sb.append(rs2.getInt("id")).append(", ").append(rs2.getString("who")).append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3612 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3613 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3614 // drop the table (not dropping the sequence) from client 1 |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3615 sb.append("3.1. drop table tconc_seq using client 1... "); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3616 stmt1.executeUpdate("DROP TABLE tconc_seq"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3617 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3618 |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3619 sb.append("3.1. recreate tconc_seq using client 1... "); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3620 stmt1.executeUpdate("CREATE TABLE tconc_seq ( id serial, who varchar(12) )"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3621 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3622 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3623 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3624 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3625 |
458
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3626 compareExpectedOutput("BugConcurrent_sequences", |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3627 isPostOct2020 ? |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3628 "0. true true\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3629 "0. true true\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3630 "1. create table tconc_seq using client 1... passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3631 "2. insert into tconc_seq using client 1 and 2... client 1 passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3632 "transaction on client 2 :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3633 "client 1 passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3634 "transaction client 2 passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3635 "passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3636 "2.1. check table status with client 1...\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3637 "1, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3638 "2, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3639 "3, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3640 "4, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3641 "passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3642 "2.2. check table status with client 2...\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3643 "1, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3644 "2, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3645 "3, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3646 "4, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3647 "passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3648 "3.1. drop table tconc_seq using client 1... passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3649 "3.1. recreate tconc_seq using client 1... passed :)\n" |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3650 : // behavior of older MonetDB versions (up to Oct2020 release) was different |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3651 "0. true true\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3652 "0. true true\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3653 "1. create table tconc_seq using client 1... passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3654 "2. insert into tconc_seq using client 1 and 2... client 1 passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3655 "transaction on client 2 :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3656 "client 1 passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3657 "transaction client 2 failed!\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3658 "passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3659 "2.1. check table status with client 1...\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3660 "1, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3661 "3, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3662 "4, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3663 "passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3664 "2.2. check table status with client 2...\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3665 "1, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3666 "3, client1\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3667 "4, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3668 "passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3669 "3.1. drop table tconc_seq using client 1... passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3670 "3.1. recreate tconc_seq using client 1... passed :)\n"); |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3671 sb.setLength(0); // clear the output log buffer |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3672 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3673 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3674 // re-establish connection |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3675 sb.append("x. Reconnecting client 1 and 2... "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3676 con1.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3677 con2.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3678 con1 = DriverManager.getConnection(arg0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3679 con2 = DriverManager.getConnection(arg0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3680 stmt1 = con1.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3681 stmt2 = con2.createStatement(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3682 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3683 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3684 // insert and print, should get 1,2 |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3685 sb.append("4. insert into tconc_seq using client 1 and 2...\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3686 stmt1.executeUpdate("INSERT INTO tconc_seq(who) VALUES('client1')"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3687 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3688 con2.setAutoCommit(false); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3689 stmt2.executeUpdate("INSERT INTO tconc_seq(who) VALUES('client2')"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3690 con2.commit(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3691 con2.setAutoCommit(true); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3692 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3693 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3694 sb.append("4.1. check table status with client 1...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3695 rs1 = stmt1.executeQuery("SELECT * FROM tconc_seq ORDER BY who"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3696 for (int cntr = 1; rs1.next(); cntr++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3697 int id = rs1.getInt("id"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3698 sb.append(id).append(", ").append(rs1.getString("who")).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3699 if (id != cntr) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3700 sb.append("!! expected ").append(cntr).append(", got ").append(id); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3701 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3702 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3703 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3704 sb.append("4.2. check table status with client 2...\n"); |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3705 rs2 = stmt2.executeQuery("SELECT * FROM tconc_seq ORDER BY who"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3706 for (int cntr = 1; rs2.next(); cntr++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3707 int id = rs2.getInt("id"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3708 sb.append(id).append(", ").append(rs2.getString("who")).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3709 if (id != cntr) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3710 sb.append("!! expected ").append(cntr).append(", got ").append(id); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3711 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3712 sb.append("passed :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3713 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3714 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3715 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3716 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3717 // cleanup |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3718 try { |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3719 sb.append("Cleanup TABLE tconc_seq\n"); |
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3720 stmt2.executeUpdate("DROP TABLE tconc_seq"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3721 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3722 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3723 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3724 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3725 closeStmtResSet(stmt1, rs1); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3726 closeStmtResSet(stmt2, rs2); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3727 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3728 closeConx(con2); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3729 closeConx(con1); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3730 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3731 compareExpectedOutput("BugConcurrent_sequences", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3732 "x. Reconnecting client 1 and 2... passed :)\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3733 "4. insert into tconc_seq using client 1 and 2...\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3734 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3735 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3736 "4.1. check table status with client 1...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3737 "1, client1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3738 "2, client2\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3739 "passed :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3740 "4.2. check table status with client 2...\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3741 "1, client1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3742 "2, client2\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3743 "passed :)\n" + |
452
64789c018991
Avoid using table names called t1 in tests, make them more unique.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
450
diff
changeset
|
3744 "Cleanup TABLE tconc_seq\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3745 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3746 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3747 private void Bug_Connect_as_voc_getMetaData_Failure_Bug_6388(String arg0) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3748 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3749 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3750 Statement stmt1 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3751 // create user, schema and alter schema default schema |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3752 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3753 sb.append("1. CREATE USER voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3754 stmt1 = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3755 stmt1.executeUpdate("CREATE USER \"voc\" WITH PASSWORD 'voc' NAME 'VOC Explorer' SCHEMA \"sys\""); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3756 sb.append("2. CREATE SCHEMA voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3757 stmt1.executeUpdate("CREATE SCHEMA \"voc\" AUTHORIZATION \"voc\""); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3758 sb.append("3. ALTER USER voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3759 stmt1.executeUpdate("ALTER USER \"voc\" SET SCHEMA \"voc\""); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3760 sb.append("creation succeeded :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3761 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3762 sb.append("FAILED creating user and schema voc. ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3763 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3764 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3765 Connection con2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3766 ResultSet rs2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3767 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3768 sb.append("4.1. connect as user: voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3769 con2 = DriverManager.getConnection(arg0.replace("=monetdb", "=voc")); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3770 sb.append("connected :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3771 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3772 DatabaseMetaData dbmd = con2.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3773 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3774 sb.append("4.2. getUserName()\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3775 sb.append("UserName = ").append(dbmd.getUserName()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3776 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3777 sb.append("4.3. getMaxConnections()\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3778 sb.append("MaxConnections = ").append(dbmd.getMaxConnections()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3779 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3780 sb.append("4.4. getDatabaseProductVersion()\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3781 String dbmsVersion = dbmd.getDatabaseProductVersion(); // should be 11.35.1 or higher |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3782 boolean postNov2019 = ("11.35.1".compareTo(dbmsVersion) <= 0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3783 sb.append("DatabaseProductVersion = ").append((postNov2019 ? "11.35.+" : dbmsVersion)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3784 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3785 sb.append("4.5. getDatabaseMajorVersion()\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3786 sb.append("DatabaseMajorVersion = ").append(dbmd.getDatabaseMajorVersion()).append("\n"); // should be 11 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3787 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3788 sb.append("4.6. getDatabaseMinorVersion()\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3789 int dbmsMinorVersion = dbmd.getDatabaseMinorVersion(); // should be 35 or higher |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3790 sb.append("DatabaseMinorVersion = ").append((dbmsMinorVersion >= 35 ? "35+" : dbmsMinorVersion)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3791 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3792 sb.append("4.7. getTables(null, 'tmp', null, null)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3793 rs2 = dbmd.getTables(null, "tmp", null, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3794 if (rs2 != null) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3795 sb.append("List Tables in schema tmp:\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3796 while (rs2.next()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3797 sb.append(rs2.getString(3)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3798 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3799 rs2.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3800 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3801 sb.append("completed listing Tables in schema tmp\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3802 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3803 sb.append("4.8. getTableTypes()\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3804 rs2 = dbmd.getTableTypes(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3805 if (rs2 != null) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3806 sb.append("List TableTypes:\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3807 while (rs2.next()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3808 // post Oct2020 releases the STREAM TABLE type is removed, so filter it out for a stable output |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3809 if (!"STREAM TABLE".equals(rs2.getString(1))) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3810 sb.append(rs2.getString(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3811 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3812 rs2.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3813 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3814 sb.append("completed listing TableTypes\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3815 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3816 sb.append("voc meta data Test completed successfully\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3817 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3818 sb.append("FAILED fetching MonetDatabaseMetaData. ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3819 } finally { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3820 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3821 con2.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3822 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3823 sb.append("FAILED to close voc connection. ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3824 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3825 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3826 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3827 // cleanup: drop user, schema and alter schema default schema in reverse order |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3828 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3829 sb.append("Cleanup created objects\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3830 sb.append("5. ALTER USER voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3831 stmt1.executeUpdate("ALTER USER \"voc\" SET SCHEMA \"sys\""); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3832 sb.append("6. DROP SCHEMA voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3833 stmt1.executeUpdate("DROP SCHEMA \"voc\""); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3834 sb.append("7. DROP USER voc\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3835 stmt1.executeUpdate("DROP USER \"voc\""); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3836 sb.append("cleanup succeeded :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3837 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3838 sb.append("FAILED dropping user and schema voc. ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3839 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3840 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3841 closeConx(con2); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3842 closeStmtResSet(stmt1, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3843 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3844 compareExpectedOutput("Bug_Connect_as_voc_getMetaData_Failure_Bug_6388", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3845 "1. CREATE USER voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3846 "2. CREATE SCHEMA voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3847 "3. ALTER USER voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3848 "creation succeeded :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3849 "4.1. connect as user: voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3850 "connected :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3851 "4.2. getUserName()\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3852 "UserName = voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3853 "4.3. getMaxConnections()\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3854 "MaxConnections = 64\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3855 "4.4. getDatabaseProductVersion()\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3856 "DatabaseProductVersion = 11.35.+\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3857 "4.5. getDatabaseMajorVersion()\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3858 "DatabaseMajorVersion = 11\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3859 "4.6. getDatabaseMinorVersion()\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3860 "DatabaseMinorVersion = 35+\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3861 "4.7. getTables(null, 'tmp', null, null)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3862 "List Tables in schema tmp:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3863 "_columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3864 "_tables\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3865 "idxs\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3866 "keys\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3867 "objects\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3868 "triggers\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3869 "completed listing Tables in schema tmp\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3870 "4.8. getTableTypes()\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3871 "List TableTypes:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3872 "GLOBAL TEMPORARY TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3873 "LOCAL TEMPORARY TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3874 "MERGE TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3875 "REMOTE TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3876 "REPLICA TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3877 "SYSTEM TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3878 "SYSTEM VIEW\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3879 "TABLE\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3880 "VIEW\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3881 "completed listing TableTypes\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3882 "voc meta data Test completed successfully\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3883 "Cleanup created objects\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3884 "5. ALTER USER voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3885 "6. DROP SCHEMA voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3886 "7. DROP USER voc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3887 "cleanup succeeded :)\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3888 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3889 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3890 private void BugDatabaseMetaData_Bug_3356() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3891 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3892 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3893 ResultSet rs = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3894 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3895 DatabaseMetaData dbmd = con.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3896 rs = dbmd.getColumns("", "sys", "_tables", "id"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3897 rs.next(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3898 String tableName1 = rs.getString("TABLE_NAME"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3899 String tableName2 = rs.getString(3); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3900 String isNullable1 = rs.getString("IS_NULLABLE"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3901 String isNullable2 = rs.getString(18); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3902 sb.append(tableName1).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3903 sb.append(tableName2).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3904 sb.append(isNullable1).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3905 sb.append(isNullable2).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3906 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3907 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3908 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3909 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3910 closeStmtResSet(null, rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3911 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3912 compareExpectedOutput("BugDatabaseMetaData_Bug_3356", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3913 "_tables\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3914 "_tables\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3915 "YES\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3916 "YES\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3917 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3918 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3919 private void BugDecimalRound_Bug_3561() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3920 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3921 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3922 Statement stmt1 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3923 PreparedStatement pst = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3924 Statement stmt2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3925 ResultSet rs = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3926 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3927 stmt1 = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3928 stmt1.executeUpdate("CREATE TABLE bug3561 (d decimal(14,4))"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3929 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3930 pst = con.prepareStatement("INSERT INTO bug3561 VALUES (?)"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3931 pst.setBigDecimal(1, new BigDecimal("112.125")); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3932 pst.executeUpdate(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3933 pst.setBigDecimal(1, new BigDecimal("212.12345")); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3934 pst.executeUpdate(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3935 pst.setBigDecimal(1, new BigDecimal("0.012345")); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3936 pst.executeUpdate(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3937 pst.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3938 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3939 stmt2 = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3940 rs = stmt2.executeQuery("SELECT d FROM bug3561"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3941 while (rs.next()) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3942 sb.append(rs.getString(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3943 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3944 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3945 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3946 closeStmtResSet(stmt2, rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3947 closeStmtResSet(pst, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3948 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3949 // cleanup |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3950 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3951 stmt1.executeUpdate("DROP TABLE bug3561"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3952 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3953 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3954 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3955 closeStmtResSet(stmt1, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3956 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3957 compareExpectedOutput("BugDecimalRound_Bug_3561", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3958 "112.1250\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3959 "212.1235\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3960 "0.0123\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3961 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3962 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3963 private void BugExecuteUpdate_Bug_3350() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3964 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3965 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3966 Statement stmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3967 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3968 con.setAutoCommit(false); // disable auto commit, so we can roll back the transaction |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3969 stmt = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3970 stmt.execute("CREATE TABLE t3350 (keyword VARCHAR(30) PRIMARY KEY)"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3971 con.commit(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3972 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3973 executeDML(stmt, "INSERT INTO t3350 VALUES ('Bug_3350')"); // should insert 1 row |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3974 executeDML(stmt, "INSERT INTO t3350 VALUES ('Bug_3350')"); // this will result in an SQLException due to PK uniqueness violation |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3975 con.rollback(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3976 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3977 executeDML(stmt, "INSERT INTO t3350 VALUES ('Bug_3350')"); // should insert 1 row |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3978 executeDML(stmt, "INSERT INTO t3350 VALUES ('1'), ('x'), ('3'), ('y')"); // should insert 4 rows |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3979 executeDML(stmt, "DELETE FROM t3350 WHERE \"keyword\" = 'Bug_3350'"); // should delete 1 row |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3980 executeDML(stmt, "DELETE FROM t3350 WHERE \"keyword\" = 'Bug_3350'"); // should delete 0 rows |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3981 executeDML(stmt, "UPDATE t3350 set \"keyword\" = keyword||'_ext'"); // should update 4 rows |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3982 executeDML(stmt, "DELETE FROM t3350"); // should delete 4 rows |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3983 con.commit(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3984 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3985 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3986 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3987 closeStmtResSet(stmt, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3988 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3989 // cleanup |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3990 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3991 stmt.execute("DROP TABLE IF EXISTS t3350"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3992 con.commit(); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3993 con.setAutoCommit(true); // enable auto commit |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3994 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3995 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3996 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3997 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3998 compareExpectedOutput("BugExecuteUpdate_Bug_3350", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3999 "executeUpdate(INSERT ...) returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4000 "getUpdateCount() returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4001 "INSERT INTO: PRIMARY KEY constraint 't3350.t3350_keyword_pkey' violated\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4002 "getUpdateCount() returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4003 "executeUpdate(INSERT ...) returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4004 "getUpdateCount() returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4005 "executeUpdate(INSERT ...) returned: 4\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4006 "getUpdateCount() returned: 4\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4007 "executeUpdate(DELETE ...) returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4008 "getUpdateCount() returned: 1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4009 "executeUpdate(DELETE ...) returned: 0\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4010 "getUpdateCount() returned: 0\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4011 "executeUpdate(UPDATE ...) returned: 4\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4012 "getUpdateCount() returned: 4\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4013 "executeUpdate(DELETE ...) returned: 4\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4014 "getUpdateCount() returned: 4\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4015 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4016 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4017 private void executeDML(Statement st, String sql) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4018 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4019 int upd_count = st.executeUpdate(sql); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4020 sb.append("executeUpdate(").append(sql.substring(0, 6)).append(" ...) returned: ").append(upd_count).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4021 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4022 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4023 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4024 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4025 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4026 sb.append("getUpdateCount() returned: ").append(st.getUpdateCount()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4027 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4028 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4029 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4030 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4031 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4032 private void Bug_IsValid_Timeout_Bug_6782(String arg0) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4033 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4034 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4035 Connection con2 = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4036 Statement st = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4037 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4038 con2 = DriverManager.getConnection(arg0); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4039 sb.append("connected :)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4040 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4041 st = con2.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4042 st.setQueryTimeout(5); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4043 sb.append("getQueryTimeout must give 5: ").append(st.getQueryTimeout()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4044 st.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4045 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4046 con.isValid(6); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4047 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4048 st = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4049 sb.append("getQueryTimeout must give 0: ").append(st.getQueryTimeout()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4050 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4051 con.isValid(4); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4052 sb.append("getQueryTimeout must give 0: ").append(st.getQueryTimeout()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4053 st.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4054 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4055 st.setQueryTimeout(5); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4056 con.isValid(3); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4057 sb.append("getQueryTimeout must give 5: ").append(st.getQueryTimeout()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4058 st.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4059 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4060 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4061 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4062 closeStmtResSet(st, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4063 closeConx(con2); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4064 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4065 compareExpectedOutput("Bug_IsValid_Timeout_Bug_6782", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4066 "connected :)\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4067 "getQueryTimeout must give 5: 5\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4068 "getQueryTimeout must give 0: 0\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4069 "getQueryTimeout must give 0: 0\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4070 "getQueryTimeout must give 5: 5\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4071 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4072 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4073 private void Bug_LargeQueries_6571_6693(String arg0) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4074 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4075 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4076 // construct a largedata string value. It must larger than the block size of MapiSocket |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4077 final int num = 9216; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4078 final String repeatValue = "$-)"; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4079 final StringBuilder ldsb = new StringBuilder(num * repeatValue.length()); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4080 for (int i = 0; i < num; i++) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4081 ldsb.append(repeatValue); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4082 final String largedata = ldsb.toString(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4083 if (largedata.length() <= 8192) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4084 sb.append("Length (").append(largedata.length()).append(") of largedata value is too small! Should be larger than 8192!"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4085 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4086 final String tbl_nm = "tbl6693"; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4087 Statement stmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4088 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4089 stmt = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4090 // create a test table. |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4091 stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + tbl_nm + " (attribute CLOB, value CLOB);"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4092 sb.append("Created table: ").append(tbl_nm).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4093 sb.append("Inserting rows. "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4094 String insertCmd = "INSERT INTO " + tbl_nm + " VALUES ('activeset_default_fiets', '" + largedata + "');"; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4095 int ins = stmt.executeUpdate(insertCmd); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4096 ins += stmt.executeUpdate(insertCmd); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4097 ins += stmt.executeUpdate(insertCmd); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4098 sb.append(ins).append(" rows inserted\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4099 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4100 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4101 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4102 closeStmtResSet(stmt, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4103 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4104 final int script_iterations = 10; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4105 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4106 run_tests(arg0, tbl_nm, script_iterations, largedata); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4107 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4108 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4109 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4110 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4111 try (Statement stmt2 = con.createStatement()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4112 stmt2.executeUpdate("DROP TABLE IF EXISTS " + tbl_nm); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4113 sb.append("Cleaned up TABLE ").append(tbl_nm).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4114 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4115 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4116 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4117 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4118 sb.append("Test completed without hanging\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4119 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4120 compareExpectedOutput("Bug_LargeQueries_6571_6693", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4121 "Created table: tbl6693\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4122 "Inserting rows. 3 rows inserted\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4123 "Script size is 83256\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4124 "First test repeat 10 times. Iteration: 1 2 3 4 5 6 7 8 9 10 \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4125 "Completed first test\n" + |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
4126 "Second test repeat 10 times. Iteration: 1 2 3 4 5 6 7 8 9 10 \n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4127 "Completed second test\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4128 "Script size is 3012\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4129 "Third test repeat 9 times.\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4130 "Iteration: 1 2 3 4 5 6 7 8 9 \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4131 "Completed third test\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4132 "Cleaned up TABLE tbl6693\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4133 "Test completed without hanging\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4134 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4135 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4136 private void run_tests(String conURL, String tbl_nm, int iterations, String largedata) throws SQLException { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4137 String script = |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4138 "delete from " + tbl_nm + " where attribute='activeset_default_fiets';\n" |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4139 + "insert into " + tbl_nm + " values ('activeset_default_fiets', '" + largedata + "');\n" |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4140 + "insert into " + tbl_nm + " values ('activeset_default_fiets', '" + largedata + "');\n" |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4141 + "insert into " + tbl_nm + " values ('activeset_default_fiets', '" + largedata + "');\n" |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4142 + "select value from " + tbl_nm + " where attribute='activeset_default_fiets';\n"; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4143 sb.append("Script size is " + script.length()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4144 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4145 // first try to make the execution hang after many iterations of sending large data queries within one connection |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4146 sb.append("First test repeat " + iterations + " times. "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4147 try (Connection con = DriverManager.getConnection(conURL)) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4148 sb.append("Iteration: "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4149 for (int i = 1; i <= iterations; i++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4150 sb.append(i).append(" "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4151 try (Statement stmt = con.createStatement()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4152 process_script(stmt, script, 1, 3, 6); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4153 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4154 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4155 sb.append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4156 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4157 sb.append("Completed first test\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4158 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4159 // also try to make the execution hang after many iterations of making connections (each their own socket) and sending large scripts |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4160 sb.append("Second test repeat " + iterations + " times. "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4161 sb.append("Iteration: "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4162 for (int i = 1; i <= iterations; i++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4163 try (Connection con = DriverManager.getConnection(conURL)) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4164 sb.append(i).append(" "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4165 try (Statement stmt = con.createStatement()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4166 process_script(stmt, script, 1, 3, 6); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4167 process_script(stmt, script, 1, 3, 6); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4168 process_script(stmt, script, 1, 3, 6); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4169 process_script(stmt, script, 1, 3, 6); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4170 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4171 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4172 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4173 sb.append("\n"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4174 sb.append("Completed second test\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4175 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4176 // next try to make the execution hang by sending very many queries combined in 1 large script |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4177 final int queries = 260; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4178 StringBuilder qry = new StringBuilder(queries * 13); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4179 for (int i = 1; i <= queries; i++) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4180 qry.append(" SELECT ").append(i).append(';'); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4181 script = qry.toString(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4182 sb.append("Script size is " + script.length()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4183 iterations = 9; |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4184 sb.append("Third test repeat " + iterations + " times.\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4185 try (Connection con = DriverManager.getConnection(conURL)) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4186 sb.append("Iteration: "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4187 for (int i = 1; i <= iterations; i++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4188 sb.append(i).append(" "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4189 try (Statement stmt = con.createStatement()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4190 process_script(stmt, script, queries, queries, 0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4191 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4192 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4193 sb.append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4194 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4195 sb.append("Completed third test\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4196 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4197 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4198 private void process_script(Statement stmt, String script, |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4199 int expectedResults, int expectedTotalRows, int expectedUpdates) throws SQLException { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4200 int results = 0; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4201 int rows = 0; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4202 int updates = 0; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4203 stmt.execute(script); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4204 do { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4205 ResultSet rs = stmt.getResultSet(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4206 if (rs != null) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4207 results++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4208 while(rs.next()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4209 String val = rs.getString(1); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4210 rows++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4211 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4212 rs.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4213 } else { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4214 int uc = stmt.getUpdateCount(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4215 if (uc > 0) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4216 updates += uc; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4217 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4218 } while (stmt.getMoreResults() || stmt.getUpdateCount() != -1); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4219 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4220 /* verify nr of processed resultsets and retrieved rows are as expected */ |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4221 if (results != expectedResults) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4222 sb.append(results + "!=" + expectedResults + " "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4223 if (rows != expectedTotalRows) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4224 sb.append(rows + "!=" + expectedTotalRows + " "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4225 if (updates != expectedUpdates) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4226 sb.append(updates + "!=" + expectedUpdates + " "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4227 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4228 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4229 private void Bug_PrepStmtSetObject_CLOB_6349() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4230 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4231 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4232 Statement stmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4233 PreparedStatement pstmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4234 ResultSet rs = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4235 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4236 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4237 stmt = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4238 stmt.executeUpdate("CREATE TABLE PrepStmtSetObject_CLOB (myint INT, myvarchar VARCHAR(15), myclob CLOB)"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4239 stmt.executeUpdate("INSERT INTO PrepStmtSetObject_CLOB VALUES (123, 'A string', 'A longer string')"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4240 stmt.executeUpdate("INSERT INTO PrepStmtSetObject_CLOB VALUES (NULL, NULL, NULL)"); // all NULLs |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4241 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4242 pstmt = con.prepareStatement("SELECT myclob, myvarchar, myint FROM PrepStmtSetObject_CLOB WHERE myclob = ?"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4243 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4244 sb.append("Prepared Query has ").append(pmd.getParameterCount()).append(" parameters. Type of first is: ").append(pmd.getParameterTypeName(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4245 ResultSetMetaData rsmd = pstmt.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4246 sb.append("Prepared Query has ").append(rsmd.getColumnCount()).append(" columns. Type of first is: ").append(rsmd.getColumnTypeName(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4247 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4248 pstmt.setObject(1, "A longer string"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4249 rs = pstmt.executeQuery(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4250 rsmd = rs.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4251 sb.append("Query ResultSet has ").append(rsmd.getColumnCount()).append(" columns. Type of first is: ").append(rsmd.getColumnTypeName(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4252 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4253 boolean has_row = rs.next(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4254 boolean has_rows = rs.next(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4255 if (has_row == false || has_rows == true) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4256 sb.append("Fetching Query ResultSet failed\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4257 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4258 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4259 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4260 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4261 // cleanup |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4262 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4263 stmt.executeUpdate("DROP TABLE PrepStmtSetObject_CLOB"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4264 sb.append("Table dropped\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4265 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4266 sb.append(se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4267 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4268 closeStmtResSet(stmt, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4269 closeStmtResSet(pstmt, rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4270 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4271 compareExpectedOutput("Bug_PrepStmtSetObject_CLOB_6349", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4272 "0. true true\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4273 "Prepared Query has 1 parameters. Type of first is: clob\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4274 "Prepared Query has 3 columns. Type of first is: clob\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4275 "Query ResultSet has 3 columns. Type of first is: clob\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4276 "Table dropped\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4277 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4278 |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4279 private void Bug_PrepStmtSetString_6382() { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4280 sb.setLength(0); // clear the output log buffer |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4281 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4282 Statement stmt = null; |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4283 PreparedStatement pstmt = null; |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4284 ResultSet rs = null; |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4285 final String tableName = "PrepStmtSetString_6382"; |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4286 try { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4287 // >> true: auto commit should be on by default |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4288 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4289 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4290 stmt = con.createStatement(); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4291 sb.append("1. Creating table ").append(tableName); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4292 if (stmt.executeUpdate("CREATE TABLE " + tableName + " (myint INT, myvarchar VARCHAR(15), myjson JSON, myuuid UUID, myurl URL, myinet INET)") != Statement.SUCCESS_NO_INFO) |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4293 sb.append("Wrong return status\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4294 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4295 sb.append("\n2. Insert row 1, "); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4296 stmt.executeUpdate("INSERT INTO " + tableName + " VALUES (1, 'row 1', '{}', uuid '34c8deb5-e608-406b-beda-6a951f73d455', 'https://www.monetdb.org/', '128.0.0.1')"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4297 sb.append("2, "); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4298 stmt.executeUpdate("INSERT INTO " + tableName + " VALUES (2, 'row 2', '[]', NULL, NULL, NULL)"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4299 sb.append("3, "); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4300 stmt.executeUpdate("INSERT INTO " + tableName + " VALUES (3, 'row 3', '\"abc\"', NULL, NULL, NULL)"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4301 sb.append("4, "); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4302 stmt.executeUpdate("INSERT INTO " + tableName + " VALUES (4, 'row 4', 'true', NULL, NULL, NULL)"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4303 sb.append("5\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4304 stmt.executeUpdate("INSERT INTO " + tableName + " VALUES (5, 'row 5', '-0.123', NULL, NULL, NULL)"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4305 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4306 sb.append("Creating a prepared statement with 6 parameters and inserting rows using setInt(), setString(), setNull(), setNString(), setURL(), setObject().\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4307 pstmt = con.prepareStatement("INSERT INTO " + tableName + " VALUES (?,?, ? ,?,? , ?)"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4308 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4309 int pcount = pmd.getParameterCount(); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4310 sb.append("Prepared Statement has ").append(pcount).append(" parameters:").append((pcount != 6 ? " ERROR: Expected 6 parameters!" : "")).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4311 for (int p = 1; p <= pcount; p++) { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4312 sb.append(" Parameter ").append(p).append(" type is: ").append(pmd.getParameterTypeName(p)).append(". JDBC SQL type: ").append(pmd.getParameterType(p)).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4313 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4314 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4315 int row = 6; |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4316 pstmt.setInt(1, row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4317 pstmt.setString(2, "row " + row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4318 pstmt.setString(3, "{\"menu\": {\n \"id\": \"file\",\n \"value\": \"File\",\n \"popup\": {\n \"menuitem\": [\n {\"value\": \"New\", \"onclick\": \"CreateNewDoc()\"},\n {\"value\": \"Open\", \"onclick\": \"OpenDoc()\"},\n {\"value\": \"Close\", \"onclick\": \"CloseDoc()\"}\n ]\n }\n}}"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4319 pstmt.setNull(4, 0); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4320 pstmt.setNull(5, 0); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4321 pstmt.setNull(6, 0); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4322 sb.append("Inserting row ").append(row).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4323 int inserted = pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4324 sb.append("Inserted ").append(inserted).append(" row\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4325 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4326 row++; // row 7 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4327 pstmt.setShort(1, (short)row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4328 pstmt.setNString(2, "row " + row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4329 pstmt.setNull(3, 0); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4330 pstmt.setString(4, "4a148b7d-8d47-4e1e-a21e-09a71abf2215"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4331 sb.append("Inserting row ").append(row).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4332 inserted = pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4333 sb.append("Inserted ").append(inserted).append(" row\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4334 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4335 row++; // row 8 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4336 pstmt.setLong(1, (long)row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4337 pstmt.setString(2, "row " + row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4338 pstmt.setObject(3, "+3.1415E-06"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4339 pstmt.setNull(4, 0); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4340 try { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4341 pstmt.setURL(5, new java.net.URL("https://www.cwi.nl/")); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4342 } catch (java.net.MalformedURLException mfe) { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4343 sb.append(mfe).append("\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4344 } |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4345 sb.append("Inserting row ").append(row).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4346 inserted = pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4347 sb.append("Inserted ").append(inserted).append(" row\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4348 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4349 row++; // row 9 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4350 pstmt.setBigDecimal(1, new java.math.BigDecimal(row)); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4351 pstmt.setNString(2, "row " + row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4352 pstmt.setNull(5, 0); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4353 pstmt.setString(6, "127.255.255.255"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4354 sb.append("Inserting row ").append(row).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4355 inserted = pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4356 sb.append("Inserted ").append(inserted).append(" row\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4357 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4358 /* also test generic setObject(int, String) */ |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4359 row++; // row 10 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4360 pstmt.setObject(1, Integer.valueOf(row)); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4361 pstmt.setObject(2, "row " + row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4362 pstmt.setObject(3, "[{\"menu\": {\n \"header\": \"SVG Viewer\",\n \"items\": [\n {\"id\": \"Open\"},\n {\"id\": \"OpenNew\", \"label\": \"Open New\"},\n null,\n {\"id\": \"ZoomIn\", \"label\": \"Zoom In\"},\n {\"id\": \"ZoomOut\", \"label\": \"Zoom Out\"},\n {\"id\": \"OriginalView\", \"label\": \"Original View\"},\n null,\n {\"id\": \"Quality\"},\n {\"id\": \"Pause\"},\n {\"id\": \"Mute\"},\n null,\n {\"id\": \"Help\"},\n {\"id\": \"About\", \"label\": \"About Adobe CVG Viewer...\"}\n ]\n}}]"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4363 pstmt.setObject(4, "b39dc76e-4faf-4fd9-bc1e-17df48acf764"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4364 pstmt.setObject(5, "https://en.wikipedia.org/wiki/IP_address"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4365 pstmt.setObject(6, "223.255.255.255"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4366 sb.append("Inserting row ").append(row).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4367 inserted = pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4368 sb.append("Inserted ").append(inserted).append(" row\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4369 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4370 row++; // row 11 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4371 pstmt.setObject(1, new java.math.BigDecimal(row)); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4372 pstmt.setObject(2, "row " + row); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4373 pstmt.setObject(3, "null"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4374 pstmt.setObject(4, java.util.UUID.fromString("ff125769-b63c-4c3c-859f-5b84a9349e24")); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4375 URL myURL = new URL(); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4376 try { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4377 myURL.fromString("https://en.wikipedia.org/wiki/IP_address"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4378 pstmt.setObject(5, myURL); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4379 } catch (Exception mfe) { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4380 sb.append(mfe).append("\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4381 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4382 INET myINET = new INET(); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4383 myINET.fromString("223.234.245.255"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4384 pstmt.setObject(6, myINET); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4385 sb.append("Inserting row ").append(row).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4386 inserted = pstmt.executeUpdate(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4387 sb.append("Inserted ").append(inserted).append(" row\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4388 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4389 sb.append("List contents of TABLE ").append(tableName).append(" after ").append(row).append(" rows inserted\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4390 rs = stmt.executeQuery("SELECT * FROM " + tableName + " ORDER BY 1"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4391 ResultSetMetaData rsmd = rs.getMetaData(); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4392 int colcount = rsmd.getColumnCount(); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4393 sb.append("Query has ").append(colcount).append(" output columns.").append((colcount != 6 ? " ERROR: Expected 6 columns!" : "")).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4394 row = 0; |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4395 while (rs.next()) { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4396 sb.append("row ").append(++row); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4397 for (int c = 1; c <= colcount; c++) { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4398 sb.append("\t").append(rs.getString(c)); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4399 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4400 sb.append("\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4401 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4402 } catch (SQLException e) { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4403 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4404 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4405 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4406 try { |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4407 sb.append("Cleanup TABLE ").append(tableName).append("\n"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4408 stmt.executeUpdate("DROP TABLE " + tableName); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4409 } catch (SQLException e) { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4410 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4411 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4412 |
437
1333c19b0c1b
include missing )
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
436
diff
changeset
|
4413 closeStmtResSet(stmt, rs); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4414 closeStmtResSet(pstmt, null); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4415 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4416 compareExpectedOutput("Bug_PrepStmtSetString_6382", |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4417 "0. true true\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4418 "1. Creating table PrepStmtSetString_6382\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4419 "2. Insert row 1, 2, 3, 4, 5\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4420 "Creating a prepared statement with 6 parameters and inserting rows using setInt(), setString(), setNull(), setNString(), setURL(), setObject().\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4421 "Prepared Statement has 6 parameters:\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4422 " Parameter 1 type is: int. JDBC SQL type: 4\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4423 " Parameter 2 type is: varchar. JDBC SQL type: 12\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4424 " Parameter 3 type is: json. JDBC SQL type: 12\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4425 " Parameter 4 type is: uuid. JDBC SQL type: 12\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4426 " Parameter 5 type is: url. JDBC SQL type: 12\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4427 " Parameter 6 type is: inet. JDBC SQL type: 12\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4428 "Inserting row 6\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4429 "Inserted 1 row\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4430 "Inserting row 7\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4431 "Inserted 1 row\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4432 "Inserting row 8\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4433 "Inserted 1 row\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4434 "Inserting row 9\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4435 "Inserted 1 row\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4436 "Inserting row 10\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4437 "Inserted 1 row\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4438 "Inserting row 11\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4439 "Inserted 1 row\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4440 "List contents of TABLE PrepStmtSetString_6382 after 11 rows inserted\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4441 "Query has 6 output columns.\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4442 "row 1 1 row 1 {} 34c8deb5-e608-406b-beda-6a951f73d455 https://www.monetdb.org/ 128.0.0.1\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4443 "row 2 2 row 2 [] null null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4444 "row 3 3 row 3 \"abc\" null null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4445 "row 4 4 row 4 true null null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4446 "row 5 5 row 5 -0.123 null null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4447 "row 6 6 row 6 {\"menu\": {\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4448 " \"id\": \"file\",\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4449 " \"value\": \"File\",\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4450 " \"popup\": {\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4451 " \"menuitem\": [\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4452 " {\"value\": \"New\", \"onclick\": \"CreateNewDoc()\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4453 " {\"value\": \"Open\", \"onclick\": \"OpenDoc()\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4454 " {\"value\": \"Close\", \"onclick\": \"CloseDoc()\"}\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4455 " ]\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4456 " }\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4457 "}} null null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4458 "row 7 7 row 7 null 4a148b7d-8d47-4e1e-a21e-09a71abf2215 null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4459 "row 8 8 row 8 +3.1415E-06 null https://www.cwi.nl/ null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4460 "row 9 9 row 9 +3.1415E-06 null null 127.255.255.255\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4461 "row 10 10 row 10 [{\"menu\": {\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4462 " \"header\": \"SVG Viewer\",\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4463 " \"items\": [\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4464 " {\"id\": \"Open\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4465 " {\"id\": \"OpenNew\", \"label\": \"Open New\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4466 " null,\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4467 " {\"id\": \"ZoomIn\", \"label\": \"Zoom In\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4468 " {\"id\": \"ZoomOut\", \"label\": \"Zoom Out\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4469 " {\"id\": \"OriginalView\", \"label\": \"Original View\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4470 " null,\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4471 " {\"id\": \"Quality\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4472 " {\"id\": \"Pause\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4473 " {\"id\": \"Mute\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4474 " null,\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4475 " {\"id\": \"Help\"},\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4476 " {\"id\": \"About\", \"label\": \"About Adobe CVG Viewer...\"}\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4477 " ]\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4478 "}}] b39dc76e-4faf-4fd9-bc1e-17df48acf764 https://en.wikipedia.org/wiki/IP_address 223.255.255.255\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4479 "row 11 11 row 11 null ff125769-b63c-4c3c-859f-5b84a9349e24 https://en.wikipedia.org/wiki/IP_address 223.234.245.255\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4480 "Cleanup TABLE PrepStmtSetString_6382\n"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4481 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4482 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4483 private void Bug_PrepStmt_With_Errors_Jira292() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4484 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4485 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4486 Statement stmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4487 PreparedStatement pstmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4488 ResultSet rs = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4489 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4490 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4491 con.setNetworkTimeout(null, (10 *1000)); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4492 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4493 stmt = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4494 stmt.executeUpdate("drop table if exists abacus;"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4495 stmt.executeUpdate("create table abacus ( \"'Zeitachse'\" date,\"'Abo_ID'\" int,\"'description'\" varchar(256),\"'Klassierungs-Typ'\" clob,\"'KlassierungApplikation'\" clob,\"'EP Netto'\" decimal,\"'Nettoumsatz'\" decimal,\"'validfrom'\" date,\"'validuntil'\" date,\"'Abo_aufgeschaltet'\" int,\"'Abo_deaktiviert'\" int,\"'Differenz'\" decimal,\"'User_ID'\" int,\"'UserName'\" varchar(256),\"'client'\" varchar(256),\"'Installations_ID'\" int,\"'InstallationsName'\" varchar(256),\"'Installationsprovider_ID'\" int,\"'InstallationsproviderName'\" varchar(256),\"'INR'\" bigint,\"'NAME'\" varchar(256),\"'PLZ'\" varchar(256),\"'ORT'\" varchar(256),\"'STAAT'\" varchar(256),\"'Reseller_ID'\" int,\"'ResellerName'\" varchar(256),\"'ET_ABO'\" clob,\"'UserName_1'\" varchar(256),\"'Anzahl_Abos'\" decimal,\"'Anzahl_User'\" decimal,\"'Jahr'\" decimal,\"'Monat'\" decimal,\"'Jahr_Monat'\" clob,\"'IFJ'\" clob,\"'RECNUM$'\" int,\"'InlineCalc_Year_Zeitachse'\" int);"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4496 stmt.executeUpdate("insert into abacus values ('2019-10-30',2239,'description','Klassierungs-Typ','Klassierung-Applikation',73.28,68.29,'2018-01-01','2018-12-01',563,63,56.3,852,'UserName','client',134,'InstallationsName',892,'InstallationsproviderName',9348,'NAME','PLZ','ORT','STAAT',934,'ResellerName','ET_ABO','UserName_1',849.2739,1742.718,395.824,39.824,'Jahr_Monat','IFJ',395824,3789);"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4497 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4498 sb.append("1. table created and inserted 1 row\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4499 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4500 String qry = "SELECT \"'ResellerName'\" FROM abacus WHERE ( ( (\"'InstallationsproviderName'\"='Bienz Pius Treuhand- und Revisions AG')) AND ( (\"'validuntil'\"='2018-01-01' AND \"'description'\"='ABEA 2' AND (EXTRACT(YEAR FROM \"'Zeitachse'\")*100 + EXTRACT(MONTH FROM \"'Zeitachse'\"))/100.0='2019.010' AND \"'UserName'\"='AL - Astrid Lincke (Delphys)' AND \"'validfrom'\"='2016-12-01')) AND ( (\"'IFJ'\"='ohne IFJ')) AND ( (\"'InlineCalc_Year_Zeitachse'\"='2019'))) GROUP BY \"'ResellerName'\" LIMIT 1001 OFFSET 0;"; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4501 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4502 sb.append("2. before select query execution\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4503 rs = stmt.executeQuery(qry); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4504 sb.append("2a. select query executed\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4505 if (rs != null) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4506 if (rs.next()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4507 sb.append("2b. select query returned: " + rs.getString(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4508 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4509 rs.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4510 rs = null; |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4511 sb.append("2c. closed select query resultset\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4512 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4513 sb.append("2d. normal end of select query\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4514 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4515 sb.append("select query Exception: "+ se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4516 while ((se = se.getNextException()) != null) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4517 sb.append("next Exception: "+ se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4518 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4519 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4520 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4521 sb.append("3. before creating a prepared select query\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4522 pstmt = con.prepareStatement(qry); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4523 sb.append("3a. prepared select query\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4524 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4525 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4526 sb.append("3b. Prepared Query has " + pmd.getParameterCount() + " parameters."); // "Type of first is: " + pmd.getParameterTypeName(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4527 ResultSetMetaData rsmd = pstmt.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4528 sb.append("3c. Prepared Query has " + rsmd.getColumnCount() + " columns. Type of first is: " + rsmd.getColumnTypeName(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4529 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4530 sb.append("3d. before executing the prepared select query\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4531 rs = pstmt.executeQuery(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4532 sb.append("3e. prepared select query executed\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4533 if (rs != null) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4534 rsmd = rs.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4535 sb.append("3f. prepared Query ResultSet has " + rsmd.getColumnCount() + " columns. Type of first is: " + rsmd.getColumnTypeName(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4536 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4537 if (rs.next()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4538 sb.append("3g. prepared select query returned: " + rs.getString(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4539 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4540 rs.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4541 rs = null; |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4542 sb.append("3h. closed prepared select query resultset\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4543 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4544 sb.append("3i. normal end of prepared select query\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4545 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4546 sb.append("prepared select query Exception: "+ se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4547 while ((se = se.getNextException()) != null) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4548 sb.append("next Exception: "+ se.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4549 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4550 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4551 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4552 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4553 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4554 try { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4555 sb.append("4. drop table\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4556 stmt.executeUpdate("drop table abacus"); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4557 sb.append("5. normal end of test\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4558 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4559 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4560 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4561 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4562 closeStmtResSet(pstmt, rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4563 closeStmtResSet(stmt, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4564 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4565 compareExpectedOutput("Bug_PrepStmt_With_Errors_Jira292", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4566 "0. true true\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4567 "1. table created and inserted 1 row\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4568 "2. before select query execution\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4569 "2a. select query executed\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4570 "2c. closed select query resultset\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4571 "2d. normal end of select query\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4572 "3. before creating a prepared select query\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4573 "3a. prepared select query\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4574 "3b. Prepared Query has 0 parameters.3c. Prepared Query has 1 columns. Type of first is: varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4575 "3d. before executing the prepared select query\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4576 "3e. prepared select query executed\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4577 "3f. prepared Query ResultSet has 1 columns. Type of first is: varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4578 "3h. closed prepared select query resultset\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4579 "3i. normal end of prepared select query\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4580 "4. drop table\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4581 "5. normal end of test\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4582 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4583 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4584 private void BugResultSetMetaData_Bug_6183() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4585 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4586 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4587 final String dqTblName = "\"my dq_table\""; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4588 final String[] dqColNames = { "\"my space\"", "\"my, comma_space\"", "\"my$dollar\"", "\"my#hash\"", "\"my tab\"" |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4589 , "\"my ,tab_comma\"", "\"my, comma_tab\"", "\"my\"\"double_doublequote\"", "\"Abc\"", "\" \"", "\"123\"" }; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4590 Statement stmt = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4591 ResultSet rs = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4592 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4593 StringBuilder ctsb = new StringBuilder(30 + (dqColNames.length * (30 + 15))); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4594 ctsb.append("CREATE TABLE ").append(dqTblName).append(" ("); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4595 for (int n = 0; n < dqColNames.length; n++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4596 ctsb.append(dqColNames[n]); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4597 ctsb.append(" varchar(").append(31 + n).append(')'); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4598 if (n < (dqColNames.length -1)) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4599 ctsb.append(", "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4600 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4601 ctsb.append(')'); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4602 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4603 stmt = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4604 sb.append("1. create table ").append(dqTblName).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4605 int ret = stmt.executeUpdate(ctsb.toString()); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4606 if (ret != -2) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4607 sb.append(" returned: ").append(ret).append(" (expected -2)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4608 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4609 String tblName = dqTblName.substring(1, dqTblName.length() -1); // trim the leading and trailing double quote characters |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4610 sb.append("2. show column names of this new table (").append(tblName).append(") via sys.columns query\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4611 rs = stmt.executeQuery("SELECT number, name, type from sys.columns where table_id in (select id from sys._tables where name = '" + tblName + "') order by number"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4612 showResultAndClose_6183(rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4613 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4614 sb.append("3. insert 1 row of data with values same as column names\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4615 ctsb.setLength(0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4616 ctsb.append("INSERT INTO ").append(dqTblName).append(" VALUES ("); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4617 for (int n = 0; n < dqColNames.length; n++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4618 ctsb.append('\''); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4619 ctsb.append(dqColNames[n]); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4620 ctsb.append('\''); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4621 if (n < (dqColNames.length -1)) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4622 ctsb.append(", "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4623 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4624 ctsb.append(')'); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4625 ret = stmt.executeUpdate(ctsb.toString()); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4626 if (ret != 1) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4627 sb.append(" returned: ").append(ret).append(" (expected 1)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4628 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4629 sb.append("4. insert 1 row of data with values same as column names but without enclosing double quotes\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4630 ctsb.setLength(0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4631 ctsb.append("INSERT INTO ").append(dqTblName).append(" VALUES ("); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4632 for (int n = 0; n < dqColNames.length; n++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4633 ctsb.append('\''); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4634 // remove enclosing double quotes |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4635 ctsb.append(dqColNames[n].substring(1, dqColNames[n].length() -1)); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4636 ctsb.append('\''); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4637 if (n < (dqColNames.length -1)) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4638 ctsb.append(", "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4639 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4640 ctsb.append(')'); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4641 ret = stmt.executeUpdate(ctsb.toString()); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4642 if (ret != 1) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4643 sb.append(" returned: ").append(ret).append(" (expected 1)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4644 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4645 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4646 "1. create table \"my dq_table\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4647 "2. show column names of this new table (my dq_table) via sys.columns query\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4648 "Resultset with 3 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4649 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4650 "1 number number\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4651 "2 name name\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4652 "3 type type\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4653 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4654 "0 my space varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4655 "1 my, comma_space varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4656 "2 my$dollar varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4657 "3 my#hash varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4658 "4 my tab varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4659 "5 my ,tab_comma varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4660 "6 my, comma_tab varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4661 "7 my\"double_doublequote varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4662 "8 Abc varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4663 "9 varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4664 "10 123 varchar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4665 "Listed 11 rows\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4666 "3. insert 1 row of data with values same as column names\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4667 "4. insert 1 row of data with values same as column names but without enclosing double quotes\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4668 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4669 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4670 // query each column separately |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4671 int n = 0; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4672 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4673 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4674 "5. show content of column(s): \"my space\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4675 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4676 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4677 "1 my space my space\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4678 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4679 "\"my space\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4680 "my space\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4681 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4682 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4683 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4684 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4685 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4686 "6. show content of column(s): \"my, comma_space\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4687 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4688 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4689 "1 my, comma_space my, comma_space\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4690 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4691 "\"my, comma_space\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4692 "my, comma_space\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4693 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4694 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4695 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4696 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4697 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4698 "7. show content of column(s): \"my$dollar\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4699 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4700 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4701 "1 my$dollar my$dollar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4702 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4703 "\"my$dollar\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4704 "my$dollar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4705 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4706 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4707 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4708 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4709 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4710 "8. show content of column(s): \"my#hash\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4711 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4712 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4713 "1 my#hash my#hash\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4714 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4715 "\"my#hash\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4716 "my#hash\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4717 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4718 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4719 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4720 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4721 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4722 "9. show content of column(s): \"my tab\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4723 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4724 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4725 "1 my tab my tab\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4726 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4727 "\"my tab\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4728 "my tab\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4729 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4730 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4731 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4732 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4733 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4734 "10. show content of column(s): \"my ,tab_comma\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4735 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4736 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4737 "1 my ,tab_comma my ,tab_comma\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4738 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4739 "\"my ,tab_comma\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4740 "my ,tab_comma\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4741 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4742 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4743 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4744 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4745 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4746 "11. show content of column(s): \"my, comma_tab\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4747 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4748 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4749 "1 my, comma_tab my, comma_tab\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4750 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4751 "\"my, comma_tab\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4752 "my, comma_tab\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4753 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4754 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4755 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4756 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4757 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4758 "12. show content of column(s): \"my\"\"double_doublequote\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4759 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4760 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4761 "1 my\\\"double_doublequote my\\\"double_doublequote\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4762 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4763 "\"my\"\"double_doublequote\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4764 "my\"\"double_doublequote\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4765 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4766 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4767 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4768 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4769 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4770 "13. show content of column(s): \"Abc\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4771 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4772 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4773 "1 Abc Abc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4774 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4775 "\"Abc\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4776 "Abc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4777 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4778 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4779 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4780 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4781 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4782 "14. show content of column(s): \" \"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4783 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4784 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4785 "1 \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4786 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4787 "\" \"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4788 " \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4789 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4790 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4791 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4792 executeQueryAndShowResult_6183(stmt, dqTblName, dqColNames[n], 5 + n); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4793 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4794 "15. show content of column(s): \"123\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4795 "Resultset with 1 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4796 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4797 "1 123 123\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4798 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4799 "\"123\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4800 "123\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4801 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4802 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4803 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4804 // query all columns |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4805 executeQueryAndShowResult_6183(stmt, dqTblName, "*", 5 + dqColNames.length); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4806 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4807 "16. show content of column(s): *\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4808 "Resultset with 11 columns\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4809 " Column Name, Column Label:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4810 "1 my space my space\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4811 "2 my, comma_space my, comma_space\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4812 "3 my$dollar my$dollar\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4813 "4 my#hash my#hash\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4814 "5 my tab my tab\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4815 "6 my ,tab_comma my ,tab_comma\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4816 "7 my, comma_tab my, comma_tab\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4817 "8 my\\\"double_doublequote my\\\"double_doublequote\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4818 "9 Abc Abc\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4819 "10 \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4820 "11 123 123\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4821 "Data rows:\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4822 "\"my space\" \"my, comma_space\" \"my$dollar\" \"my#hash\" \"my tab\" \"my ,tab_comma\" \"my, comma_tab\" \"my\"\"double_doublequote\" \"Abc\" \" \" \"123\"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4823 "my space my, comma_space my$dollar my#hash my tab my ,tab_comma my, comma_tab my\"\"double_doublequote Abc 123\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4824 "Listed 2 rows\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4825 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4826 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4827 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4828 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4829 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4830 // cleanup |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4831 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4832 sb.append("Finally drop table ").append(dqTblName).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4833 int ret = stmt.executeUpdate("DROP TABLE " + dqTblName); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4834 if (ret != -2) |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4835 sb.append(" returned: ").append(ret).append(" (expected -2)\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4836 } catch (SQLException e) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4837 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4838 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4839 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4840 closeStmtResSet(stmt, rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4841 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4842 compareExpectedOutput("BugResultSetMetaData_Bug_6183", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4843 "Finally drop table \"my dq_table\"\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4844 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4845 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4846 private void executeQueryAndShowResult_6183(Statement st, String dqTblName, String col_list, int query_count) throws SQLException { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4847 sb.append(query_count).append(". show content of column(s): ").append(col_list).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4848 ResultSet rs = st.executeQuery("SELECT " + col_list + " from " + dqTblName); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4849 showResultAndClose_6183(rs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4850 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4851 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4852 private void showResultAndClose_6183(ResultSet rs) throws SQLException { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4853 ResultSetMetaData rsmd = rs.getMetaData(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4854 int rs_col_count = rsmd.getColumnCount(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4855 sb.append("Resultset with ").append(rs_col_count).append(" columns\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4856 sb.append("\tColumn Name, Column Label:\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4857 for (int col = 1; col <= rs_col_count; col++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4858 sb.append(col).append("\t").append(rsmd.getColumnName(col)).append("\t").append(rsmd.getColumnLabel(col)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4859 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4860 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4861 sb.append("Data rows:\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4862 long row_count = 0; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4863 while (rs.next()) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4864 row_count++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4865 for (int col = 1; col <= rs_col_count; col++) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4866 if (col > 1) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4867 sb.append("\t"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4868 sb.append(rs.getString(col)); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4869 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4870 sb.append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4871 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4872 rs.close(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4873 sb.append("Listed ").append(row_count).append(" rows\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4874 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4875 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4876 private void BugSetQueryTimeout_Bug_3357() { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4877 sb.setLength(0); // clear the output log buffer |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4878 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4879 int originalQueryTimeout = 1; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4880 Statement st = null; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4881 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4882 st = con.createStatement(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4883 originalQueryTimeout = st.getQueryTimeout(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4884 sb.append("original getQueryTimeout = ").append(originalQueryTimeout).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4885 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4886 testTimeout_3357(st, 123); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4887 testTimeout_3357(st, 123456); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4888 testTimeout_3357(st, 2134567890); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4889 testTimeout_3357(st, 0); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4890 testTimeout_3357(st, 10); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4891 testTimeout_3357(st, -1); // to generate an SQLException as negative timeouts are invalid |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4892 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4893 sb.append("\n SQLException: setQueryTimeout(timeout_value) throws: ").append(se).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4894 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4895 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4896 // restore originalQueryTimeout |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4897 try { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4898 testTimeout_3357(st, originalQueryTimeout); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4899 } catch (SQLException se) { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4900 sb.append("setQueryTimeout(timeout_value) throws: ").append(se).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4901 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4902 closeStmtResSet(st, null); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4903 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4904 compareExpectedOutput("BugSetQueryTimeout_Bug_3357", |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4905 "original getQueryTimeout = 0\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4906 "setQueryTimeout = 123. getQueryTimeout = 123\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4907 "setQueryTimeout = 123456. getQueryTimeout = 123456\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4908 "setQueryTimeout = 2134567890. getQueryTimeout = 2134567890\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4909 "setQueryTimeout = 0. getQueryTimeout = 0\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4910 "setQueryTimeout = 10. getQueryTimeout = 10\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4911 "setQueryTimeout = -1. \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4912 " SQLException: setQueryTimeout(timeout_value) throws: java.sql.SQLException: Illegal timeout value: -1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4913 "setQueryTimeout = 0. getQueryTimeout = 0\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4914 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4915 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4916 private void testTimeout_3357(Statement st, int secs) throws SQLException { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4917 sb.append("setQueryTimeout = ").append(secs).append(". "); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4918 st.setQueryTimeout(secs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4919 // as the call to set the timeout is delayed till a statement is executed, issue a select statment |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4920 ResultSet rs = st.executeQuery("SELECT " + secs); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4921 if (rs != null) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4922 rs.close(); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4923 sb.append("getQueryTimeout = ").append(st.getQueryTimeout()).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4924 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4925 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4926 /** |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4927 * This SQLcopyinto program demonstrates how the MonetDB JDBC driver can facilitate |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4928 * in performing COPY INTO ... FROM STDIN sequences. |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4929 * It shows how a data stream via MapiSocket to STDIN can be performed. |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4930 * |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4931 * @author Fabian Groffen, Martin van Dinther |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4932 */ |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4933 private void SQLcopyinto() { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4934 sb.setLength(0); // clear the output log buffer |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4935 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4936 final String tablenm = "exampleSQLCopyInto"; |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4937 Statement stmt = null; |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4938 ResultSet rs = null; |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4939 try { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4940 stmt = con.createStatement(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4941 stmt.execute("CREATE TABLE IF NOT EXISTS " + tablenm + " (id int, val varchar(24))"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4942 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4943 fillTableUsingCopyIntoSTDIN(tablenm); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4944 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4945 // check content of the table populated via COPY INTO ... FROM STDIN |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4946 sb.append("Listing uploaded data:\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4947 int row = 0; |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4948 rs = stmt.executeQuery("SELECT * FROM " + tablenm); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4949 if (rs != null) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4950 while (rs.next()) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4951 row++; |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4952 if ((row % 1000) == 0) |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4953 sb.append("Row data: ").append(rs.getString(1)).append(", ").append(rs.getString(2)).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4954 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4955 rs.close(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4956 rs = null; |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4957 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4958 } catch (SQLException se) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4959 sb.append("SQLException: ").append(se.getMessage()).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4960 } catch (Exception e) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4961 sb.append("Exception: ").append(e.getMessage()).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4962 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4963 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4964 // cleanup |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4965 try { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4966 stmt.execute("DROP TABLE " + tablenm); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4967 sb.append("SQLcopyinto completed\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4968 } catch (SQLException se) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4969 sb.append("SQLException: ").append(se.getMessage()).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4970 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4971 closeStmtResSet(stmt, rs); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4972 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4973 compareExpectedOutput("SQLcopyinto()", |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4974 "CopyInto STDIN begin\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4975 "Before connecting to MonetDB server via MapiSocket\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4976 "Connected to MonetDB server via MapiSocket\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4977 "Before sending data to STDIN\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4978 "Completed sending data via STDIN\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4979 "CopyInto STDIN end\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4980 "Listing uploaded data:\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4981 "Row data: 999, val_999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4982 "Row data: 1999, val_1999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4983 "Row data: 2999, val_2999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4984 "Row data: 3999, val_3999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4985 "Row data: 4999, val_4999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4986 "Row data: 5999, val_5999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4987 "Row data: 6999, val_6999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4988 "Row data: 7999, val_7999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4989 "Row data: 8999, val_8999\n" + |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4990 "SQLcopyinto completed\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4991 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4992 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4993 private void fillTableUsingCopyIntoSTDIN(String tablenm) throws Exception { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4994 sb.append("CopyInto STDIN begin\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4995 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4996 org.monetdb.mcl.net.MapiSocket server = new org.monetdb.mcl.net.MapiSocket(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4997 try { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4998 server.setLanguage("sql"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4999 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5000 // extract from MonetConnection object the used connection properties |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5001 String host = con.getClientInfo("host"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5002 int port = Integer.parseInt(con.getClientInfo("port")); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5003 String login = con.getClientInfo("user"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5004 String passw = con.getClientInfo("password"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5005 // sb.append("host: " + host + " port: " + port + " login: " + login + " passwd: " + passw + "\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5006 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5007 sb.append("Before connecting to MonetDB server via MapiSocket\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5008 List<String> warning = server.connect(host, port, login, passw); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5009 if (warning != null) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5010 for (Iterator<String> it = warning.iterator(); it.hasNext(); ) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5011 sb.append("Warning: ").append(it.next().toString()).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5012 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5013 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5014 sb.append("Connected to MonetDB server via MapiSocket\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5015 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5016 org.monetdb.mcl.io.BufferedMCLReader mclIn = server.getReader(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5017 org.monetdb.mcl.io.BufferedMCLWriter mclOut = server.getWriter(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5018 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5019 String error = mclIn.waitForPrompt(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5020 if (error != null) |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5021 sb.append("Received start error: ").append(error).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5022 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5023 sb.append("Before sending data to STDIN\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5024 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5025 // the leading 's' is essential, since it is a protocol marker |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5026 // that should not be omitted, likewise the trailing semicolon |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5027 mclOut.write('s'); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5028 mclOut.write("COPY INTO " + tablenm + " FROM STDIN USING DELIMITERS ',',E'\\n';"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5029 mclOut.newLine(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5030 // now write the row data values as csv data lines to the STDIN stream |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5031 for (int i = 0; i < 9000; i++) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5032 mclOut.write("" + i + ",val_" + i); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5033 mclOut.newLine(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5034 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5035 mclOut.writeLine(""); // need this one for synchronisation over flush() |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5036 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5037 error = mclIn.waitForPrompt(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5038 if (error != null) |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5039 sb.append("Received error: ").append(error).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5040 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5041 mclOut.writeLine(""); // need this one for synchronisation over flush() |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5042 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5043 error = mclIn.waitForPrompt(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5044 if (error != null) |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5045 sb.append("Received finish error: ").append(error).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5046 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5047 sb.append("Completed sending data via STDIN\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5048 } catch (Exception e) { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5049 sb.append("Mapi Exception: ").append(e.getMessage()).append("\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5050 } finally { |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5051 // close MAPI connection to MonetDB server |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5052 server.close(); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5053 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5054 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5055 sb.append("CopyInto STDIN end\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5056 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5057 |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
5058 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5059 // some private utility methods for showing table content and params meta data |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5060 private void showTblContents(String tblnm) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5061 Statement stmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5062 ResultSet rs = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5063 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5064 stmt = con.createStatement(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5065 rs = stmt.executeQuery("SELECT * FROM " + tblnm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5066 if (rs != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5067 ResultSetMetaData rsmd = rs.getMetaData(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5068 sb.append("Table ").append(tblnm).append(" has ").append(rsmd.getColumnCount()).append(" columns:\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5069 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5070 sb.append("\t").append(rsmd.getColumnLabel(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5071 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5072 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5073 while (rs.next()) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5074 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5075 sb.append("\t").append(rs.getString(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5076 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5077 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5078 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5079 } else |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5080 sb.append("failed to execute query: SELECT * FROM ").append(tblnm).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5081 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5082 sb.append("showContents failed: ").append(e.getMessage()).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5083 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5084 closeStmtResSet(stmt, rs); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5085 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5086 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5087 private void showParams(PreparedStatement pstmt) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5088 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5089 // testing and showing parameter meta data |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5090 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5091 sb.append("pmd. ").append(pmd.getParameterCount()).append(" parameters:\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5092 for (int parm = 1; parm <= pmd.getParameterCount(); parm++) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5093 sb.append("Param ").append(parm).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5094 int nullable = pmd.isNullable(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5095 sb.append(" nullable ").append(nullable).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5096 switch (nullable) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5097 case ParameterMetaData.parameterNoNulls: sb.append("NO"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5098 case ParameterMetaData.parameterNullable: sb.append("YA"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5099 case ParameterMetaData.parameterNullableUnknown: sb.append("UNKNOWN"); break; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5100 default: sb.append("INVALID ").append(nullable); break; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5101 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5102 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5103 sb.append(" signed ").append(pmd.isSigned(parm)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5104 sb.append(" precision ").append(pmd.getPrecision(parm)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5105 sb.append(" scale ").append(pmd.getScale(parm)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5106 sb.append(" type ").append(pmd.getParameterType(parm)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5107 sb.append(" typename ").append(pmd.getParameterTypeName(parm)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5108 sb.append(" classname ").append(pmd.getParameterClassName(parm)).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5109 int mode = pmd.getParameterMode(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5110 sb.append(" mode ").append(mode).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5111 switch (mode) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5112 case ParameterMetaData.parameterModeIn: sb.append("IN"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5113 case ParameterMetaData.parameterModeInOut: sb.append("INOUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5114 case ParameterMetaData.parameterModeOut: sb.append("OUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5115 case ParameterMetaData.parameterModeUnknown: sb.append("UNKNOWN"); break; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5116 default: sb.append("INVALID ").append(mode); break; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5117 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5118 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5119 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5120 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5121 sb.append("showParams() FAILED: ").append(e.getMessage()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5122 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5123 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5124 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5125 private void readExceptions(SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5126 while (e != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5127 sb.append("Exception: ").append(e.toString()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5128 e = e.getNextException(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5129 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5130 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5131 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5132 private void readWarnings(SQLWarning w) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5133 while (w != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5134 sb.append("Warning: ").append(w.toString()).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5135 w = w.getNextWarning(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5136 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5137 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5138 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5139 private void compareExpectedOutput(String testname, String expected) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5140 if (!expected.equals(sb.toString())) { |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5141 foundDifferences = true; |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5142 System.err.print("Test '"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5143 System.err.print(testname); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5144 if (!testname.endsWith(")")) |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5145 System.err.print("()"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5146 System.err.println("' produced different output!"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5147 System.err.println("Expected:"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5148 System.err.println(expected); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5149 System.err.println("Gotten:"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5150 System.err.println(sb); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5151 System.err.println(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5152 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5153 if (sb.length() > sbInitLen) { |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5154 System.err.println("Test '" + testname |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5155 + "' produced output > " + sbInitLen |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5156 + " chars! Enlarge sbInitLen to: " + sb.length()); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5157 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5158 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5159 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5160 private void closeConx(Connection cn) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5161 if (cn != null) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5162 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5163 cn.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5164 } catch (SQLException e) { /* ignore */ } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5165 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5166 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5167 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5168 private void closeStmtResSet(Statement st, ResultSet rs) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5169 if (rs != null) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5170 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5171 rs.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5172 } catch (SQLException e) { /* ignore */ } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5173 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5174 if (st != null) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5175 try { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5176 st.close(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5177 } catch (SQLException e) { /* ignore */ } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5178 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5179 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5180 } |