Mercurial > hg > monetdb-java
annotate tests/JDBC_API_Tester.java @ 686:8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 10 Nov 2022 20:13:35 +0100 (2022-11-10) |
parents | 78253fdb3c3f |
children | 801174945283 |
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 * |
610
6aa38e8c0f2d
Updated Copyright year.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
593
diff
changeset
|
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2022 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(); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
63 jt.Test_DBCmetadata(); |
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
|
64 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
|
65 jt.Test_Int128(); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
66 jt.Test_Interval_Types(); |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
67 jt.Test_PlanExplainTraceDebugCmds(); |
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
|
68 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
|
69 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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 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
|
96 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
|
97 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
|
98 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
|
99 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
|
100 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
|
101 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
|
102 jt.SQLcopyinto(); |
664
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
103 jt.DecimalPrecisionAndScale(); |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
104 /* 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
|
105 /* 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
|
106 |
0eef53e06007
Add JDBC_API_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 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
|
108 |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
109 if (jt.foundDifferences) |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
110 System.exit(-1); |
550
c5cf3f00c4c5
Run the OnClient tests from JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
488
diff
changeset
|
111 |
674
b885de91095d
Add tests for autocommit and timezone handshake options
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
667
diff
changeset
|
112 ConnectionTests.runTests(con_URL); |
b885de91095d
Add tests for autocommit and timezone handshake options
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
667
diff
changeset
|
113 |
686
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
114 // invoke running OnClientTester only on Sept2022 (11.45) or older servers |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
115 DatabaseMetaData dbmd = jt.con.getMetaData(); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
116 int dbmsMajorVersion = dbmd.getDatabaseMajorVersion(); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
117 int dbmsMinorVersion = dbmd.getDatabaseMinorVersion(); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
118 if (dbmsMajorVersion == 11 && dbmsMinorVersion <= 45) { |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
119 OnClientTester oct = new OnClientTester(con_URL, 0); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
120 int failures = oct.runTests(); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
121 if (failures > 0) |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
122 System.exit(-1); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
123 } |
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
|
124 } |
0eef53e06007
Add JDBC_API_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 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
|
127 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
|
128 |
0eef53e06007
Add JDBC_API_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 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
|
130 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 |
0eef53e06007
Add JDBC_API_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 // >> 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
|
138 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
|
139 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
|
140 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
|
141 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
|
142 |
0eef53e06007
Add JDBC_API_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 // 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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 |
0eef53e06007
Add JDBC_API_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 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
|
150 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
|
151 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
|
152 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
|
153 } 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
163 // 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
|
164 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
|
165 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
|
166 |
0eef53e06007
Add JDBC_API_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 // >> 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
|
168 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
|
169 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
|
170 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
|
171 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
|
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 // 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
|
174 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
|
175 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
|
176 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
|
177 |
0eef53e06007
Add JDBC_API_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 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
|
179 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
|
180 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
|
181 |
0eef53e06007
Add JDBC_API_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 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
|
183 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
|
184 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
|
185 |
0eef53e06007
Add JDBC_API_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 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
|
187 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
|
188 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
|
189 |
0eef53e06007
Add JDBC_API_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 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
|
191 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
|
192 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
|
193 |
0eef53e06007
Add JDBC_API_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 // 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
|
195 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
|
196 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
|
197 } 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
|
198 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
|
199 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
202 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
|
203 |
0eef53e06007
Add JDBC_API_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 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
|
205 |
0eef53e06007
Add JDBC_API_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 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
|
207 "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
|
208 "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
|
209 "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
|
210 "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
|
211 "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
|
212 "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
|
213 "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
|
214 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
216 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
|
217 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
|
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 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
|
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 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
|
222 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
|
223 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
|
224 } 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
|
225 // e.printStackTrace(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
226 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
|
227 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
|
228 // test calling conn.isValid() |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
229 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
|
230 // 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
|
231 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
|
232 } catch (SQLException e2) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
233 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
|
234 } |
0eef53e06007
Add JDBC_API_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 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
238 // 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
|
239 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
|
240 } 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
|
241 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
|
242 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
245 |
0eef53e06007
Add JDBC_API_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 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
|
247 "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
|
248 "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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
252 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
|
253 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
|
254 "-- 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
|
255 "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
|
256 "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
|
257 "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
|
258 "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
|
259 "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
|
260 "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
|
261 "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
|
262 "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
|
263 "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
|
264 "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
|
265 "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
|
266 |
0eef53e06007
Add JDBC_API_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 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
|
268 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
|
269 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
|
270 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
|
271 } |
0eef53e06007
Add JDBC_API_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 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
|
274 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
|
275 // >> 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
|
276 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
|
277 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
|
278 |
0eef53e06007
Add JDBC_API_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 // 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
|
280 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
|
281 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
|
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 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
|
284 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
|
285 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
|
286 } |
0eef53e06007
Add JDBC_API_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 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
|
288 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
|
289 } |
0eef53e06007
Add JDBC_API_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 if (i != size) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
291 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
|
292 } |
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
|
293 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
|
294 } 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
|
295 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
|
296 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
299 |
0eef53e06007
Add JDBC_API_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 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
|
301 "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
|
302 "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
|
303 "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
|
304 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
307 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
|
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 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
|
310 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
|
311 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
|
312 // 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
|
313 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
|
314 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
|
315 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
|
316 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
|
317 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
|
318 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
|
319 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
|
320 |
0eef53e06007
Add JDBC_API_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 // 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
|
322 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
|
323 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
|
324 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
|
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 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
|
327 |
0eef53e06007
Add JDBC_API_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 // 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
|
329 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
|
330 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
|
331 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
|
332 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
|
333 // 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
|
334 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
|
335 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
|
336 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
|
337 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
|
338 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
|
339 } |
0eef53e06007
Add JDBC_API_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 } catch (SQLException e) { |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
341 sb.append(" FAILED: ").append(e.getMessage()).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
|
342 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
345 "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
|
346 "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
|
347 "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
|
348 "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
|
349 "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
|
350 "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
|
351 "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
|
352 "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
|
353 "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
|
354 "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
|
355 "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
|
356 "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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
360 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
|
361 |
0eef53e06007
Add JDBC_API_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 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
|
363 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
|
364 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
|
365 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
|
366 // >> 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
|
367 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
|
368 |
0eef53e06007
Add JDBC_API_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 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
|
370 // 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
|
371 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
|
372 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
|
373 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
|
374 |
0eef53e06007
Add JDBC_API_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 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
|
376 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
|
377 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
|
378 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
|
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("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
|
381 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
|
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("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
|
385 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
|
386 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
|
387 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
|
388 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
|
389 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
|
390 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
|
391 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
|
392 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
393 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
|
394 } |
0eef53e06007
Add JDBC_API_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("\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
|
396 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
397 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
|
398 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
|
399 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
|
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("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
|
402 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
|
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("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
|
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("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
|
419 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
|
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 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
|
423 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
|
424 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
|
425 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
|
426 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
|
427 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
|
428 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
|
429 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
|
430 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
431 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
|
432 } |
0eef53e06007
Add JDBC_API_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 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
|
434 |
0eef53e06007
Add JDBC_API_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 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
|
436 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
|
437 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
|
438 |
0eef53e06007
Add JDBC_API_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 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
|
440 |
0eef53e06007
Add JDBC_API_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 // 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
|
442 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
|
443 } 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
|
444 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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
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 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
|
450 "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
|
451 "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
|
452 "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
|
453 "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
|
454 "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
|
455 "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
|
456 "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
|
457 "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
|
458 "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
|
459 "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
|
460 "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
|
461 } |
0eef53e06007
Add JDBC_API_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 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
|
464 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
|
465 |
0eef53e06007
Add JDBC_API_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 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
|
467 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
|
468 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
|
469 // >> 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
|
470 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
|
471 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
472 // 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
|
473 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
|
474 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
|
475 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
|
476 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
|
477 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
478 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
|
479 } |
0eef53e06007
Add JDBC_API_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 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
|
481 |
0eef53e06007
Add JDBC_API_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 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
|
483 // >> 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
|
484 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
|
485 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
486 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
|
487 /* 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
|
488 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
|
489 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
|
490 |
0eef53e06007
Add JDBC_API_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 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
|
492 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
|
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 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
|
495 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
|
496 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
|
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 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
|
499 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
|
500 int items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
501 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
|
502 while (rs.next()) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
503 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
|
504 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
|
505 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
507 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
|
508 } |
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
|
509 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
|
510 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
511 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
|
512 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
|
513 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
|
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("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
|
516 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
|
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("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
|
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("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
|
533 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
|
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 = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
539 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
|
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 } |
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
|
547 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
|
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 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
|
550 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
|
551 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
|
552 |
0eef53e06007
Add JDBC_API_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 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
|
554 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
|
555 items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
556 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
|
557 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
558 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
|
559 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
|
560 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
562 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
|
563 } |
0eef53e06007
Add JDBC_API_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 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
|
565 |
0eef53e06007
Add JDBC_API_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 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
|
567 |
0eef53e06007
Add JDBC_API_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 // 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
|
569 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
|
570 } 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
|
571 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
|
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 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
|
575 |
0eef53e06007
Add JDBC_API_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 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
|
577 "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
|
578 "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
|
579 "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
|
580 "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
|
581 "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
|
582 "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
|
583 "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
|
584 "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
|
585 "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
|
586 "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
|
587 "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
|
588 "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
|
589 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
592 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
|
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 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
|
595 // 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
|
596 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
|
597 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
|
598 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
|
599 } 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
|
600 // 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
|
601 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
|
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("\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
|
604 |
0eef53e06007
Add JDBC_API_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 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
|
606 // 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
|
607 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
|
608 // >> 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
|
609 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
|
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 // 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
|
612 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
|
613 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
|
614 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
|
615 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
616 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
|
617 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
|
618 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
|
619 |
0eef53e06007
Add JDBC_API_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 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
|
621 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
|
622 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
|
623 } 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
|
624 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
|
625 } |
0eef53e06007
Add JDBC_API_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 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
|
627 |
0eef53e06007
Add JDBC_API_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 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
|
629 try { |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
630 // turn on auto commit |
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
|
631 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
|
632 // >> 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
|
633 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
|
634 |
0eef53e06007
Add JDBC_API_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 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
|
636 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
|
637 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
|
638 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
|
639 |
0eef53e06007
Add JDBC_API_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("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
|
641 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
|
642 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
|
643 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
644 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
|
645 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
|
646 |
0eef53e06007
Add JDBC_API_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 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
|
648 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
|
649 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
|
650 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
651 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
|
652 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
|
653 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
|
654 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
655 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
|
656 } 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
|
657 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
|
658 } |
0eef53e06007
Add JDBC_API_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 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
|
660 |
0eef53e06007
Add JDBC_API_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 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
|
662 // 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
|
663 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
|
664 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
|
665 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
|
666 } 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
|
667 // 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
|
668 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
|
669 } |
0eef53e06007
Add JDBC_API_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 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
|
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 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
|
673 |
0eef53e06007
Add JDBC_API_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 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
|
675 "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
|
676 "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
|
677 "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
|
678 "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
|
679 "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
|
680 "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
|
681 "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
|
682 "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
|
683 "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
|
684 "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
|
685 "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
|
686 "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
|
687 "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
|
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 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
690 private void handleExecuteDDL(Statement stmt, String action, String objtype, String objname, String sql) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
691 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
692 int response = stmt.executeUpdate(sql); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
693 if (response != Statement.SUCCESS_NO_INFO) |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
694 sb.append(action).append(" ").append(objtype).append(" ").append(objname).append(" failed to return -2!! It returned: ").append(response).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
695 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
696 sb.append("Failed to ").append(action).append(" ").append(objtype).append(" ").append(objname).append(": ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
697 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
698 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
699 |
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
|
700 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
|
701 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
|
702 |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
703 Statement stmt = null; |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
704 try { |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
705 stmt = con.createStatement(); |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
706 } catch (SQLException e) { |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
707 sb.append("failed to createStatement: ").append(e.getMessage()).append("\n"); |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
708 } |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
709 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
710 String action = "Create"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
711 final String objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
712 handleExecuteDDL(stmt, action, objtype, "nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
713 "CREATE TABLE nopk_twoucs (id INT NOT NULL UNIQUE, name VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
714 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
715 handleExecuteDDL(stmt, action, objtype, "tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
716 "CREATE LOCAL TEMP TABLE tmp_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
717 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
718 handleExecuteDDL(stmt, action, objtype, "tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
719 "CREATE LOCAL TEMP TABLE tmp_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
720 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
721 handleExecuteDDL(stmt, action, objtype, "glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
722 "CREATE GLOBAL TEMP TABLE glbl_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
723 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
724 handleExecuteDDL(stmt, action, objtype, "glbl_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
725 "CREATE GLOBAL TEMP TABLE glbl_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
726 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
727 handleExecuteDDL(stmt, action, "type", "xml", "CREATE TYPE xml EXTERNAL NAME xml"); |
642
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
728 |
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
729 try { |
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
|
730 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
|
731 |
0eef53e06007
Add JDBC_API_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 // 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
|
733 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
|
734 "Resultset with 1 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
735 "TABLE_CAT\n" + |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
736 "char(1)\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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
738 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
|
739 "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
|
740 "TABLE_SCHEM TABLE_CATALOG\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
741 "varchar(1024) char(1)\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
|
742 "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
|
743 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
744 compareResultSet(dbmd.getTables(null, "tmp", null, null), "getTables(null, tmp, null, null)", // schema tmp has 6 system tables and 4 temporary test tables |
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
|
745 "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
|
746 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
747 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
748 "null tmp glbl_nopk_twoucs GLOBAL TEMPORARY TABLE null null null null null null\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
749 "null tmp glbl_pk_uc GLOBAL TEMPORARY TABLE null null null null null null\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
750 "null tmp tmp_nopk_twoucs LOCAL TEMPORARY TABLE null null null null null null\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
751 "null tmp tmp_pk_uc LOCAL TEMPORARY TABLE null null null null null null\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
|
752 "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
|
753 "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
|
754 "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
|
755 "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
|
756 "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
|
757 "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
|
758 |
0eef53e06007
Add JDBC_API_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 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
|
760 "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
|
761 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
762 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\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
|
763 "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
|
764 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
765 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
|
766 "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
|
767 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
768 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int int int varchar(3) char(1) char(1) char(1) smallint char(3) varchar(3)\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
|
769 "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
|
770 "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
|
771 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
772 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
|
773 "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
|
774 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
775 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\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
|
776 "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
|
777 |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
778 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "tmp_pk_uc"), "getPrimaryKeys(null, tmp, tmp_pk_uc)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
779 "Resultset with 6 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
780 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
781 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
782 "null tmp tmp_pk_uc id1 1 tmp_pk_uc_id1_pkey\n"); |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
783 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
784 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "glbl_pk_uc"), "getPrimaryKeys(null, tmp, glbl_pk_uc)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
785 "Resultset with 6 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
786 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
787 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
788 "null tmp glbl_pk_uc id1 1 glbl_pk_uc_id1_pkey\n"); |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
789 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
790 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
|
791 "Resultset with 14 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
792 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
793 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\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
|
794 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
795 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
|
796 "Resultset with 14 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
797 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
798 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
799 |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
800 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
|
801 "Resultset with 14 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
802 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
803 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\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
|
804 |
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
|
805 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
|
806 "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
|
807 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
808 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\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
|
809 "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
|
810 "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
|
811 |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
812 compareResultSet(dbmd.getIndexInfo(null, "tmp", "tmp_pk_uc", false, false), "getIndexInfo(null, tmp, tmp_pk_uc, false, false)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
813 "Resultset with 13 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
814 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
815 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
816 "null tmp tmp_pk_uc false null tmp_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
817 "null tmp tmp_pk_uc false null tmp_pk_uc_name1_unique 2 1 name1 null 0 0 null\n"); |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
818 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
819 compareResultSet(dbmd.getIndexInfo(null, "tmp", "glbl_pk_uc", false, false), "getIndexInfo(null, tmp, glbl_pk_uc, false, false)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
820 "Resultset with 13 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
821 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
822 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
823 "null tmp glbl_pk_uc false null glbl_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
824 "null tmp glbl_pk_uc false null glbl_pk_uc_name1_unique 2 1 name1 null 0 0 null\n"); |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
825 |
619
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
826 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
827 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
828 "Resultset with 8 columns\n" + |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
829 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
830 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
619
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
831 "2 language_id 5 smallint 16 0 0 1\n"); |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
832 |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
833 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
834 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
835 "Resultset with 8 columns\n" + |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
836 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
837 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
652
6a34d2c36dec
Improved and optimized DatabaseMetaData.getBestRowIdentifier().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
651
diff
changeset
|
838 "2 id 4 int 32 0 0 1\n"); |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
839 |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
840 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
841 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
842 "Resultset with 8 columns\n" + |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
843 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
844 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
845 "2 id 4 int 32 0 0 1\n"); |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
846 |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
847 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
848 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
849 "Resultset with 8 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
850 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
851 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
852 "2 id1 4 int 32 0 0 1\n"); |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
853 |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
854 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
855 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
856 "Resultset with 8 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
857 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
858 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
652
6a34d2c36dec
Improved and optimized DatabaseMetaData.getBestRowIdentifier().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
651
diff
changeset
|
859 "2 id2 4 int 32 0 0 1\n"); |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
860 |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
861 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
862 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
863 "Resultset with 8 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
864 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
865 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
866 "2 id2 4 int 32 0 0 1\n"); |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
867 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
868 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
869 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
870 "Resultset with 8 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
871 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
872 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
873 "2 id1 4 int 32 0 0 1\n"); |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
874 |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
875 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
876 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
877 "Resultset with 8 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
878 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
879 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
652
6a34d2c36dec
Improved and optimized DatabaseMetaData.getBestRowIdentifier().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
651
diff
changeset
|
880 "2 id2 4 int 32 0 0 1\n"); |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
881 |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
882 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
883 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
884 "Resultset with 8 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
885 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
886 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
887 "2 id2 4 int 32 0 0 1\n"); |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
888 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
889 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
|
890 "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
|
891 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
892 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\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
|
893 "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
|
894 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
895 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
|
896 "Resultset with 8 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
897 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
898 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\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
|
899 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
900 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
|
901 "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
|
902 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
903 "char(1) varchar(1024) varchar(1024) char(27) int varchar(256) smallint\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
|
904 "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
|
905 "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
|
906 "null sys url org.monetdb.jdbc.types.URL 2000 url null\n" + |
642
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
907 "null sys uuid java.lang.String 2000 uuid null\n" + |
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
908 "null sys xml java.lang.String 2000 xml 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
|
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 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
|
911 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
|
912 "Resultset with 7 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
913 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
914 "char(1) varchar(1024) varchar(1024) char(27) int varchar(256) smallint\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
|
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 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
|
917 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
918 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
|
919 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
|
920 } |
0eef53e06007
Add JDBC_API_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 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
922 // cleanup created db objects |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
923 action = "Drop"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
924 handleExecuteDDL(stmt, action, objtype, "nopk_twoucs", "DROP TABLE nopk_twoucs"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
925 handleExecuteDDL(stmt, action, objtype, "tmp_nopk_twoucs", "DROP TABLE tmp_nopk_twoucs"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
926 handleExecuteDDL(stmt, action, objtype, "tmp_pk_uc", "DROP TABLE tmp_pk_uc"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
927 handleExecuteDDL(stmt, action, objtype, "glbl_nopk_twoucs", "DROP TABLE glbl_nopk_twoucs"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
928 handleExecuteDDL(stmt, action, objtype, "glbl_pk_uc", "DROP TABLE glbl_pk_uc"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
929 handleExecuteDDL(stmt, action, "type", "xml", "DROP TYPE xml"); |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
930 |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
931 closeStmtResSet(stmt, null); |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
932 |
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
|
933 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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
937 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
|
938 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
939 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
|
940 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
|
941 sb.append("Resultset with ").append(columnCount).append(" columns\n"); |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
942 // print result column header names |
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 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
|
944 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
|
945 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
|
946 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
|
947 } |
0eef53e06007
Add JDBC_API_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 sb.append("\n"); |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
949 // print result column data type info |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
950 for (int col = 1; col <= columnCount; col++) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
951 if (col > 1) |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
952 sb.append("\t"); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
953 sb.append(rsmd.getColumnTypeName(col)); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
954 switch (rsmd.getColumnType(col)) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
955 case Types.CHAR: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
956 case Types.VARCHAR: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
957 case Types.CLOB: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
958 case Types.BLOB: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
959 case Types.DECIMAL: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
960 case Types.NUMERIC: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
961 { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
962 int prec = rsmd.getPrecision(col); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
963 if (prec != 0) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
964 sb.append('(').append(prec); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
965 int scale = rsmd.getScale(col); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
966 if (scale != 0) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
967 sb.append(',').append(scale); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
968 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
969 sb.append(')'); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
970 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
971 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
972 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
973 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
974 sb.append("\n"); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
975 |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
976 // print result rows data |
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 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
|
978 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
|
979 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
|
980 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
|
981 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
|
982 } |
0eef53e06007
Add JDBC_API_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 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
|
984 } |
0eef53e06007
Add JDBC_API_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 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
|
986 |
0eef53e06007
Add JDBC_API_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 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
|
988 } |
0eef53e06007
Add JDBC_API_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 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
990 // same tests as done in clients/odbc/tests/ODBCmetadata.c |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
991 private void Test_DBCmetadata() { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
992 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
993 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
994 Statement stmt = null; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
995 DatabaseMetaData dbmd = null; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
996 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
997 stmt = con.createStatement(); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
998 dbmd = con.getMetaData(); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
999 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1000 sb.append("Failed to createStatement: ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1001 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1002 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1003 String action = "Create"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1004 handleExecuteDDL(stmt, action, "schema", "jdbctst", "CREATE SCHEMA jdbctst; SET SCHEMA jdbctst;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1005 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1006 String objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1007 // create tables to populate data dictionary. Used for testing getTables(), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1008 // getColumns(), getBestRowIdentifier(), getPrimaryKeys(), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1009 // getExportedKeys(), getImportedKeys(), getCrossReference() |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1010 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1011 "CREATE TABLE jdbctst.pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1012 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1013 "CREATE LOCAL TEMP TABLE tmp.tmp_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1014 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1015 "CREATE GLOBAL TEMP TABLE tmp.glbl_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1016 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1017 "CREATE TABLE jdbctst.nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1018 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1019 "CREATE LOCAL TEMP TABLE tmp.tmp_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1020 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1021 "CREATE GLOBAL TEMP TABLE tmp.glbl_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1022 /* next 3 tables copied from example in https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlforeignkeys-function?view=sql-server-ver15 */ |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1023 handleExecuteDDL(stmt, action, objtype, "\"CUSTOMERS\"", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1024 "CREATE TABLE \"CUSTOMERS\" (\"CUSTID\" INT PRIMARY KEY, \"NAME\" VARCHAR(60) NOT NULL, \"ADDRESS\" VARCHAR(90), \"PHONE\" VARCHAR(20));"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1025 handleExecuteDDL(stmt, action, objtype, "\"ORDERS\"", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1026 "CREATE TABLE \"ORDERS\" (\"ORDERID\" INT PRIMARY KEY, \"CUSTID\" INT NOT NULL REFERENCES \"CUSTOMERS\" (\"CUSTID\")" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1027 ", \"OPENDATE\" DATE NOT NULL, \"SALESPERSON\" VARCHAR(60), \"STATUS\" VARCHAR(10) NOT NULL);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1028 handleExecuteDDL(stmt, action, objtype, "\"LINES\"", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1029 "CREATE TABLE \"LINES\" (\"ORDERID\" INT NOT NULL REFERENCES \"ORDERS\" (\"ORDERID\"), \"LINES\" INT" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1030 ", PRIMARY KEY (\"ORDERID\", \"LINES\"), \"PARTID\" INT NOT NULL, \"QUANTITY\" DECIMAL(9,3) NOT NULL);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1031 /* also test situation where one table has multiple fks to the same multi column pk */ |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1032 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk2c", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1033 "CREATE TABLE jdbctst.pk2c (pkc1 INT, pkc2 VARCHAR(99), name1 VARCHAR(99) UNIQUE, PRIMARY KEY (pkc2, pkc1));"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1034 handleExecuteDDL(stmt, action, objtype, "jdbctst.fk2c", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1035 "CREATE TABLE jdbctst.fk2c (fkc1 INT NOT NULL PRIMARY KEY, fkc2 VARCHAR(99), fkc3 INT" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1036 ", FOREIGN KEY (fkc2, fkc1) REFERENCES jdbctst.pk2c (pkc2, pkc1) ON UPDATE CASCADE ON DELETE RESTRICT" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1037 ", FOREIGN KEY (fkc2, fkc3) REFERENCES jdbctst.pk2c (pkc2, pkc1) ON UPDATE SET NULL ON DELETE NO ACTION);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1038 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1039 // create indexes to populate catalog. Used for testing getIndexInfo() |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1040 objtype = "index"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1041 handleExecuteDDL(stmt, action, objtype, "pk_uc_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1042 "CREATE INDEX pk_uc_i ON jdbctst.pk_uc (id1, name1);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1043 handleExecuteDDL(stmt, action, objtype, "tmp_pk_uc_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1044 "CREATE INDEX tmp_pk_uc_i ON tmp.tmp_pk_uc (id1, name1);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1045 handleExecuteDDL(stmt, action, objtype, "glbl_pk_uc_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1046 "CREATE INDEX glbl_pk_uc_i ON tmp.glbl_pk_uc (id1, name1);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1047 handleExecuteDDL(stmt, action, objtype, "nopk_twoucs_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1048 "CREATE INDEX nopk_twoucs_i ON jdbctst.nopk_twoucs (id2, name2);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1049 handleExecuteDDL(stmt, action, objtype, "tmp_nopk_twoucs_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1050 "CREATE INDEX tmp_nopk_twoucs_i ON tmp.tmp_nopk_twoucs (id2, name2);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1051 handleExecuteDDL(stmt, action, objtype, "glbl_nopk_twoucs_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1052 "CREATE INDEX glbl_nopk_twoucs_i ON tmp.glbl_nopk_twoucs (id2, name2);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1053 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1054 // grant privileges to populate catalog. Used for testing getTablePrivileges() and getColumnPrivileges() |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1055 action = "grant"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1056 objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1057 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1058 "GRANT SELECT ON TABLE jdbctst.pk_uc TO PUBLIC;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1059 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1060 "GRANT INSERT, UPDATE, DELETE ON TABLE jdbctst.pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1061 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1062 "GRANT SELECT (id2, name2), UPDATE (name2) ON TABLE jdbctst.nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1063 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1064 "GRANT INSERT, DELETE ON TABLE tmp.tmp_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1065 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1066 "GRANT SELECT (id1, name1), UPDATE (name1) ON TABLE tmp.tmp_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1067 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc ", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1068 "GRANT INSERT, DELETE ON TABLE tmp.tmp_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1069 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1070 "GRANT SELECT (id1, name1), UPDATE (name1) ON TABLE tmp.glbl_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1071 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1072 "GRANT INSERT, DELETE ON TABLE tmp.tmp_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1073 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1074 "GRANT SELECT (id2, name2), UPDATE (name2) ON TABLE tmp.tmp_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1075 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1076 "GRANT DELETE, INSERT ON TABLE tmp.glbl_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1077 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1078 "GRANT SELECT (id2, name2), UPDATE (name2) ON TABLE tmp.glbl_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1079 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1080 // TODO add user procedures / functions to test getProcedures() and getProcedureColumns() more |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1081 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1082 // set COMMENT ON schema, tables, columns, indexes, procedures and functions to fetch (and test) data in the REMARKS result column |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1083 action = "comment on"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1084 handleExecuteDDL(stmt, action, "schema", "jdbctst", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1085 "COMMENT ON SCHEMA jdbctst IS 'jdbctst schema comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1086 objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1087 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1088 "COMMENT ON TABLE jdbctst.pk_uc IS 'jdbctst.pk_uc table comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1089 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1090 "COMMENT ON TABLE jdbctst.nopk_twoucs IS 'jdbctst.nopk_twoucs table comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1091 objtype = "column"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1092 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs.id2", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1093 "COMMENT ON COLUMN jdbctst.nopk_twoucs.id2 IS 'jdbctst.nopk_twoucs.id2 column comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1094 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs.name2", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1095 "COMMENT ON COLUMN jdbctst.nopk_twoucs.name2 IS 'jdbctst.nopk_twoucs.name2 column comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1096 objtype = "index"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1097 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1098 "COMMENT ON INDEX jdbctst.pk_uc_i IS 'jdbctst.pk_uc_i index comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1099 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1100 "COMMENT ON INDEX jdbctst.nopk_twoucs_i IS 'jdbctst.nopk_twoucs_i index comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1101 objtype = "procedure"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1102 handleExecuteDDL(stmt, action, objtype, "sys.analyze()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1103 "COMMENT ON PROCEDURE sys.analyze() IS 'sys.analyze() procedure comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1104 objtype = "function"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1105 handleExecuteDDL(stmt, action, objtype, "sys.sin(double)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1106 "COMMENT ON FUNCTION sys.sin(double) IS 'sys.sin(double) function comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1107 handleExecuteDDL(stmt, action, objtype, "sys.env()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1108 "COMMENT ON FUNCTION sys.env() IS 'sys.env() function comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1109 handleExecuteDDL(stmt, action, objtype, "sys.statistics()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1110 "COMMENT ON FUNCTION sys.statistics() IS 'sys.statistics() function comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1111 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1112 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1113 // query the catalog by calling DatabaseMetaData methods |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1114 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1115 "Resultset with 1 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1116 "TABLE_CAT\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1117 "char(1)\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1118 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1119 compareResultSet(dbmd.getSchemas(null, "jdbctst"), "getSchemas(null, jdbctst)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1120 "Resultset with 2 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1121 "TABLE_SCHEM TABLE_CATALOG\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1122 "varchar(1024) char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1123 "jdbctst null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1124 |
680
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1125 compareResultSet(dbmd.getSchemas(null, ""), "getSchemas(null, emptystring)", |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1126 "Resultset with 2 columns\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1127 "TABLE_SCHEM TABLE_CATALOG\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1128 "varchar(1024) char(1)\n"); |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1129 |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1130 compareResultSet(dbmd.getSchemas("%", "%%"), "getSchemas(%, %%)", |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1131 "Resultset with 2 columns\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1132 "TABLE_SCHEM TABLE_CATALOG\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1133 "varchar(1024) char(1)\n"); |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1134 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1135 compareResultSet(dbmd.getTables(null, "jdbctst", null, null), "getTables(null, jdbctst, null, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1136 "Resultset with 10 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1137 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1138 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1139 "null jdbctst CUSTOMERS TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1140 "null jdbctst LINES TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1141 "null jdbctst ORDERS TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1142 "null jdbctst fk2c TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1143 "null jdbctst nopk_twoucs TABLE jdbctst.nopk_twoucs table comment null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1144 "null jdbctst pk2c TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1145 "null jdbctst pk_uc TABLE jdbctst.pk_uc table comment null null null null null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1146 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1147 compareResultSet(dbmd.getTables(null, "jdbctst", "schemas", null), "getTables(null, jdbctst, schemas, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1148 "Resultset with 10 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1149 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1150 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1151 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1152 compareResultSet(dbmd.getColumns(null, "jdbctst", "pk\\_uc", null), "getColumns(null, jdbctst, pk\\_uc, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1153 "Resultset with 24 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1154 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1155 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int int int varchar(3) char(1) char(1) char(1) smallint char(3) varchar(3)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1156 "null jdbctst pk_uc id1 4 int 32 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1157 "null jdbctst pk_uc name1 12 varchar 99 0 0 0 1 null null 0 0 99 2 YES null null null null NO NO\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1158 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1159 compareResultSet(dbmd.getPrimaryKeys(null, "jdbctst", "pk\\_uc"), "getPrimaryKeys(null, jdbctst, pk\\_uc)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1160 "Resultset with 6 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1161 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1162 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1163 "null jdbctst pk_uc id1 1 pk_uc_id1_pkey\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1164 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1165 /* MvD: hier verder */ |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1166 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "tmp_pk_uc"), "getPrimaryKeys(null, tmp, tmp_pk_uc)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1167 "Resultset with 6 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1168 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1169 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1170 "null tmp tmp_pk_uc id1 1 tmp_pk_uc_id1_pkey\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1171 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1172 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "glbl_pk_uc"), "getPrimaryKeys(null, tmp, glbl_pk_uc)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1173 "Resultset with 6 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1174 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1175 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1176 "null tmp glbl_pk_uc id1 1 glbl_pk_uc_id1_pkey\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1177 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1178 compareResultSet(dbmd.getExportedKeys(null, "sys", "table\\_types"), "getExportedKeys(null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1179 "Resultset with 14 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1180 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1181 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1182 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1183 compareResultSet(dbmd.getCrossReference(null, "sys", "tables", null, "sys", "table\\_types"), "getCrossReference(null, sys, tables, null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1184 "Resultset with 14 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1185 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1186 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1187 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1188 compareResultSet(dbmd.getImportedKeys(null, "sys", "table\\_types"), "getImportedKeys(null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1189 "Resultset with 14 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1190 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1191 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1192 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1193 compareResultSet(dbmd.getIndexInfo(null, "sys", "key_types", false, false), "getIndexInfo(null, sys, key_types, false, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1194 "Resultset with 13 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1195 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1196 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1197 "null sys key_types false null key_types_key_type_id_pkey 2 1 key_type_id null 3 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1198 "null sys key_types false null key_types_key_type_name_unique 2 1 key_type_name null 3 0 null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1199 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1200 compareResultSet(dbmd.getIndexInfo(null, "tmp", "tmp_pk_uc", false, false), "getIndexInfo(null, tmp, tmp_pk_uc, false, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1201 "Resultset with 13 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1202 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1203 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1204 "null tmp tmp_pk_uc false null tmp_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1205 "null tmp tmp_pk_uc false null tmp_pk_uc_name1_unique 2 1 name1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1206 "null tmp tmp_pk_uc true null tmp_pk_uc_i 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1207 "null tmp tmp_pk_uc true null tmp_pk_uc_i 2 2 name1 null 0 0 null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1208 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1209 compareResultSet(dbmd.getIndexInfo(null, "tmp", "glbl_pk_uc", false, false), "getIndexInfo(null, tmp, glbl_pk_uc, false, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1210 "Resultset with 13 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1211 "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" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1212 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1213 "null tmp glbl_pk_uc false null glbl_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1214 "null tmp glbl_pk_uc false null glbl_pk_uc_name1_unique 2 1 name1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1215 "null tmp glbl_pk_uc true null glbl_pk_uc_i 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1216 "null tmp glbl_pk_uc true null glbl_pk_uc_i 2 2 name1 null 0 0 null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1217 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1218 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1219 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1220 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1221 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1222 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1223 "2 language_id 5 smallint 16 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1224 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1225 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1226 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1227 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1228 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1229 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1230 "2 id2 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1231 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1232 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1233 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1234 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1235 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1236 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1237 "2 id2 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1238 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1239 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1240 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1241 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1242 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1243 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1244 "2 id1 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1245 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1246 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1247 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1248 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1249 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1250 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1251 "2 id2 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1252 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1253 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1254 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1255 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1256 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1257 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1258 "2 id2 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1259 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1260 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1261 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1262 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1263 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1264 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1265 "2 id1 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1266 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1267 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1268 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1269 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1270 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1271 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1272 "2 id2 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1273 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1274 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1275 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1276 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1277 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1278 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1279 "2 id2 4 int 32 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1280 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1281 // also test a table without pk or uc, it should return a row for each column |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1282 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "schemas", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1283 "getBestRowIdentifier(null, sys, schemas, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1284 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1285 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1286 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1287 "2 id 4 int 32 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1288 "2 name 12 varchar 1024 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1289 "2 authorization 4 int 32 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1290 "2 owner 4 int 32 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1291 "2 system 16 boolean 1 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1292 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1293 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "_tables", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1294 "getBestRowIdentifier(null, sys, _tables, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1295 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1296 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1297 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1298 "2 id 4 int 32 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1299 "2 name 12 varchar 1024 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1300 "2 schema_id 4 int 32 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1301 "2 query 12 varchar 1048576 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1302 "2 type 5 smallint 16 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1303 "2 system 16 boolean 1 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1304 "2 commit_action 5 smallint 16 0 0 1\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1305 "2 access 5 smallint 16 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1306 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1307 // also test a view (without pk or uc of course), it should return no rows |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1308 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "tables", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1309 "getBestRowIdentifier(null, sys, tables, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1310 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1311 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1312 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1313 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1314 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "table\\_types", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1315 "getBestRowIdentifier(null, sys, table\\_types, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1316 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1317 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1318 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1319 "2 table_type_id 5 smallint 16 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1320 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1321 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1322 "Resultset with 7 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1323 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1324 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1325 "null sys table_types monetdb public SELECT NO\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1326 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1327 compareResultSet(dbmd.getColumnPrivileges(null, "sys", "table\\_types", null), "getColumnPrivileges(null, sys, table\\_types, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1328 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1329 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1330 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1331 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1332 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1333 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1334 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1335 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1336 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1337 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1338 // cleanup created db objects |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1339 action = "Drop"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1340 objtype = "index"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1341 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc_i", "DROP INDEX jdbctst.pk_uc_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1342 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc_i;", "DROP INDEX tmp.tmp_pk_uc_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1343 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc_i", "DROP INDEX tmp.glbl_pk_uc_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1344 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs_i", "DROP INDEX jdbctst.nopk_twoucs_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1345 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs_i", "DROP INDEX tmp.tmp_nopk_twoucs_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1346 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs_i", "DROP INDEX tmp.glbl_nopk_twoucs_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1347 objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1348 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", "DROP TABLE jdbctst.pk_uc;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1349 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", "DROP TABLE tmp.tmp_pk_uc;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1350 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc", "DROP TABLE tmp.glbl_pk_uc;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1351 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", "DROP TABLE jdbctst.nopk_twoucs;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1352 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", "DROP TABLE tmp.tmp_nopk_twoucs;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1353 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", "DROP TABLE tmp.glbl_nopk_twoucs;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1354 handleExecuteDDL(stmt, action, objtype, "jdbctst.\"LINES\"", "DROP TABLE jdbctst.\"LINES\";"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1355 handleExecuteDDL(stmt, action, objtype, "jdbctst.\"ORDERS\"", "DROP TABLE jdbctst.\"ORDERS\";"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1356 handleExecuteDDL(stmt, action, objtype, "jdbctst.\"CUSTOMERS\"", "DROP TABLE jdbctst.\"CUSTOMERS\";"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1357 handleExecuteDDL(stmt, action, objtype, "jdbctst.fk2c", "DROP TABLE jdbctst.fk2c;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1358 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk2c", "DROP TABLE jdbctst.pk2c;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1359 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1360 // All tables in schema jdbctst should now be gone, else we missed some DROP statements |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1361 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1362 compareResultSet(dbmd.getTables(null, "jdbctst", "%%", null), "getTables(null, jdbctst, '%%', null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1363 "Resultset with 10 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1364 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1365 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1366 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1367 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1368 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1369 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1370 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1371 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1372 handleExecuteDDL(stmt, action, "schema", "jdbctst", "SET SCHEMA sys; DROP SCHEMA jdbctst;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1373 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1374 closeStmtResSet(stmt, null); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1375 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1376 compareExpectedOutput("Test_Dmetadata", ""); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1377 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1378 |
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
|
1379 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
|
1380 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
|
1381 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1382 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
|
1383 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
|
1384 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
|
1385 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
|
1386 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
|
1387 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1388 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
|
1389 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
|
1390 |
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
|
1391 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
|
1392 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
|
1393 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1394 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
|
1395 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
|
1396 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1397 } 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
|
1398 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
|
1399 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1400 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1401 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
|
1402 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1403 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
|
1404 "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
|
1405 "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
|
1406 "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
|
1407 "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
|
1408 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1409 |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1410 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
|
1411 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
|
1412 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1413 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
|
1414 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
|
1415 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1416 // 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
|
1417 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
|
1418 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1419 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
|
1420 // 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
|
1421 rs = stmt.executeQuery("SELECT sqlname from sys.types where sqlname = 'hugeint';"); |
478
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1422 if (rs != null) { |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1423 if (rs.next()) { |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1424 if ("hugeint".equals(rs.getString(1))) |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1425 supportsHugeInt = true; |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1426 } |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1427 rs.close(); |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1428 rs = null; |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1429 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1430 } 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
|
1431 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
|
1432 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1433 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1434 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
|
1435 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
|
1436 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
|
1437 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
|
1438 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1439 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1440 // 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
|
1441 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
|
1442 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1443 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
|
1444 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
|
1445 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1446 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
|
1447 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
|
1448 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1449 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
|
1450 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
|
1451 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
|
1452 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
|
1453 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1454 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
|
1455 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1456 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
|
1457 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
|
1458 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
|
1459 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
|
1460 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
|
1461 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
|
1462 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
|
1463 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1464 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1465 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
|
1466 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
|
1467 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
|
1468 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
|
1469 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
|
1470 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
|
1471 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
|
1472 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1473 } 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
|
1474 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
|
1475 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1476 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1477 // cleanup |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1478 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1479 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
|
1480 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
|
1481 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
|
1482 } 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
|
1483 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
|
1484 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1485 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
|
1486 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
|
1487 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1488 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
|
1489 "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
|
1490 "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
|
1491 "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
|
1492 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1493 |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1494 private void Test_Interval_Types() { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1495 sb.setLength(0); // clear the output log buffer |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1496 |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1497 Statement stmt = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1498 ResultSet rs = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1499 PreparedStatement pstmt = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1500 try { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1501 stmt = con.createStatement(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1502 stmt.executeUpdate("create table Test_Interval_Types (c1 interval day, c2 interval month, c3 interval second)"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1503 rs = stmt.executeQuery("select * from Test_Interval_Types"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1504 if (rs != null) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1505 sb.append("Showing query ResultSetMetaData\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1506 ResultSetMetaData rsmd = rs.getMetaData(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1507 int colCount = rsmd.getColumnCount(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1508 for (int col = 1; col <= colCount; col++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1509 sb.append("ColumnName: ").append(rsmd.getColumnName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1510 .append("\tColumnTypeName: ").append(rsmd.getColumnTypeName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1511 .append("\tPrecision: ").append(rsmd.getPrecision(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1512 .append("\tScale: ").append(rsmd.getScale(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1513 .append("\tColumnDisplaySize: ").append(rsmd.getColumnDisplaySize(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1514 .append("\tColumnType: ").append(rsmd.getColumnType(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1515 .append("\tColumnClassName: ").append(rsmd.getColumnClassName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1516 .append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1517 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1518 rs.close(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1519 rs = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1520 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1521 pstmt = con.prepareStatement("select * from Test_Interval_Types where c1 = ? or c2 = ? or c3 = ?"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1522 if (pstmt != null) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1523 sb.append("Showing prepared query ResultSetMetaData\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1524 ResultSetMetaData rsmd = pstmt.getMetaData(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1525 int colCount = rsmd.getColumnCount(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1526 for (int col = 1; col <= colCount; col++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1527 sb.append("ColumnName: ").append(rsmd.getColumnName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1528 .append("\tColumnTypeName: ").append(rsmd.getColumnTypeName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1529 .append("\tPrecision: ").append(rsmd.getPrecision(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1530 .append("\tScale: ").append(rsmd.getScale(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1531 .append("\tColumnDisplaySize: ").append(rsmd.getColumnDisplaySize(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1532 .append("\tColumnType: ").append(rsmd.getColumnType(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1533 .append("\tColumnClassName: ").append(rsmd.getColumnClassName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1534 .append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1535 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1536 sb.append("Showing prepared query ParameterMetaData\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1537 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1538 int paramCount = pmd.getParameterCount(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1539 for (int param = 1; param <= paramCount; param++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1540 sb.append("ParameterTypeName: ").append(pmd.getParameterTypeName(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1541 .append("\tPrecision: ").append(pmd.getPrecision(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1542 .append("\tScale: ").append(pmd.getScale(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1543 .append("\tParameterType: ").append(pmd.getParameterType(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1544 .append("\tParameterClassName: ").append(pmd.getParameterClassName(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1545 .append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1546 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1547 pstmt.close(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1548 pstmt = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1549 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1550 stmt.executeUpdate("drop table Test_Interval_Types"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1551 } catch (SQLException e) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1552 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1553 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1554 closeStmtResSet(pstmt, null); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1555 closeStmtResSet(stmt, rs); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1556 |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1557 compareExpectedOutput("Test_Interval_Types", |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1558 "Showing query ResultSetMetaData\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1559 "ColumnName: c1 ColumnTypeName: interval day Precision: 4 Scale: 0 ColumnDisplaySize: 5 ColumnType: 2 ColumnClassName: java.math.BigDecimal\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1560 "ColumnName: c2 ColumnTypeName: interval month Precision: 10 Scale: 0 ColumnDisplaySize: 1 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1561 "ColumnName: c3 ColumnTypeName: interval second Precision: 13 Scale: 3 ColumnDisplaySize: 5 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1562 "Showing prepared query ResultSetMetaData\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1563 "ColumnName: c1 ColumnTypeName: interval day Precision: 4 Scale: 0 ColumnDisplaySize: 4 ColumnType: 2 ColumnClassName: java.math.BigDecimal\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1564 "ColumnName: c2 ColumnTypeName: interval month Precision: 10 Scale: 0 ColumnDisplaySize: 10 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1565 "ColumnName: c3 ColumnTypeName: interval second Precision: 13 Scale: 0 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1566 "Showing prepared query ParameterMetaData\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1567 "ParameterTypeName: interval day Precision: 4 Scale: 0 ParameterType: 2 ParameterClassName: java.math.BigDecimal\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1568 "ParameterTypeName: interval month Precision: 10 Scale: 0 ParameterType: 4 ParameterClassName: java.lang.Integer\n" + |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1569 "ParameterTypeName: interval second Precision: 13 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1570 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1571 |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1572 private void Test_PlanExplainTraceDebugCmds() { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1573 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1574 |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1575 Statement stmt = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1576 ResultSet rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1577 try { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1578 stmt = con.createStatement(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1579 String qry = "SELECT 1;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1580 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1581 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1582 sb.append(rs.getString(1)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1583 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1584 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1585 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1586 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, "1\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1587 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1588 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
1589 // plan statements are supported via JDBC |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1590 qry = "plan SELECT 2;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1591 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1592 compareResultSet(rs, qry, |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1593 "Resultset with 1 columns\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1594 "rel\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1595 "clob(37)\n" + |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1596 "project (\n" + |
641
fac0ed642af2
Approved output of new label
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
635
diff
changeset
|
1597 "| [ boolean(1) \"true\" as \"%1\".\"%1\" ]\n" + |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1598 ") [ tinyint(2) \"2\" ]\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1599 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1600 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1601 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1602 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
1603 // explain statements are supported via JDBC |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1604 qry = "explain SELECT 3;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1605 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1606 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1607 String val = rs.getString(1); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1608 if (!val.startsWith("#")) |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1609 sb.append(val).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1610 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1611 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1612 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1613 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1614 "function user.main():void;\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1615 " X_1:void := querylog.define(\"explain select 3;\":str, \"default_pipe\":str, 6:int);\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1616 " X_10:int := sql.resultSet(\".%2\":str, \"%2\":str, \"tinyint\":str, 2:int, 0:int, 7:int, 3:bte);\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1617 "end user.main;\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1618 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1619 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
1620 // trace statements are supported via JDBC. Note that it returns two resultsets, one with the query result and next one with the trace result. |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1621 qry = "trace SELECT 4;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1622 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1623 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1624 sb.append(rs.getString(1)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1625 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1626 if (stmt.getMoreResults()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1627 sb.append("Another resultset\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1628 rs = stmt.getResultSet(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1629 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1630 sb.append(rs.getString(2)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1631 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1632 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1633 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1634 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1635 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1636 "4\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1637 "Another resultset\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1638 " X_1=0@0:void := querylog.define(\"trace select 4;\":str, \"default_pipe\":str, 6:int);\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1639 " X_10=0:int := sql.resultSet(\".%2\":str, \"%2\":str, \"tinyint\":str, 3:int, 0:int, 7:int, 4:bte);\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1640 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1641 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
1642 // debug statements are NOT supported via JDBC driver, so the execution should throw an SQLException |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1643 qry = "debug SELECT 5;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1644 sb.append(qry).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1645 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1646 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1647 sb.append(rs.getString(1)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1648 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1649 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1650 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1651 compareExpectedOutput("Test_PlanExplainTraceDebugCmds", qry + "\n" + "5\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1652 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1653 } catch (SQLException e) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1654 sb.append("FAILED: "); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1655 while (e != null) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1656 sb.append(e.getMessage()).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1657 e = e.getNextException(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1658 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1659 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1660 |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1661 closeStmtResSet(stmt, rs); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1662 |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1663 compareExpectedOutput("Test_PlanExplainTraceDebugCmds", |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1664 "debug SELECT 5;\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1665 "FAILED: SQL debugging only supported in interactive mode in: \"debug\"\n" + |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1666 "Current transaction is aborted (please ROLLBACK)\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1667 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1668 |
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
|
1669 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
|
1670 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
|
1671 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1672 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
|
1673 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
|
1674 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
|
1675 // >> 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
|
1676 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
|
1677 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1678 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
|
1679 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
|
1680 "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
|
1681 " 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
|
1682 " 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
|
1683 ")"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1684 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
|
1685 } 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
|
1686 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
|
1687 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1688 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
|
1689 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1690 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
|
1691 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
|
1692 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
|
1693 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
|
1694 "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
|
1695 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
|
1696 |
0eef53e06007
Add JDBC_API_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 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
|
1698 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
|
1699 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
|
1700 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
|
1701 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
|
1702 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1703 // 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
|
1704 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
|
1705 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
|
1706 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
|
1707 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
|
1708 } 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
|
1709 while (keys.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1710 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
|
1711 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1712 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
|
1713 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
|
1714 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1715 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
|
1716 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1717 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
|
1718 } 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
|
1719 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
|
1720 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1721 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
|
1722 |
0eef53e06007
Add JDBC_API_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 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
|
1724 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
|
1725 // 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
|
1726 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
|
1727 } 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
|
1728 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
|
1729 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1730 |
0eef53e06007
Add JDBC_API_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 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
|
1732 "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
|
1733 "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
|
1734 "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
|
1735 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1737 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
|
1738 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
|
1739 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1740 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
|
1741 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
|
1742 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
|
1743 // >> 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
|
1744 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
|
1745 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1746 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
|
1747 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
|
1748 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
|
1749 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
|
1750 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
|
1751 } 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
|
1752 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
|
1753 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1754 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
|
1755 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1756 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
|
1757 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
|
1758 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
|
1759 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
|
1760 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
|
1761 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
|
1762 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
|
1763 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
|
1764 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
|
1765 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
|
1766 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1767 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
|
1768 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
|
1769 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
|
1770 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
|
1771 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
|
1772 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1773 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
|
1774 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
|
1775 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
|
1776 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
|
1777 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
|
1778 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1779 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
|
1780 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
|
1781 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
|
1782 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1783 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
|
1784 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
|
1785 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
|
1786 } 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
|
1787 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
|
1788 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
|
1789 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
|
1790 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1791 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1792 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
|
1793 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
|
1794 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
|
1795 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
|
1796 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
|
1797 |
0eef53e06007
Add JDBC_API_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 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
|
1799 // 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
|
1800 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
|
1801 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
|
1802 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
|
1803 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
|
1804 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1805 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
|
1806 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1807 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1808 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
|
1809 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
|
1810 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
|
1811 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1812 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
|
1813 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
|
1814 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
|
1815 } 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
|
1816 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
|
1817 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
|
1818 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
|
1819 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1820 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
|
1821 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1822 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
|
1823 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
|
1824 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
|
1825 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
|
1826 |
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 // 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
|
1828 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
|
1829 } 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
|
1830 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
|
1831 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1833 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
|
1834 "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
|
1835 "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
|
1836 "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
|
1837 "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
|
1838 " 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
|
1839 " 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
|
1840 " 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
|
1841 " 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
|
1842 "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
|
1843 "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
|
1844 " 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
|
1845 " 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
|
1846 " 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
|
1847 "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
|
1848 "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
|
1849 "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
|
1850 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1851 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1852 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
|
1853 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
|
1854 |
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
|
1855 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
|
1856 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
|
1857 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
|
1858 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
|
1859 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
|
1860 } |
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
|
1861 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
|
1862 |
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
|
1863 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
|
1864 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
|
1865 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
|
1866 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
|
1867 // >> 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
|
1868 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
|
1869 |
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
|
1870 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
|
1871 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
|
1872 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
|
1873 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
|
1874 |
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
|
1875 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
|
1876 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
|
1877 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
|
1878 |
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
|
1879 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
|
1880 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
|
1881 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
|
1882 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
|
1883 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
|
1884 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
|
1885 |
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
|
1886 /* 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
|
1887 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
|
1888 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
|
1889 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
|
1890 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
|
1891 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
|
1892 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
|
1893 |
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
|
1894 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
|
1895 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
|
1896 |
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
|
1897 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
|
1898 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
|
1899 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
|
1900 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
|
1901 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
|
1902 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
|
1903 |
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
|
1904 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
|
1905 |
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
|
1906 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
|
1907 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
|
1908 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
|
1909 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
|
1910 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
|
1911 |
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
|
1912 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
|
1913 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
|
1914 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
|
1915 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
|
1916 } 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
|
1917 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
|
1918 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
|
1919 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
|
1920 } |
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
|
1921 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
|
1922 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
|
1923 |
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
|
1924 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
|
1925 "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
|
1926 "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
|
1927 "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
|
1928 "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
|
1929 "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
|
1930 "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
|
1931 "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
|
1932 "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
|
1933 } |
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
|
1934 |
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
|
1935 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
|
1936 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
|
1937 |
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
|
1938 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
|
1939 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
|
1940 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
|
1941 |
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
|
1942 // 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
|
1943 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
|
1944 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
|
1945 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
|
1946 else |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1947 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
|
1948 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
|
1949 |
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
|
1950 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
|
1951 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
|
1952 // 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
|
1953 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
|
1954 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
|
1955 } 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
|
1956 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
|
1957 } |
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
|
1958 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
|
1959 |
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
|
1960 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
|
1961 "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
|
1962 "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
|
1963 } |
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
|
1964 |
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
|
1965 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
|
1966 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
|
1967 |
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
|
1968 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
|
1969 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
|
1970 |
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
|
1971 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
|
1972 // 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
|
1973 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
|
1974 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
|
1975 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
|
1976 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
|
1977 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
|
1978 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
|
1979 |
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
|
1980 // 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
|
1981 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
|
1982 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
|
1983 |
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
|
1984 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
|
1985 } |
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
|
1986 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
|
1987 |
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
|
1988 // 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
|
1989 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
|
1990 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
|
1991 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
|
1992 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
|
1993 |
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
|
1994 // 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
|
1995 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
|
1996 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
|
1997 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
|
1998 |
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
|
1999 ResultSet rs = pstmt.getResultSet(); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2000 if (rs != null) { |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2001 if (!rs.next()) |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2002 sb.append("ResultSet is empty"); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2003 sb.append(" result: ").append(rs.getString(1)); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2004 } |
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
|
2005 |
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
|
2006 // 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
|
2007 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
|
2008 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
|
2009 |
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
|
2010 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
|
2011 // 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
|
2012 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
|
2013 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
|
2014 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
|
2015 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
|
2016 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
|
2017 } 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
|
2018 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
|
2019 } |
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
|
2020 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
|
2021 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
|
2022 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
|
2023 } |
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
|
2024 } |
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
|
2025 } 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
|
2026 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
|
2027 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2028 |
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
|
2029 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
|
2030 "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
|
2031 "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
|
2032 "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
|
2033 "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
|
2034 "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
|
2035 "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
|
2036 "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
|
2037 "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
|
2038 "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
|
2039 "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
|
2040 "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
|
2041 "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
|
2042 "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
|
2043 "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
|
2044 "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
|
2045 "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
|
2046 "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
|
2047 "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
|
2048 "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
|
2049 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2050 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2051 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
|
2052 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
|
2053 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2054 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
|
2055 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2056 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2057 // >> 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
|
2058 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
|
2059 |
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
|
2060 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2061 int updates = 0; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2062 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
|
2063 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2064 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
|
2065 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2066 // all NULLs |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2067 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
|
2068 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2069 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
|
2070 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2071 // all filled in |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2072 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
|
2073 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2074 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
|
2075 } catch (SQLException e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2076 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
|
2077 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2078 closeStmtResSet(stmt, null); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2079 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2080 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2081 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2082 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
|
2083 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
|
2084 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2085 // testing and showing result set meta data |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2086 ResultSetMetaData rsmd = pstmt.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2087 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
|
2088 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
|
2089 sb.append("RCol ").append(col).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2090 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
|
2091 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
|
2092 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
|
2093 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
|
2094 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
|
2095 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
|
2096 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
|
2097 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
|
2098 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
|
2099 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
|
2100 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
|
2101 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
|
2102 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
|
2103 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
|
2104 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
|
2105 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
|
2106 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
|
2107 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
|
2108 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
|
2109 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
|
2110 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2111 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2112 showParams(pstmt); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2113 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2114 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2115 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2116 // >> 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
|
2117 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
|
2118 } 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
|
2119 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
|
2120 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2121 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
|
2122 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2123 compareExpectedOutput("Test_PSmetadata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2124 "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
|
2125 "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
|
2126 " 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
|
2127 "rsmd. 6 columns:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2128 "RCol 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2129 " classname java.lang.Short\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2130 " displaysize 3\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2131 " label intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2132 " name intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2133 " type -6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2134 " typename tinyint\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2135 " precision 3\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2136 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2137 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2138 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2139 " tablename \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2140 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2141 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2142 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2143 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2144 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2145 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2146 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2147 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2148 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2149 "RCol 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2150 " classname java.lang.Integer\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2151 " displaysize 10\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2152 " label myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2153 " name myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2154 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2155 " typename int\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2156 " precision 10\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2157 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2158 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2159 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2160 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2161 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2162 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2163 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2164 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2165 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2166 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2167 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2168 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2169 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2170 "RCol 3\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2171 " classname java.lang.Double\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2172 " displaysize 15\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2173 " label mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2174 " name mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2175 " type 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2176 " typename double\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2177 " precision 15\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2178 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2179 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2180 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2181 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2182 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2183 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2184 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2185 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2186 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2187 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2188 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2189 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2190 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2191 "RCol 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2192 " classname java.lang.Boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2193 " displaysize 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2194 " label mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2195 " name mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2196 " type 16\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2197 " typename boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2198 " precision 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2199 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2200 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2201 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2202 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2203 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2204 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2205 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2206 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2207 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2208 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2209 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2210 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2211 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2212 "RCol 5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2213 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2214 " displaysize 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2215 " label myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2216 " name myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2217 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2218 " typename varchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2219 " precision 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2220 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2221 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2222 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2223 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2224 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2225 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2226 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2227 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2228 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2229 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2230 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2231 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2232 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2233 "RCol 6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2234 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2235 " displaysize 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2236 " label myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2237 " name myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2238 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2239 " typename clob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2240 " precision 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2241 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2242 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2243 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2244 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2245 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2246 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2247 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2248 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2249 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2250 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2251 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2252 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2253 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2254 "pmd. 1 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2255 "Param 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2256 " nullable 2 (UNKNOWN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2257 " signed true\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2258 " precision 10\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2259 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2260 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2261 " typename int\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2262 " classname java.lang.Integer\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2263 " mode 1 (IN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2264 "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
|
2265 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2266 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2267 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
|
2268 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
|
2269 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2270 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2271 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
|
2272 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2273 // >> 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
|
2274 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
|
2275 |
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
|
2276 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
|
2277 for (int i = 0; i < 120; i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2278 pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2279 pstmt.setInt(1, i); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2280 rs = pstmt.executeQuery(); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2281 if (rs != null && rs.next() && i % 20 == 0) { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2282 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
|
2283 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2284 /* 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
|
2285 pstmt.close(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2286 } |
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
|
2287 } 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
|
2288 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
|
2289 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2290 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2291 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
|
2292 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2293 compareExpectedOutput("Test_PSsomeamount", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2294 "0. true true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2295 "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
|
2296 "0, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2297 "20, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2298 "40, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2299 "60, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2300 "80, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2301 "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
|
2302 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2303 |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2304 /* 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
|
2305 /* 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
|
2306 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
|
2307 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
|
2308 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2309 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
|
2310 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
|
2311 try { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2312 // >> 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
|
2313 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
|
2314 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2315 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
|
2316 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
|
2317 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
|
2318 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
|
2319 rs = pstmt.executeQuery(); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2320 if (rs != null && rs.next() && i % 1000 == 0) { |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2321 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
|
2322 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2323 /* 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
|
2324 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
|
2325 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2326 } 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
|
2327 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
|
2328 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2329 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2330 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
|
2331 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2332 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
|
2333 "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
|
2334 "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
|
2335 "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
|
2336 "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
|
2337 "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
|
2338 "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
|
2339 "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
|
2340 "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
|
2341 "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
|
2342 "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
|
2343 "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
|
2344 "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
|
2345 "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
|
2346 "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
|
2347 "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
|
2348 "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
|
2349 "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
|
2350 "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
|
2351 "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
|
2352 "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
|
2353 "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
|
2354 "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
|
2355 "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
|
2356 "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
|
2357 "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
|
2358 "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
|
2359 "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
|
2360 "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
|
2361 "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
|
2362 "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
|
2363 "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
|
2364 "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
|
2365 "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
|
2366 "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
|
2367 "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
|
2368 "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
|
2369 "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
|
2370 "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
|
2371 "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
|
2372 "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
|
2373 "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
|
2374 "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
|
2375 "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
|
2376 "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
|
2377 "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
|
2378 "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
|
2379 "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
|
2380 "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
|
2381 "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
|
2382 "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
|
2383 "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
|
2384 "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
|
2385 "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
|
2386 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2387 |
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
|
2388 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
|
2389 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
|
2390 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2391 Statement stmt = null; |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2392 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2393 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
|
2394 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2395 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2396 // >> 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
|
2397 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
|
2398 |
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
|
2399 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2400 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
|
2401 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2402 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
|
2403 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2404 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
|
2405 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2406 sb.append(pmd.getParameterCount()).append(" parameters:\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2407 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
|
2408 sb.append("Parm ").append(parm).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2409 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
|
2410 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
|
2411 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
|
2412 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2413 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2414 INET tinet = new INET(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2415 tinet.fromString("172.5.5.5/24"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2416 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2417 URL turl = new URL(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2418 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2419 turl.fromString("http://www.monetdb.org/"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2420 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2421 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
|
2422 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2423 pstmt.setObject(1, tinet); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2424 pstmt.setObject(2, turl); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2425 // insert first record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2426 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
|
2427 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
|
2428 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2429 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2430 tinet.setNetmaskBits(16); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2431 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2432 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
|
2433 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2434 // insert second record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2435 pstmt.execute(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2436 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2437 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
|
2438 ResultSetMetaData rsmd = rs.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2439 for (int i = 1; rs.next(); i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2440 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
|
2441 Object x = rs.getObject(col); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2442 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
|
2443 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
|
2444 } else { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2445 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
|
2446 if (x instanceof INET) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2447 INET inet = (INET)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2448 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
|
2449 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
|
2450 } else if (x instanceof URL) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2451 URL url = (URL)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2452 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
|
2453 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2454 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2455 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2456 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2457 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2458 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2459 // >> 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
|
2460 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
|
2461 } 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
|
2462 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
|
2463 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2464 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2465 closeStmtResSet(stmt, rs); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2466 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
|
2467 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2468 compareExpectedOutput("Test_PSsqldata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2469 "0. false false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2470 "2 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2471 "Parm 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2472 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2473 " typename inet\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2474 " classname org.monetdb.jdbc.types.INET\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2475 "Parm 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2476 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2477 " typename url\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2478 " 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
|
2479 "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
|
2480 " 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
|
2481 " 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
|
2482 "1. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2483 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2484 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2485 "1. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2486 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2487 "2. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2488 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2489 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2490 "2. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2491 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2492 "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
|
2493 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2494 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2495 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
|
2496 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
|
2497 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2498 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2499 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2500 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
|
2501 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2502 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2503 // >> 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
|
2504 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
|
2505 |
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
|
2506 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2507 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
|
2508 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2509 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
|
2510 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2511 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
|
2512 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2513 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2514 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2515 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2516 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2517 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2518 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2519 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2520 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2521 sb.append("2. inserting a record..."); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2522 final java.util.Date d = new java.util.Date(); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2523 final long tm = d.getTime(); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2524 pstmt.setTime(1, new java.sql.Time(tm)); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2525 pstmt.setTimestamp(2, new java.sql.Timestamp(tm)); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2526 pstmt.setDate(3, new java.sql.Date(tm)); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2527 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2528 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2529 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2530 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2531 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2532 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2533 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2534 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2535 sb.append("4. selecting record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2536 pstmt = con.prepareStatement("SELECT * FROM Test_PStimedate"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2537 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2538 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2539 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2540 while (rs != null && rs.next()) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2541 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
|
2542 sb.append((j+4)).append(". retrieving..."); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2543 Object x = rs.getObject(j); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2544 boolean matches = false; |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2545 if (x instanceof java.sql.Time) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2546 sb.append(" (Time)"); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2547 matches = (new java.sql.Time(tm)).toString().equals(x.toString()); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2548 } else if (x instanceof java.sql.Date) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2549 sb.append(" (Date)"); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2550 matches = (new java.sql.Date(tm)).toString().equals(x.toString()); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2551 } else if (x instanceof java.sql.Timestamp) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2552 sb.append(" (Timestamp)"); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2553 matches = (new java.sql.Timestamp(tm)).toString().equals(x.toString()); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2554 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2555 if (matches) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2556 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2557 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2558 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
|
2559 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2560 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2561 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2562 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2563 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2564 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2565 // >> 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
|
2566 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
|
2567 } 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
|
2568 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
|
2569 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2570 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2571 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2572 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
|
2573 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2574 compareExpectedOutput("Test_PStimedate", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2575 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2576 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2577 "2. inserting a record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2578 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2579 "4. selecting record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2580 "5. retrieving... (Time) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2581 "6. retrieving... (Timestamp) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2582 "7. retrieving... (Date) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2583 "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
|
2584 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2585 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2586 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
|
2587 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
|
2588 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2589 // 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
|
2590 // setting, by overriding the VM's default |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2591 // 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
|
2592 // savings corrections |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2593 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2594 |
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
|
2595 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2596 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2597 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
|
2598 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2599 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2600 // >> 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
|
2601 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
|
2602 |
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
|
2603 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2604 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
|
2605 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2606 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
|
2607 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2608 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
|
2609 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2610 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2611 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2612 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2613 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2614 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2615 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2616 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2617 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2618 sb.append("2. inserting records...\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2619 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
|
2620 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
|
2621 Calendar c = Calendar.getInstance(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2622 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
|
2623 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
|
2624 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2625 tsz.setTimeZone(c.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2626 tz.setTimeZone(tsz.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2627 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
|
2628 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2629 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2630 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2631 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2632 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2633 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2634 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2635 c.setTimeZone(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2636 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
|
2637 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2638 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2639 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2640 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2641 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2642 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2643 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
|
2644 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
|
2645 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2646 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2647 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2648 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2649 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2650 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2651 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
|
2652 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
|
2653 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2654 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2655 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2656 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2657 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2658 sb.append(" done\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2659 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2660 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2661 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2662 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2663 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2664 sb.append("4. selecting records..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2665 pstmt = con.prepareStatement("SELECT * FROM Test_PStimezone"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2666 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2667 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2668 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2669 // 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
|
2670 // (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
|
2671 // 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
|
2672 // 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
|
2673 // 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
|
2674 // 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
|
2675 // 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
|
2676 // eventually see 1st Jan 1970. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2677 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
|
2678 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
|
2679 .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
|
2680 // .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
|
2681 .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
|
2682 // .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
|
2683 .append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2684 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2685 tsz.setTimeZone(TimeZone.getDefault()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2686 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
|
2687 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
|
2688 .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
|
2689 .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
|
2690 .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
|
2691 .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
|
2692 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2693 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
|
2694 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
|
2695 .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
|
2696 .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
|
2697 .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
|
2698 .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
|
2699 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2700 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
|
2701 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
|
2702 .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
|
2703 .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
|
2704 .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
|
2705 .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
|
2706 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2707 SQLWarning w = rs.getWarnings(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2708 while (w != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2709 sb.append(w.getMessage()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2710 w = w.getNextWarning(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2711 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2712 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2713 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2714 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2715 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2716 // >> 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
|
2717 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
|
2718 } 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
|
2719 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
|
2720 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2721 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2722 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2723 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
|
2724 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2725 compareExpectedOutput("Test_PStimezone", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2726 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2727 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2728 "2. inserting records...\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2729 "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
|
2730 "inserting with calendar timezone UTC\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2731 "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
|
2732 "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
|
2733 " done\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2734 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2735 "4. selecting records... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2736 "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
|
2737 // 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
|
2738 "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
|
2739 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2740 "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
|
2741 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2742 "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
|
2743 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2744 "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
|
2745 "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
|
2746 // 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
|
2747 "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
|
2748 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2749 "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
|
2750 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2751 "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
|
2752 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2753 "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
|
2754 "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
|
2755 // 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
|
2756 "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
|
2757 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2758 "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
|
2759 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2760 "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
|
2761 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2762 "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
|
2763 "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
|
2764 // 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
|
2765 "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
|
2766 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2767 "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
|
2768 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2769 "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
|
2770 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2771 "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
|
2772 "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
|
2773 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2774 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2775 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
|
2776 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
|
2777 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2778 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2779 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
|
2780 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2781 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2782 // >> 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
|
2783 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
|
2784 |
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
|
2785 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2786 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2787 "CREATE TABLE htmtest (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2788 " htmid bigint NOT NULL," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2789 " ra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2790 " decl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2791 " dra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2792 " ddecl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2793 " flux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2794 " dflux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2795 " freq double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2796 " bw double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2797 " type decimal(1,0)," + |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2798 " imageurl url(100)," + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2799 " comment varchar(100)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2800 " CONSTRAINT htmtest_htmid_pkey PRIMARY KEY (htmid)" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2801 ")" ); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2802 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2803 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
|
2804 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2805 // 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
|
2806 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
|
2807 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2808 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
|
2809 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2810 stmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2811 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2812 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
|
2813 sb.append("1. inserting a record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2814 pstmt.setLong(1, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2815 pstmt.setFloat(2, (float)1.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2816 pstmt.setDouble(3, 2.4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2817 pstmt.setDouble(4, 3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2818 pstmt.setString(5, "vlavbla"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2819 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2820 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2821 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2822 // try an update like bug #1757923 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2823 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
|
2824 sb.append("2. updating record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2825 pstmt.setString(1, "some update"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2826 pstmt.setObject(2, (float)3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2827 pstmt.setLong(3, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2828 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2829 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2830 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2831 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2832 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2833 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2834 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2835 // >> 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
|
2836 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
|
2837 } 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
|
2838 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
|
2839 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2840 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2841 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2842 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
|
2843 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2844 compareExpectedOutput("Test_PStypes", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2845 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2846 "1. inserting a record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2847 "2. updating record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2848 "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
|
2849 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2850 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2851 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
|
2852 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
|
2853 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2854 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2855 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
|
2856 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2857 String tbl_nm = "tbl6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2858 String proc_nm = "proc6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2859 |
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
|
2860 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2861 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2862 // create a test table. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2863 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
|
2864 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
|
2865 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2866 // 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
|
2867 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
|
2868 " 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
|
2869 "END;"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2870 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
|
2871 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2872 // 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
|
2873 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
|
2874 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
|
2875 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2876 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2877 // now use a CallableStament object |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2878 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
|
2879 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
|
2880 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2881 // specify first set of params |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2882 cstmt.setInt(1, 2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2883 cstmt.setDouble(2, 2.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2884 cstmt.setBoolean(3, true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2885 cstmt.setString(4, "Two"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2886 Clob myclob = con.createClob(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2887 myclob.setString(1, "TWOs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2888 cstmt.setClob(5, myclob); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2889 cstmt.setString(6, "http://www.monetdb.org/"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2890 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2891 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
|
2892 showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2893 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2894 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2895 myclob.setString(1, "TREEs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2896 // 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
|
2897 cstmt.setDouble(2, 3.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2898 cstmt.setString(4, "Tree"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2899 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2900 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
|
2901 } catch (java.net.MalformedURLException mfue) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2902 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
|
2903 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2904 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2905 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
|
2906 // showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2907 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2908 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2909 // 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
|
2910 cstmt.setInt(1, 4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2911 cstmt.setBoolean(3, false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2912 cstmt.setString(4, "Four"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2913 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2914 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
|
2915 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2916 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2917 // test setNull() also |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2918 cstmt.setNull(3, Types.BOOLEAN); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2919 cstmt.setNull(5, Types.CLOB); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2920 cstmt.setNull(2, Types.DOUBLE); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2921 cstmt.setNull(4, Types.VARCHAR); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2922 cstmt.setNull(1, Types.INTEGER); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2923 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2924 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
|
2925 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2926 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2927 cstmt.clearParameters(); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2928 |
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
|
2929 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
|
2930 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
|
2931 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
|
2932 |
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
|
2933 } 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
|
2934 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
|
2935 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2936 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2937 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2938 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
|
2939 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2940 compareExpectedOutput("Test_CallableStmt", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2941 "Created table: tbl6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2942 "Created procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2943 "Called procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2944 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2945 " 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
|
2946 " 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
|
2947 "Prepared Callable procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2948 "Called Prepared procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2949 "pmd. 6 parameters:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2950 "Param 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2951 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2952 " signed true\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2953 " precision 10\n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2954 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2955 " type 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2956 " typename int\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2957 " classname java.lang.Integer\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2958 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2959 "Param 2\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2960 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2961 " signed true\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2962 " precision 15\n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2963 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2964 " type 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2965 " typename double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2966 " classname java.lang.Double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2967 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2968 "Param 3\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2969 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2970 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2971 " precision 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2972 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2973 " type 16\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2974 " typename boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2975 " classname java.lang.Boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2976 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2977 "Param 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2978 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2979 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2980 " precision 15\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2981 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2982 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2983 " typename varchar\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2984 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2985 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2986 "Param 5\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2987 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2988 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2989 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2990 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2991 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2992 " typename clob\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2993 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2994 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2995 "Param 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2996 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2997 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2998 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2999 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3000 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3001 " typename url\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3002 " classname org.monetdb.jdbc.types.URL\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3003 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3004 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3005 " 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
|
3006 " 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
|
3007 " 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
|
3008 "Called Prepared procedure (2): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3009 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3010 " 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
|
3011 " 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
|
3012 " 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
|
3013 " 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
|
3014 "Called Prepared procedure (3): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3015 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3016 " 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
|
3017 " 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
|
3018 " 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
|
3019 " 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
|
3020 " 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
|
3021 "Called Prepared procedure (with NULLs): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3022 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3023 " 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
|
3024 " 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
|
3025 " 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
|
3026 " 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
|
3027 " 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
|
3028 " 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
|
3029 "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
|
3030 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3031 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3032 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
|
3033 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
|
3034 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3035 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3036 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
|
3037 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3038 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3039 // >> 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
|
3040 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
|
3041 |
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
|
3042 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3043 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3044 "CREATE TABLE Test_Rbooleans (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3045 " 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
|
3046 " 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
|
3047 " 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
|
3048 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
|
3049 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
|
3050 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3051 // all falses |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3052 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
|
3053 // all trues |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3054 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
|
3055 // sneakier |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3056 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
|
3057 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
|
3058 if (updates != 4) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3059 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
|
3060 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3061 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
|
3062 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3063 // all should give false |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3064 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3065 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
|
3066 .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
|
3067 .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
|
3068 .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
|
3069 .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
|
3070 .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
|
3071 .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
|
3072 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3073 // 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
|
3074 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3075 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
|
3076 .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
|
3077 .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
|
3078 .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
|
3079 .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
|
3080 .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
|
3081 .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
|
3082 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3083 // 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
|
3084 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3085 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
|
3086 .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
|
3087 .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
|
3088 .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
|
3089 .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
|
3090 .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
|
3091 .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
|
3092 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3093 // 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
|
3094 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3095 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
|
3096 .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
|
3097 .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
|
3098 .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
|
3099 .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
|
3100 .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
|
3101 .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
|
3102 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3103 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3104 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3105 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3106 // >> 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
|
3107 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
|
3108 } 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
|
3109 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
|
3110 } |
0eef53e06007
Add JDBC_API_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 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3112 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
|
3113 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3114 compareExpectedOutput("Test_Rbooleans", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3115 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3116 "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
|
3117 "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
|
3118 "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
|
3119 "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
|
3120 "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
|
3121 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
3124 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
|
3125 |
0eef53e06007
Add JDBC_API_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 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3127 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
|
3128 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3129 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3130 // >> 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
|
3131 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
|
3132 |
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
|
3133 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3134 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
|
3135 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3136 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3137 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
|
3138 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3139 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
|
3140 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3141 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
|
3142 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3143 ResultSetMetaData rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3144 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
|
3145 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
|
3146 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
|
3147 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
|
3148 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
|
3149 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
|
3150 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
|
3151 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
|
3152 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
|
3153 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
|
3154 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
|
3155 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
|
3156 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
|
3157 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
|
3158 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
|
3159 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
|
3160 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
|
3161 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
|
3162 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
|
3163 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
|
3164 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
|
3165 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
|
3166 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
|
3167 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3168 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3169 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
|
3170 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
|
3171 Object obj = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3172 String type = rsmd.getColumnClassName(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3173 String isInstance = "(null)"; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3174 if (obj != null && type != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3175 try { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3176 Class<?> c = Class.forName(type); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3177 if (c.isInstance(obj)) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3178 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
|
3179 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3180 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
|
3181 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3182 } catch (ClassNotFoundException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3183 isInstance = "No such class: " + type; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3184 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3185 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3186 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
|
3187 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3188 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3189 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3190 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3191 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3192 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3193 // >> 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
|
3194 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
|
3195 } 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
|
3196 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
|
3197 } |
0eef53e06007
Add JDBC_API_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 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3199 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3200 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3201 compareExpectedOutput("Test_Rmetadata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3202 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3203 "0. 5 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3204 "Colnr 1.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3205 " classname java.lang.Integer\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3206 " displaysize 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3207 " label myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3208 " name myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3209 " type 4\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3210 " typename int\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3211 " precision 10\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3212 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3213 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3214 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3215 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3216 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3217 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3218 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3219 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3220 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3221 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3222 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3223 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3224 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3225 "Colnr 2.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3226 " classname java.lang.Double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3227 " displaysize 24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3228 " label mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3229 " name mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3230 " type 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3231 " typename double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3232 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3233 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3234 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3235 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3236 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3237 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3238 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3239 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3240 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3241 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3242 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3243 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3244 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3245 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3246 "Colnr 3.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3247 " classname java.lang.Boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3248 " displaysize 5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3249 " label mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3250 " name mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3251 " type 16\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3252 " typename boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3253 " precision 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3254 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3255 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3256 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3257 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3258 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3259 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3260 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3261 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3262 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3263 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3264 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3265 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3266 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3267 "Colnr 4.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3268 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3269 " displaysize 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3270 " label myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3271 " name myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3272 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3273 " typename varchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3274 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3275 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3276 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3277 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3278 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3279 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3280 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3281 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3282 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3283 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3284 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3285 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3286 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3287 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3288 "Colnr 5.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3289 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3290 " displaysize 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3291 " label myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3292 " name myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3293 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3294 " typename clob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3295 " precision 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3296 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3297 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3298 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3299 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3300 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3301 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3302 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3303 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3304 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3305 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3306 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3307 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3308 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3309 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3310 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3311 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3312 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3313 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3314 "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
|
3315 "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
|
3316 "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
|
3317 "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
|
3318 "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
|
3319 "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
|
3320 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3321 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3322 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
|
3323 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
|
3324 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3325 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3326 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
|
3327 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
|
3328 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3329 // get a one rowed resultset |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3330 rs = stmt.executeQuery("SELECT 1"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3331 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3332 // >> 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
|
3333 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
|
3334 // >> 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
|
3335 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
|
3336 // >> 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
|
3337 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
|
3338 // >> 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
|
3339 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
|
3340 // >> 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
|
3341 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
|
3342 // >> 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
|
3343 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
|
3344 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3345 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
|
3346 // >> 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
|
3347 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
|
3348 // >> 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
|
3349 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
|
3350 // >> 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
|
3351 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
|
3352 // >> 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
|
3353 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
|
3354 // >> 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
|
3355 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
|
3356 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3357 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3358 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3359 // 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
|
3360 DatabaseMetaData dbmd = con.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3361 rs = dbmd.getTableTypes(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3362 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3363 // >> 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
|
3364 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
|
3365 // >> 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
|
3366 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
|
3367 // >> 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
|
3368 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
|
3369 // >> 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
|
3370 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
|
3371 // >> 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
|
3372 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
|
3373 // move to last row |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3374 rs.last(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3375 // >> 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
|
3376 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
|
3377 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3378 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
|
3379 // >> 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
|
3380 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
|
3381 // >> 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
|
3382 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
|
3383 // >> 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
|
3384 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
|
3385 // >> 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
|
3386 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
|
3387 // >> 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
|
3388 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
|
3389 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3390 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
|
3391 } 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
|
3392 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
|
3393 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3394 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3395 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3396 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3397 compareExpectedOutput("Test_Rpositioning", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3398 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3399 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3400 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3401 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3402 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3403 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3404 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3405 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3406 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3407 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3408 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3409 "12.true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3410 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3411 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3412 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3413 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3414 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3415 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3416 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3417 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3418 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3419 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3420 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3421 "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
|
3422 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3423 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3424 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
|
3425 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
|
3426 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3427 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3428 ResultSet rs = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3429 ResultSetMetaData rsmd = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3430 |
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
|
3431 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3432 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3433 // >> 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
|
3434 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
|
3435 |
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
|
3436 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3437 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
|
3438 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3439 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
|
3440 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3441 stmt.executeUpdate(InsertInto + "(NULL, NULL)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3442 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3443 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
|
3444 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
|
3445 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
|
3446 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
|
3447 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3448 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
|
3449 rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3450 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3451 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
|
3452 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
|
3453 sb.append(col).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3454 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
|
3455 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
|
3456 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
|
3457 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
|
3458 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
|
3459 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3460 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3461 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
|
3462 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
|
3463 sb.append(i).append(".\t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3464 Object x = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3465 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
|
3466 sb.append("<null>\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3467 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3468 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
|
3469 if (x instanceof INET) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3470 INET inet = (INET)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3471 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
|
3472 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
|
3473 } else if (x instanceof URL) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3474 URL url = (URL)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3475 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
|
3476 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3477 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3478 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3479 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3480 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3481 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3482 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3483 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3484 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3485 // >> 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
|
3486 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
|
3487 } 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
|
3488 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
|
3489 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3490 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3491 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3492 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3493 compareExpectedOutput("Test_Rsqldata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3494 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3495 "0. 2 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3496 "1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3497 " 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
|
3498 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3499 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3500 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3501 " columnname myinet\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3502 "2\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3503 " 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
|
3504 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3505 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3506 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3507 " columnname myurl\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3508 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3509 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3510 "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
|
3511 " 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
|
3512 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3513 "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
|
3514 " http://www.monetdb.org/\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3515 "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
|
3516 " 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
|
3517 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3518 "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
|
3519 " 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
|
3520 "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
|
3521 " 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
|
3522 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3523 "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
|
3524 " 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
|
3525 "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
|
3526 " 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
|
3527 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3528 "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
|
3529 " 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
|
3530 "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
|
3531 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3532 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3533 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
|
3534 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
|
3535 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3536 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3537 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
|
3538 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3539 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3540 // >> 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
|
3541 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
|
3542 |
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
|
3543 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3544 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
|
3545 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3546 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
|
3547 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
|
3548 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
|
3549 // 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
|
3550 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
|
3551 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
|
3552 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
|
3553 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3554 // 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
|
3555 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
|
3556 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
|
3557 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
|
3558 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
|
3559 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
|
3560 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
|
3561 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
|
3562 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
|
3563 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
|
3564 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3565 // 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
|
3566 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
|
3567 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
|
3568 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
|
3569 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
|
3570 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
|
3571 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
|
3572 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3573 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
|
3574 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3575 readNextRow(rs, 1, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3576 readNextRow(rs, 2, "t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3577 readNextRow(rs, 3, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3578 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3579 readNextRow(rs, 4, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3580 readNextRow(rs, 5, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3581 readNextRow(rs, 6, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3582 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3583 readNextRow(rs, 11, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3584 readNextRow(rs, 12, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3585 readNextRow(rs, 13, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3586 readNextRow(rs, 14, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3587 readNextRow(rs, 15, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3588 readNextRow(rs, 16, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3589 readNextRow(rs, 17, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3590 readNextRow(rs, 18, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3591 readNextRow(rs, 19, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3592 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3593 readNextRow(rs, 21, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3594 readNextRow(rs, 22, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3595 readNextRow(rs, 23, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3596 readNextRow(rs, 24, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3597 readNextRow(rs, 25, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3598 readNextRow(rs, 26, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3599 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3600 readWarnings(stmt.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3601 readWarnings(con.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3602 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3603 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3604 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3605 // >> 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
|
3606 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
|
3607 } 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
|
3608 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
|
3609 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3610 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3611 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3612 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3613 compareExpectedOutput("Test_Rtimedate", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3614 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3615 "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
|
3616 "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
|
3617 "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
|
3618 "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
|
3619 "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
|
3620 "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
|
3621 "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
|
3622 "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
|
3623 "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
|
3624 "4. vc 2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3625 "4. vc 2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 5 found: '-' in '2004-04-24 11:43:53.654321'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3626 "4. vc 2004-04-24 11:43:53.654321 to dt: 2004-04-24\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3627 "5. vc 11:43:53 to ts: rs.getTimestamp(colnm) failed with error: parsing failed at pos 3 found: ':' in '11:43:53'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3628 "5. vc 11:43:53 to tm: 11:43:53\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3629 "5. vc 11:43:53 to dt: rs.getDate(colnm) failed with error: parsing failed at pos 3 found: ':' in '11:43:53'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3630 "6. vc 2004-04-24 to ts: 2004-04-24 00:00:00.0\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3631 "6. vc 2004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 5 found: '-' in '2004-04-24'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3632 "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
|
3633 "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
|
3634 "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
|
3635 "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
|
3636 "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
|
3637 "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
|
3638 "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
|
3639 "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
|
3640 "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
|
3641 "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
|
3642 "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
|
3643 "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
|
3644 "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
|
3645 "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
|
3646 "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
|
3647 "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
|
3648 "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
|
3649 "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
|
3650 "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
|
3651 "17. vc 904-04-24 11:43:53.567 to ts: 0904-04-24 11:43:53.567\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3652 "17. vc 904-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 4 found: '-' in '904-04-24 11:43:53.567'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3653 "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
|
3654 "18. vc 74-04-24 11:43:53.567 to ts: 0074-04-24 11:43:53.567\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3655 "18. vc 74-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 3 found: '-' in '74-04-24 11:43:53.567'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3656 "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
|
3657 "19. vc 4-04-24 11:43:53.567 to ts: 0004-04-24 11:43:53.567\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3658 "19. vc 4-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 2 found: '-' in '4-04-24 11:43:53.567'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3659 "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
|
3660 "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
|
3661 "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
|
3662 "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
|
3663 "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
|
3664 "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
|
3665 "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
|
3666 "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
|
3667 "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
|
3668 "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
|
3669 "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
|
3670 "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
|
3671 "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
|
3672 "25. vc -2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3673 "25. vc -2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 6 found: '-' in '-2004-04-24 11:43:53.654321'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3674 "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
|
3675 "26. vc -3004-04-24 to ts: 3004-04-24 00:00:00.0\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
3676 "26. vc -3004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 6 found: '-' in '-3004-04-24'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3677 "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
|
3678 "0. true true\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3679 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3680 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3681 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
|
3682 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3683 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3684 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3685 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3686 // 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
|
3687 // 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
|
3688 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
|
3689 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3690 // 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
|
3691 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
|
3692 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
|
3693 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3694 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
|
3695 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3696 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3697 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3698 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3699 // 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
|
3700 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
|
3701 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
|
3702 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3703 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
|
3704 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3705 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3706 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3707 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3708 // 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
|
3709 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
|
3710 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
|
3711 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3712 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
|
3713 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3714 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3715 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
|
3716 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3717 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3718 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
|
3719 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
|
3720 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3721 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3722 PreparedStatement pstmt = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3723 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
|
3724 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3725 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3726 // >> 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
|
3727 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
|
3728 |
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
|
3729 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3730 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3731 sb.append("1. create..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3732 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
|
3733 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
|
3734 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3735 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3736 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3737 // for large batches of DML always set sys.optimizer = 'minimal_pipe'. It makes a big difference in performance. |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3738 stmt.execute("SET sys.optimizer = 'minimal_pipe'"); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3739 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3740 // 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
|
3741 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
|
3742 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
|
3743 if (i % 1500 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3744 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
|
3745 int[] cnts = stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3746 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3747 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
|
3748 if (cnts.length != 1500) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3749 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
|
3750 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
|
3751 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
|
3752 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
|
3753 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3754 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
|
3755 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3756 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3757 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3758 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3759 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3760 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
|
3761 stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3762 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3763 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3764 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3765 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
|
3766 // 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
|
3767 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
|
3768 pstmt.setInt(1, i); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3769 pstmt.addBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3770 if (i % 3000 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3771 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
|
3772 long[] cnts = pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3773 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3774 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
|
3775 if (cnts.length != 3000) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3776 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
|
3777 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
|
3778 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
|
3779 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
|
3780 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3781 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
|
3782 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3783 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3784 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3785 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3786 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3787 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
|
3788 pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3789 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3790 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3791 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3792 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
|
3793 stmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3794 pstmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3795 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3796 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3797 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
|
3798 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
|
3799 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3800 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
|
3801 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3802 sb.append("8. drop table..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3803 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
|
3804 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
|
3805 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3806 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3807 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3808 // rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3809 stmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3810 pstmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3811 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3812 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3813 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3814 // >> 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
|
3815 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
|
3816 } 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
|
3817 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
|
3818 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3819 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3820 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3821 closeStmtResSet(pstmt, null); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3822 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3823 compareExpectedOutput("Test_Sbatching", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3824 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3825 "1. create...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3826 "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
|
3827 "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
|
3828 "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
|
3829 "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
|
3830 "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
|
3831 "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
|
3832 "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
|
3833 "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
|
3834 "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
|
3835 "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
|
3836 "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
|
3837 "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
|
3838 "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
|
3839 "8. drop table...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3840 "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
|
3841 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3842 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3843 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
|
3844 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
|
3845 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3846 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
|
3847 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
|
3848 // >> 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
|
3849 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
|
3850 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3851 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
|
3852 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
|
3853 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
|
3854 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
|
3855 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
|
3856 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3857 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
|
3858 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
|
3859 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
|
3860 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
|
3861 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3862 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
|
3863 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
|
3864 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
|
3865 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
|
3866 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3867 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
|
3868 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
|
3869 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
|
3870 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
|
3871 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3872 } 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
|
3873 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
|
3874 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3875 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3876 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
|
3877 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3878 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
|
3879 "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
|
3880 "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
|
3881 "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
|
3882 "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
|
3883 "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
|
3884 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3885 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3886 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
|
3887 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
|
3888 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3889 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
|
3890 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
|
3891 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
|
3892 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3893 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
|
3894 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3895 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
|
3896 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
|
3897 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
|
3898 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
|
3899 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3900 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
|
3901 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
|
3902 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
|
3903 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
|
3904 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
|
3905 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3906 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
|
3907 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
|
3908 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
|
3909 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
|
3910 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
|
3911 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3912 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
|
3913 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
|
3914 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
|
3915 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
|
3916 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
|
3917 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
|
3918 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3919 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
|
3920 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3921 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
|
3922 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
|
3923 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
|
3924 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
|
3925 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
|
3926 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3927 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
|
3928 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3929 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
|
3930 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
|
3931 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
|
3932 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
|
3933 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
|
3934 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
|
3935 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
|
3936 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3937 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
|
3938 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
|
3939 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
|
3940 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
|
3941 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
|
3942 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
|
3943 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3944 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
|
3945 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
|
3946 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
|
3947 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
|
3948 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
|
3949 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
|
3950 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3951 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
|
3952 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3953 } 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
|
3954 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
|
3955 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
|
3956 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3957 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3958 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
|
3959 "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
|
3960 "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
|
3961 "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
|
3962 "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
|
3963 "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
|
3964 "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
|
3965 "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
|
3966 "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
|
3967 "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
|
3968 "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
|
3969 "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
|
3970 "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
|
3971 "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
|
3972 "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
|
3973 "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
|
3974 "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
|
3975 "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
|
3976 "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
|
3977 "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
|
3978 "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
|
3979 "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
|
3980 "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
|
3981 "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
|
3982 "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
|
3983 "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
|
3984 "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
|
3985 "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
|
3986 "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
|
3987 "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
|
3988 "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
|
3989 "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
|
3990 "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
|
3991 "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
|
3992 "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
|
3993 "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
|
3994 "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
|
3995 "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
|
3996 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3997 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3998 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
|
3999 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
|
4000 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
|
4001 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
|
4002 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
|
4003 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
|
4004 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
|
4005 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
|
4006 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4007 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
|
4008 } 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
|
4009 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
|
4010 } 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
|
4011 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
|
4012 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4013 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4014 |
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
|
4015 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
|
4016 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
|
4017 |
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
|
4018 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
|
4019 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
|
4020 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
|
4021 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
|
4022 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
|
4023 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
|
4024 // 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
|
4025 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
|
4026 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
|
4027 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
|
4028 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
|
4029 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
|
4030 |
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
|
4031 // 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
|
4032 // 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
|
4033 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
|
4034 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
|
4035 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
|
4036 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
|
4037 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
|
4038 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
|
4039 |
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
|
4040 // 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
|
4041 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
|
4042 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
|
4043 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
|
4044 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
|
4045 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
|
4046 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
|
4047 |
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
|
4048 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
|
4049 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
|
4050 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
|
4051 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
|
4052 } |
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
|
4053 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
|
4054 |
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
|
4055 // 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
|
4056 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
|
4057 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
|
4058 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
|
4059 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
|
4060 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
|
4061 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
|
4062 |
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
|
4063 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
|
4064 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
|
4065 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
|
4066 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
|
4067 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
|
4068 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
|
4069 } 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
|
4070 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
|
4071 } |
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
|
4072 |
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
|
4073 // 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
|
4074 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
|
4075 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
|
4076 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
|
4077 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
|
4078 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
|
4079 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
|
4080 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
|
4081 } 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
|
4082 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
|
4083 } |
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
|
4084 |
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
|
4085 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
|
4086 |
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
|
4087 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
|
4088 "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
|
4089 "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
|
4090 "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
|
4091 "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
|
4092 "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
|
4093 "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
|
4094 "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
|
4095 } |
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
|
4096 |
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
|
4097 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
|
4098 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
|
4099 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4101 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
|
4102 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
|
4103 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
|
4104 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
|
4105 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
|
4106 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
|
4107 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
|
4108 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
|
4109 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
|
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 // >> 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
|
4112 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
|
4113 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
|
4114 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
|
4115 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4117 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
|
4118 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
|
4119 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
|
4120 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4121 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
|
4122 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
|
4123 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
|
4124 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
|
4125 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
|
4126 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4127 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
|
4128 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
|
4129 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
|
4130 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
|
4131 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
|
4132 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4134 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
|
4135 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
|
4136 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
|
4137 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
|
4138 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
|
4139 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
|
4140 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
|
4141 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4142 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
|
4143 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
|
4144 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
|
4145 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
|
4146 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
|
4147 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4148 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
|
4149 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
|
4150 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
|
4151 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
|
4152 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
|
4153 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4154 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
|
4155 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
|
4156 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
|
4157 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
|
4158 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
|
4159 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4161 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
|
4162 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
|
4163 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
|
4164 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
|
4165 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
|
4166 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
|
4167 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
|
4168 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4169 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
|
4170 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
|
4171 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
|
4172 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
|
4173 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
|
4174 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4175 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
|
4176 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
|
4177 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
|
4178 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
|
4179 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
|
4180 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4181 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
|
4182 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
|
4183 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
|
4184 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
|
4185 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
|
4186 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4188 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
|
4189 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
|
4190 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
|
4191 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
|
4192 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
|
4193 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
|
4194 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
|
4195 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4196 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
|
4197 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
|
4198 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
|
4199 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
|
4200 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
|
4201 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4202 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
|
4203 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
|
4204 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
|
4205 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
|
4206 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
|
4207 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4208 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
|
4209 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
|
4210 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
|
4211 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
|
4212 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
|
4213 } 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
|
4214 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
|
4215 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4218 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
|
4219 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
|
4220 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
|
4221 } 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
|
4222 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
|
4223 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4226 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
|
4227 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
|
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 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
|
4230 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
|
4231 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
|
4232 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4234 "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
|
4235 "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
|
4236 "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
|
4237 "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
|
4238 "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
|
4239 "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
|
4240 "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
|
4241 "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
|
4242 "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
|
4243 "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
|
4244 "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
|
4245 "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
|
4246 "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
|
4247 "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
|
4248 "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
|
4249 "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
|
4250 "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
|
4251 "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
|
4252 "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
|
4253 "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
|
4254 "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
|
4255 "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
|
4256 "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
|
4257 "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
|
4258 "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
|
4259 "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
|
4260 "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
|
4261 "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
|
4262 "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
|
4263 "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
|
4264 "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
|
4265 "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
|
4266 "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
|
4267 "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
|
4268 "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
|
4269 "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
|
4270 "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
|
4271 "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
|
4272 "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
|
4273 "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
|
4274 "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
|
4275 "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
|
4276 "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
|
4277 "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
|
4278 "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
|
4279 "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
|
4280 "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
|
4281 "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
|
4282 "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
|
4283 "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
|
4284 "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
|
4285 "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
|
4286 "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
|
4287 "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
|
4288 "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
|
4289 "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
|
4290 "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
|
4291 "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
|
4292 "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
|
4293 "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
|
4294 "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
|
4295 "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
|
4296 "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
|
4297 "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
|
4298 "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
|
4299 "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
|
4300 "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
|
4301 "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
|
4302 "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
|
4303 "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
|
4304 "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
|
4305 "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
|
4306 "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
|
4307 "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
|
4308 "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
|
4309 "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
|
4310 "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
|
4311 "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
|
4312 "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
|
4313 "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
|
4314 "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
|
4315 "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
|
4316 "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
|
4317 "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
|
4318 "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
|
4319 "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
|
4320 "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
|
4321 "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
|
4322 "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
|
4323 "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
|
4324 "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
|
4325 "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
|
4326 "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
|
4327 "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
|
4328 "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
|
4329 "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
|
4330 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4332 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
|
4333 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
|
4334 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4335 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
|
4336 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
|
4337 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
|
4338 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
|
4339 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
|
4340 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
|
4341 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
|
4342 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
|
4343 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4344 // >> 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
|
4345 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
|
4346 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
|
4347 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4348 // 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
|
4349 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
|
4350 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
|
4351 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
|
4352 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4353 // 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
|
4354 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
|
4355 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
|
4356 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
|
4357 |
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
|
4358 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
|
4359 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
|
4360 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
|
4361 |
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
|
4362 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
|
4363 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
|
4364 |
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
|
4365 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
|
4366 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
|
4367 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
|
4368 } 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
|
4369 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
|
4370 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4371 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
|
4372 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
|
4373 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
|
4374 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4375 sb.append("2.1. check table status with client 1...\n"); |
593
f4181beae53d
Restored test to outputs before Jul2021, after fixing bug #7200
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
591
diff
changeset
|
4376 rs1 = stmt1.executeQuery("SELECT * FROM tconc_seq ORDER BY id"); |
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
|
4377 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
|
4378 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
|
4379 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
|
4380 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4381 sb.append("2.2. check table status with client 2...\n"); |
593
f4181beae53d
Restored test to outputs before Jul2021, after fixing bug #7200
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
591
diff
changeset
|
4382 rs2 = stmt2.executeQuery("SELECT * FROM tconc_seq ORDER BY id"); |
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
|
4383 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
|
4384 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
|
4385 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
|
4386 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4387 // 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
|
4388 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
|
4389 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
|
4390 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
|
4391 |
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
|
4392 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
|
4393 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
|
4394 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
|
4395 } 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
|
4396 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
|
4397 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
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
|
4399 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
|
4400 "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
|
4401 "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
|
4402 "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
|
4403 "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
|
4404 "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
|
4405 "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
|
4406 "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
|
4407 "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
|
4408 "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
|
4409 "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
|
4410 "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
|
4411 "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
|
4412 "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
|
4413 "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
|
4414 "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
|
4415 "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
|
4416 "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
|
4417 "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
|
4418 "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
|
4419 "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
|
4420 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
|
4421 |
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
|
4422 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
|
4423 // 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
|
4424 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
|
4425 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
|
4426 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
|
4427 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
|
4428 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
|
4429 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
|
4430 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
|
4431 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
|
4432 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4433 // 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
|
4434 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
|
4435 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
|
4436 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
|
4437 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
|
4438 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
|
4439 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
|
4440 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
|
4441 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
|
4442 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4443 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
|
4444 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
|
4445 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
|
4446 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
|
4447 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
|
4448 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
|
4449 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
|
4450 } |
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
|
4451 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
|
4452 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4453 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
|
4454 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
|
4455 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
|
4456 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
|
4457 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
|
4458 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
|
4459 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
|
4460 } |
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
|
4461 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
|
4462 } 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
|
4463 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
|
4464 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4465 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4466 // 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
|
4467 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
|
4468 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
|
4469 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
|
4470 } 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
|
4471 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
|
4472 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4473 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4474 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
|
4475 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
|
4476 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4477 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
|
4478 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
|
4479 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4480 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
|
4481 "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
|
4482 "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
|
4483 "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
|
4484 "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
|
4485 "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
|
4486 "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
|
4487 "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
|
4488 "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
|
4489 "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
|
4490 "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
|
4491 "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
|
4492 "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
|
4493 "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
|
4494 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4497 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
|
4498 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4500 // 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
|
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("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
|
4503 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
|
4504 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
|
4505 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
|
4506 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
|
4507 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
|
4508 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
|
4509 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
|
4510 } 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
|
4511 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
|
4512 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4513 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4515 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
|
4516 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
|
4517 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
|
4518 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
|
4519 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
|
4520 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4521 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
|
4522 |
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("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
|
4524 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
|
4525 |
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
|
4526 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
|
4527 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
|
4528 |
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
|
4529 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
|
4530 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
|
4531 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
|
4532 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
|
4533 |
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
|
4534 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
|
4535 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
|
4536 |
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
|
4537 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
|
4538 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
|
4539 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
|
4540 |
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
|
4541 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
|
4542 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
|
4543 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
|
4544 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
|
4545 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
|
4546 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
|
4547 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4549 } |
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
|
4550 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
|
4551 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4552 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
|
4553 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
|
4554 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
|
4555 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
|
4556 while (rs2.next()) { |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4557 String tt = rs2.getString(1); |
647
8d7c75cc01e3
Adapt test for getTableTypes(). Filter out UNLOGGED TABLE value for stable output on all future and past MonetDB versions.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
646
diff
changeset
|
4558 // the STREAM TABLE type is REMOVED in post Oct2020 releases, so filter it out for a stable output on all releases |
8d7c75cc01e3
Adapt test for getTableTypes(). Filter out UNLOGGED TABLE value for stable output on all future and past MonetDB versions.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
646
diff
changeset
|
4559 // the UNLOGGED TABLE type is ADDED in post Jan2022 releases, so filter it out for a stable output on all releases |
8d7c75cc01e3
Adapt test for getTableTypes(). Filter out UNLOGGED TABLE value for stable output on all future and past MonetDB versions.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
646
diff
changeset
|
4560 if (! ("STREAM TABLE".equals(tt) || "UNLOGGED TABLE".equals(tt)) ) |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4561 sb.append(tt).append("\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
|
4562 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4564 } |
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
|
4565 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
|
4566 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4567 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
|
4568 } 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
|
4569 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
|
4570 } 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
|
4571 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
|
4572 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
|
4573 } 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
|
4574 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
|
4575 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4579 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
|
4580 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
|
4581 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
|
4582 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
|
4583 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
|
4584 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
|
4585 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
|
4586 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
|
4587 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
|
4588 } 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
|
4589 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
|
4590 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4593 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
|
4594 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4596 "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
|
4597 "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
|
4598 "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
|
4599 "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
|
4600 "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
|
4601 "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
|
4602 "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
|
4603 "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
|
4604 "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
|
4605 "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
|
4606 "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
|
4607 "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
|
4608 "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
|
4609 "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
|
4610 "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
|
4611 "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
|
4612 "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
|
4613 "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
|
4614 "_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
|
4615 "_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
|
4616 "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
|
4617 "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
|
4618 "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
|
4619 "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
|
4620 "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
|
4621 "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
|
4622 "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
|
4623 "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
|
4624 "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
|
4625 "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
|
4626 "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
|
4627 "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
|
4628 "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
|
4629 "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
|
4630 "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
|
4631 "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
|
4632 "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
|
4633 "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
|
4634 "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
|
4635 "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
|
4636 "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
|
4637 "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
|
4638 "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
|
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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4642 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
|
4643 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4645 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
|
4646 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
|
4647 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
|
4648 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
|
4649 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
|
4650 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
|
4651 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
|
4652 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
|
4653 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
|
4654 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
|
4655 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
|
4656 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
|
4657 } 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
|
4658 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
|
4659 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4662 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4664 "_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
|
4665 "_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
|
4666 "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
|
4667 "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
|
4668 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4671 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
|
4672 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4674 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
|
4675 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
|
4676 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
|
4677 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
|
4678 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
|
4679 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
|
4680 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4682 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
|
4683 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
|
4684 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
|
4685 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
|
4686 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
|
4687 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
|
4688 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
|
4689 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4691 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
|
4692 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
|
4693 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
|
4694 } 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
|
4695 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
|
4696 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4698 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
|
4699 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4701 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
|
4702 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
|
4703 } 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
|
4704 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
|
4705 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4707 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4709 "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
|
4710 "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
|
4711 "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
|
4712 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4715 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
|
4716 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4718 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
|
4719 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
|
4720 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
|
4721 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
|
4722 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
|
4723 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4725 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
|
4726 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
|
4727 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4729 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
|
4730 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
|
4731 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
|
4732 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
|
4733 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
|
4734 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
|
4735 } 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
|
4736 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
|
4737 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4739 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4741 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
|
4742 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
|
4743 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
|
4744 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
|
4745 } 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
|
4746 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
|
4747 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4750 "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
|
4751 "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
|
4752 "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
|
4753 "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
|
4754 "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
|
4755 "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
|
4756 "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
|
4757 "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
|
4758 "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
|
4759 "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
|
4760 "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
|
4761 "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
|
4762 "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
|
4763 "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
|
4764 "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
|
4765 "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
|
4766 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4769 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
|
4770 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
|
4771 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
|
4772 } 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
|
4773 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
|
4774 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4777 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
|
4778 } 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
|
4779 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
|
4780 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4784 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
|
4785 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4787 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
|
4788 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
|
4789 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
|
4790 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
|
4791 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4793 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
|
4794 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
|
4795 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
|
4796 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4798 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4800 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
|
4801 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4803 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
|
4804 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
|
4805 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4806 st.setQueryTimeout(7); |
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
|
4807 con.isValid(3); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4808 sb.append("getQueryTimeout must give 7: ").append(st.getQueryTimeout()).append("\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
|
4809 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
|
4810 } 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
|
4811 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
|
4812 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4814 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
|
4815 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4817 "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
|
4818 "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
|
4819 "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
|
4820 "getQueryTimeout must give 0: 0\n" + |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4821 "getQueryTimeout must give 7: 7\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
|
4822 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4828 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
|
4829 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
|
4830 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
|
4831 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
|
4832 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
|
4833 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
|
4834 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
|
4835 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
|
4836 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4838 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
|
4839 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
|
4840 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
|
4841 // 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
|
4842 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
|
4843 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
|
4844 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
|
4845 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
|
4846 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
|
4847 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
|
4848 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
|
4849 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
|
4850 } 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
|
4851 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
|
4852 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4854 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4855 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
|
4856 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
|
4857 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
|
4858 } 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
|
4859 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
|
4860 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4861 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4863 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
|
4864 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
|
4865 } 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
|
4866 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
|
4867 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
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
|
4869 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
|
4870 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4872 "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
|
4873 "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
|
4874 "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
|
4875 "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
|
4876 "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
|
4877 "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
|
4878 "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
|
4879 "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
|
4880 "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
|
4881 "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
|
4882 "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
|
4883 "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
|
4884 "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
|
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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4888 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
|
4889 "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
|
4890 + "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
|
4891 + "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
|
4892 + "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
|
4893 + "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
|
4894 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
|
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 // 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
|
4897 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
|
4898 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
|
4899 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
|
4900 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
|
4901 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
|
4902 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
|
4903 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
|
4904 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4907 } |
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
|
4908 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
|
4909 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 // 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
|
4911 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
|
4912 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
|
4913 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
|
4914 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
|
4915 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
|
4916 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
|
4917 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
|
4918 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
|
4919 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
|
4920 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
|
4921 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4925 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
|
4926 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4927 // 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
|
4928 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
|
4929 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
|
4930 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
|
4931 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
|
4932 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
|
4933 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
|
4934 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
|
4935 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
|
4936 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
|
4937 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
|
4938 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
|
4939 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
|
4940 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
|
4941 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
|
4942 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4943 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4944 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
|
4945 } |
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
|
4946 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
|
4947 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4948 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4949 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
|
4950 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
|
4951 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
|
4952 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
|
4953 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
|
4954 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
|
4955 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
|
4956 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
|
4957 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
|
4958 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
|
4959 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
|
4960 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
|
4961 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
|
4962 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4963 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
|
4964 } 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
|
4965 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
|
4966 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
|
4967 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
|
4968 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4969 } 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
|
4970 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4971 /* 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
|
4972 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
|
4973 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
|
4974 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
|
4975 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
|
4976 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
|
4977 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
|
4978 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4979 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4980 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
|
4981 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
|
4982 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4983 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
|
4984 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
|
4985 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
|
4986 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
|
4987 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
|
4988 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
|
4989 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
|
4990 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
|
4991 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
|
4992 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4993 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
|
4994 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
|
4995 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
|
4996 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
|
4997 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
|
4998 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4999 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
|
5000 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
|
5001 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
|
5002 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
|
5003 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5004 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
|
5005 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
|
5006 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
|
5007 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
|
5008 } 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
|
5009 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
|
5010 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5011 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5012 // 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
|
5013 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
|
5014 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
|
5015 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
|
5016 } 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
|
5017 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
|
5018 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5019 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
|
5020 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
|
5021 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5022 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
|
5023 "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
|
5024 "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
|
5025 "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
|
5026 "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
|
5027 "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
|
5028 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5029 |
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
|
5030 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
|
5031 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
|
5032 |
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
|
5033 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
|
5034 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
|
5035 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
|
5036 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
|
5037 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
|
5038 // >> 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
|
5039 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
|
5040 |
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
|
5041 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
|
5042 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
|
5043 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
|
5044 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
|
5045 |
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
|
5046 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
|
5047 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
|
5048 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
|
5049 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
|
5050 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
|
5051 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
|
5052 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
|
5053 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
|
5054 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
|
5055 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
|
5056 |
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
|
5057 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
|
5058 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
|
5059 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
|
5060 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
|
5061 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
|
5062 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
|
5063 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
|
5064 } |
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
|
5065 |
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
|
5066 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
|
5067 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
|
5068 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
|
5069 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
|
5070 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
|
5071 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
|
5072 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
|
5073 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
|
5074 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
|
5075 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
|
5076 |
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
|
5077 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
|
5078 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
|
5079 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
|
5080 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
|
5081 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
|
5082 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
|
5083 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
|
5084 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
|
5085 |
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
|
5086 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
|
5087 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
|
5088 pstmt.setString(2, "row " + row); |
494
56f24eb8ca43
Use valid json
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
488
diff
changeset
|
5089 pstmt.setObject(3, "[3.1415E-06]"); |
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
|
5090 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
|
5091 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
|
5092 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
|
5093 } 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
|
5094 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
|
5095 } |
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
|
5096 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
|
5097 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
|
5098 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
|
5099 |
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
|
5100 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
|
5101 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
|
5102 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
|
5103 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
|
5104 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
|
5105 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
|
5106 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
|
5107 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
|
5108 |
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
|
5109 /* 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
|
5110 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
|
5111 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
|
5112 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
|
5113 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
|
5114 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
|
5115 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
|
5116 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
|
5117 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
|
5118 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
|
5119 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
|
5120 |
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
|
5121 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
|
5122 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
|
5123 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
|
5124 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
|
5125 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
|
5126 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
|
5127 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
|
5128 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
|
5129 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
|
5130 } 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
|
5131 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
|
5132 } |
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
|
5133 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
|
5134 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
|
5135 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
|
5136 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
|
5137 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
|
5138 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
|
5139 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5140 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
|
5141 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
|
5142 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
|
5143 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
|
5144 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
|
5145 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
|
5146 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
|
5147 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
|
5148 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
|
5149 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
|
5150 } |
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
|
5151 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
|
5152 } |
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
|
5153 } 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
|
5154 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
|
5155 } |
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
|
5156 |
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
|
5157 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
|
5158 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
|
5159 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
|
5160 } 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
|
5161 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
|
5162 } |
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
|
5163 |
437
1333c19b0c1b
include missing )
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
436
diff
changeset
|
5164 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
|
5165 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
|
5166 |
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
|
5167 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
|
5168 "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
|
5169 "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
|
5170 "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
|
5171 "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
|
5172 "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
|
5173 " 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
|
5174 " 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
|
5175 " 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
|
5176 " 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
|
5177 " 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
|
5178 " 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
|
5179 "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
|
5180 "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
|
5181 "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
|
5182 "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
|
5183 "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
|
5184 "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
|
5185 "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
|
5186 "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
|
5187 "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
|
5188 "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
|
5189 "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
|
5190 "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
|
5191 "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
|
5192 "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
|
5193 "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
|
5194 "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
|
5195 "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
|
5196 "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
|
5197 "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
|
5198 "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
|
5199 " \"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
|
5200 " \"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
|
5201 " \"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
|
5202 " \"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
|
5203 " {\"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
|
5204 " {\"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
|
5205 " {\"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
|
5206 " ]\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
|
5207 " }\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
|
5208 "}} 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
|
5209 "row 7 7 row 7 null 4a148b7d-8d47-4e1e-a21e-09a71abf2215 null null\n" + |
494
56f24eb8ca43
Use valid json
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
488
diff
changeset
|
5210 "row 8 8 row 8 [3.1415E-06] null https://www.cwi.nl/ null\n" + |
56f24eb8ca43
Use valid json
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
488
diff
changeset
|
5211 "row 9 9 row 9 [3.1415E-06] null null 127.255.255.255\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
|
5212 "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
|
5213 " \"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
|
5214 " \"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
|
5215 " {\"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
|
5216 " {\"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
|
5217 " 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
|
5218 " {\"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
|
5219 " {\"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
|
5220 " {\"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
|
5221 " 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
|
5222 " {\"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
|
5223 " {\"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
|
5224 " {\"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
|
5225 " 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
|
5226 " {\"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
|
5227 " {\"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
|
5228 " ]\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
|
5229 "}}] 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
|
5230 "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
|
5231 "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
|
5232 } |
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
|
5233 |
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
|
5234 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
|
5235 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
|
5236 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5237 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
|
5238 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
|
5239 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
|
5240 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
|
5241 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
|
5242 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
|
5243 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5244 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
|
5245 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
|
5246 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
|
5247 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
|
5248 |
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
|
5249 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
|
5250 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5251 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
|
5252 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
|
5253 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
|
5254 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
|
5255 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
|
5256 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
|
5257 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
|
5258 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
|
5259 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5260 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
|
5261 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
|
5262 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
|
5263 } |
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
|
5264 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
|
5265 } 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
|
5266 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
|
5267 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
|
5268 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
|
5269 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5270 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5271 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
|
5272 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
|
5273 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
|
5274 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
|
5275 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5276 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
|
5277 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
|
5278 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
|
5279 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
|
5280 |
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
|
5281 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
|
5282 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
|
5283 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
|
5284 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
|
5285 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
|
5286 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
|
5287 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5288 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
|
5289 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
|
5290 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5291 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
|
5292 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
|
5293 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
|
5294 } |
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
|
5295 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
|
5296 } 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
|
5297 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
|
5298 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
|
5299 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
|
5300 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5301 } 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
|
5302 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
|
5303 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5304 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5305 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
|
5306 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
|
5307 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
|
5308 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
|
5309 } 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
|
5310 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
|
5311 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5312 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5313 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
|
5314 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
|
5315 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5316 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
|
5317 "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
|
5318 "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
|
5319 "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
|
5320 "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
|
5321 "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
|
5322 "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
|
5323 "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
|
5324 "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
|
5325 "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
|
5326 "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
|
5327 "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
|
5328 "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
|
5329 "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
|
5330 "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
|
5331 "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
|
5332 "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
|
5333 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5334 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5335 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
|
5336 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
|
5337 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5338 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
|
5339 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
|
5340 , "\"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
|
5341 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
|
5342 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
|
5343 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
|
5344 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
|
5345 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
|
5346 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
|
5347 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
|
5348 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
|
5349 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
|
5350 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
|
5351 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5352 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
|
5353 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5354 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
|
5355 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
|
5356 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
|
5357 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
|
5358 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
|
5359 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5360 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
|
5361 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
|
5362 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
|
5363 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
|
5364 |
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
|
5365 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
|
5366 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
|
5367 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
|
5368 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
|
5369 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
|
5370 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
|
5371 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
|
5372 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
|
5373 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
|
5374 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5375 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
|
5376 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
|
5377 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
|
5378 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
|
5379 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5380 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
|
5381 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
|
5382 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
|
5383 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
|
5384 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
|
5385 // 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
|
5386 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
|
5387 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
|
5388 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
|
5389 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
|
5390 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5391 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
|
5392 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
|
5393 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
|
5394 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
|
5395 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5396 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
|
5397 "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
|
5398 "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
|
5399 "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
|
5400 " 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
|
5401 "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
|
5402 "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
|
5403 "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
|
5404 "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
|
5405 "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
|
5406 "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
|
5407 "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
|
5408 "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
|
5409 "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
|
5410 "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
|
5411 "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
|
5412 "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
|
5413 "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
|
5414 "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
|
5415 "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
|
5416 "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
|
5417 "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
|
5418 "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
|
5419 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
|
5420 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5421 // 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
|
5422 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
|
5423 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
|
5424 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
|
5425 "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
|
5426 "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
|
5427 " 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
|
5428 "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
|
5429 "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
|
5430 "\"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
|
5431 "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
|
5432 "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
|
5433 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
|
5434 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5435 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
|
5436 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
|
5437 "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
|
5438 "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
|
5439 " 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
|
5440 "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
|
5441 "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
|
5442 "\"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
|
5443 "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
|
5444 "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
|
5445 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
|
5446 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5447 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
|
5448 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
|
5449 "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
|
5450 "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
|
5451 " 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
|
5452 "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
|
5453 "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
|
5454 "\"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
|
5455 "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
|
5456 "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
|
5457 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
|
5458 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5459 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
|
5460 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
|
5461 "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
|
5462 "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
|
5463 " 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
|
5464 "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
|
5465 "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
|
5466 "\"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
|
5467 "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
|
5468 "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
|
5469 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
|
5470 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5471 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
|
5472 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
|
5473 "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
|
5474 "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
|
5475 " 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
|
5476 "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
|
5477 "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
|
5478 "\"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
|
5479 "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
|
5480 "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
|
5481 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
|
5482 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5483 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
|
5484 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
|
5485 "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
|
5486 "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
|
5487 " 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
|
5488 "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
|
5489 "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
|
5490 "\"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
|
5491 "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
|
5492 "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
|
5493 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
|
5494 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5495 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
|
5496 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
|
5497 "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
|
5498 "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
|
5499 " 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
|
5500 "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
|
5501 "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
|
5502 "\"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
|
5503 "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
|
5504 "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
|
5505 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
|
5506 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5507 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
|
5508 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
|
5509 "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
|
5510 "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
|
5511 " 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
|
5512 "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
|
5513 "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
|
5514 "\"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
|
5515 "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
|
5516 "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
|
5517 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
|
5518 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5519 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
|
5520 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
|
5521 "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
|
5522 "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
|
5523 " 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
|
5524 "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
|
5525 "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
|
5526 "\"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
|
5527 "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
|
5528 "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
|
5529 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
|
5530 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5531 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
|
5532 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
|
5533 "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
|
5534 "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
|
5535 " 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
|
5536 "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
|
5537 "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
|
5538 "\" \"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5539 " \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5540 "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
|
5541 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
|
5542 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5543 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
|
5544 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
|
5545 "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
|
5546 "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
|
5547 " 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
|
5548 "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
|
5549 "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
|
5550 "\"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
|
5551 "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
|
5552 "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
|
5553 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
|
5554 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5555 // 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
|
5556 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
|
5557 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
|
5558 "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
|
5559 "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
|
5560 " 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
|
5561 "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
|
5562 "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
|
5563 "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
|
5564 "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
|
5565 "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
|
5566 "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
|
5567 "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
|
5568 "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
|
5569 "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
|
5570 "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
|
5571 "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
|
5572 "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
|
5573 "\"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
|
5574 "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
|
5575 "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
|
5576 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
|
5577 } 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
|
5578 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
|
5579 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5580 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5581 // 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
|
5582 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
|
5583 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
|
5584 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
|
5585 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
|
5586 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
|
5587 } 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
|
5588 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
|
5589 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5590 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5591 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
|
5592 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5593 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
|
5594 "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
|
5595 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5596 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5597 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
|
5598 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
|
5599 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
|
5600 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
|
5601 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5602 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5603 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
|
5604 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
|
5605 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
|
5606 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
|
5607 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
|
5608 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
|
5609 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
|
5610 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5611 |
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
|
5612 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
|
5613 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
|
5614 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
|
5615 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
|
5616 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
|
5617 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
|
5618 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
|
5619 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
|
5620 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5621 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
|
5622 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5623 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
|
5624 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
|
5625 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5626 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5627 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
|
5628 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
|
5629 |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5630 int originalQueryTimeout = 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
|
5631 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
|
5632 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
|
5633 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
|
5634 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
|
5635 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
|
5636 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5637 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
|
5638 testTimeout_3357(st, 123456); |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5639 testTimeout_3357(st, 2147483); |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5640 testTimeout_3357(st, 2147484); |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5641 testTimeout_3357(st, Integer.MAX_VALUE); |
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
|
5642 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
|
5643 testTimeout_3357(st, 10); |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5644 testTimeout_3357(st, 1); |
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
|
5645 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
|
5646 } catch (SQLException se) { |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5647 sb.append("SQLException: setQueryTimeout(timeout_value) throws: ").append(se).append("\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
|
5648 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5649 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5650 // 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
|
5651 try { |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5652 sb.append("Restore original QueryTimeout = ").append(originalQueryTimeout).append("\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
|
5653 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
|
5654 } 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
|
5655 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
|
5656 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5657 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
|
5658 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5659 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
|
5660 "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
|
5661 "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
|
5662 "setQueryTimeout = 123456. getQueryTimeout = 123456\n" + |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5663 "setQueryTimeout = 2147483. getQueryTimeout = 2147483\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5664 "setQueryTimeout = 2147484. getQueryTimeout = 2147484\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5665 "setQueryTimeout = 2147483647. getQueryTimeout = 2147483647\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
|
5666 "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
|
5667 "setQueryTimeout = 10. getQueryTimeout = 10\n" + |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5668 "setQueryTimeout = 1. getQueryTimeout = 1\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5669 "setQueryTimeout = -1. SQLException: setQueryTimeout(timeout_value) throws: java.sql.SQLException: Illegal timeout value: -1\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
5670 "Restore original QueryTimeout = 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
|
5671 "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
|
5672 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5673 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5674 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
|
5675 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
|
5676 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
|
5677 // 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
|
5678 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
|
5679 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
|
5680 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
|
5681 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
|
5682 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5683 |
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
|
5684 /** |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5685 * 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
|
5686 * 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
|
5687 * 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
|
5688 * |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5689 * @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
|
5690 */ |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5691 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
|
5692 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
|
5693 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5694 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
|
5695 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
|
5696 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
|
5697 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
|
5698 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
|
5699 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
|
5700 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5701 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
|
5702 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5703 // 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
|
5704 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
|
5705 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
|
5706 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
|
5707 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
|
5708 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
|
5709 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
|
5710 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
|
5711 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
|
5712 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5713 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
|
5714 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
|
5715 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5716 } 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
|
5717 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
|
5718 } 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
|
5719 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
|
5720 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5721 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5722 // 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
|
5723 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
|
5724 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
|
5725 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
|
5726 } 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
|
5727 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
|
5728 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5729 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
|
5730 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5731 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
|
5732 "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
|
5733 "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
|
5734 "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
|
5735 "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
|
5736 "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
|
5737 "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
|
5738 "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
|
5739 "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
|
5740 "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
|
5741 "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
|
5742 "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
|
5743 "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
|
5744 "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
|
5745 "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
|
5746 "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
|
5747 "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
|
5748 "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
|
5749 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5750 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5751 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
|
5752 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
|
5753 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5754 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
|
5755 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
|
5756 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
|
5757 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5758 // 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
|
5759 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
|
5760 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
|
5761 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
|
5762 String passw = con.getClientInfo("password"); |
586
ac5e97fc812d
Make SQLcopyinto test work onder monetdbd
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
494
diff
changeset
|
5763 |
ac5e97fc812d
Make SQLcopyinto test work onder monetdbd
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
494
diff
changeset
|
5764 String database = con.getClientInfo("database"); |
ac5e97fc812d
Make SQLcopyinto test work onder monetdbd
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
494
diff
changeset
|
5765 server.setDatabase(database); |
ac5e97fc812d
Make SQLcopyinto test work onder monetdbd
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
494
diff
changeset
|
5766 |
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
|
5767 // 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
|
5768 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
|
5769 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
|
5770 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
|
5771 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
|
5772 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
|
5773 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5774 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5775 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
|
5776 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5777 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
|
5778 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
|
5779 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5780 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
|
5781 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
|
5782 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
|
5783 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5784 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
|
5785 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5786 // 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
|
5787 // 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
|
5788 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
|
5789 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
|
5790 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
|
5791 // 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
|
5792 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
|
5793 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
|
5794 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
|
5795 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5796 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
|
5797 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5798 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
|
5799 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
|
5800 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
|
5801 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5802 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
|
5803 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5804 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
|
5805 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
|
5806 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
|
5807 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5808 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
|
5809 } 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
|
5810 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
|
5811 } 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
|
5812 // 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
|
5813 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
|
5814 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5815 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5816 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
|
5817 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5818 |
664
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5819 private void DecimalPrecisionAndScale() { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5820 sb.setLength(0); // clear the output log buffer |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5821 |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5822 Statement stmt = null; |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5823 ResultSet rs = null; |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5824 try { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5825 stmt = con.createStatement(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5826 rs = stmt.executeQuery( |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5827 "select" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5828 " cast(123456789 as DECIMAL(18,0)) as dec1800" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5829 ", cast(123456789.0 as DECIMAL(18,1)) as dec1801" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5830 ", cast(123456789.0 as DECIMAL(18,2)) as dec1802" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5831 ", cast(123456789.0 as DECIMAL(18,3)) as dec1803" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5832 ", cast(123456789.0 as DECIMAL(18,4)) as dec1804" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5833 ", cast(123456789.0 as DECIMAL(18,5)) as dec1805" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5834 ", cast(123456789.0 as DECIMAL(18,6)) as dec1806" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5835 ", cast(123456789.0 as DECIMAL(18,7)) as dec1807" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5836 ", cast(123456789.0 as DECIMAL(18,8)) as dec1808" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5837 ", cast(123456789.0 as DECIMAL(18,9)) as dec1809" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5838 ", cast(12345678.9 as DECIMAL(18,10)) as dec1810" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5839 ", cast(1234567.89 as DECIMAL(18,11)) as dec1811" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5840 ", cast(123456.789 as DECIMAL(18,12)) as dec1812;"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5841 if (rs != null) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5842 ResultSetMetaData rsmd = rs.getMetaData(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5843 final int rscolcnt = rsmd.getColumnCount(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5844 sb.append("Query has ").append(rscolcnt).append(" columns:\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5845 sb.append("colnr\tlabel\ttypenm\tdisplaylength\tprecision\tscale\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5846 for (int col = 1; col <= rscolcnt; col++) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5847 sb.append("col ").append(col); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5848 sb.append("\t").append(rsmd.getColumnLabel(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5849 sb.append("\t").append(rsmd.getColumnTypeName(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5850 sb.append("\t").append(rsmd.getColumnDisplaySize(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5851 sb.append("\t").append(rsmd.getPrecision(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5852 sb.append("\t").append(rsmd.getScale(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5853 sb.append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5854 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5855 sb.append("Values\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5856 while (rs.next()) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5857 sb.append("colnr\tasString\tasBigDecimal\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5858 for (int col = 1; col <= rscolcnt; col++) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5859 sb.append("col ").append(col); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5860 sb.append("\t").append(rs.getString(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5861 sb.append("\t").append(rs.getBigDecimal(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5862 sb.append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5863 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5864 sb.append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5865 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5866 rs.close(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5867 rs = null; |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5868 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5869 } catch (SQLException se) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5870 sb.append("SQLException: ").append(se.getMessage()).append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5871 } catch (Exception e) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5872 sb.append("Exception: ").append(e.getMessage()).append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5873 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5874 closeStmtResSet(stmt, rs); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5875 |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5876 // The precision should be 18 and the scale should be from 0 to 12. |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5877 compareExpectedOutput("DecimalPrecisionAndScale()", |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5878 "Query has 13 columns:\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5879 "colnr label typenm displaylength precision scale\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5880 "col 1 dec1800 decimal 19 18 0\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5881 "col 2 dec1801 decimal 20 18 1\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5882 "col 3 dec1802 decimal 20 18 2\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5883 "col 4 dec1803 decimal 20 18 3\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5884 "col 5 dec1804 decimal 20 18 4\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5885 "col 6 dec1805 decimal 20 18 5\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5886 "col 7 dec1806 decimal 20 18 6\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5887 "col 8 dec1807 decimal 20 18 7\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5888 "col 9 dec1808 decimal 20 18 8\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5889 "col 10 dec1809 decimal 20 18 9\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5890 "col 11 dec1810 decimal 20 18 10\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5891 "col 12 dec1811 decimal 20 18 11\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
5892 "col 13 dec1812 decimal 20 18 12\n" + |
664
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5893 "Values\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5894 "colnr asString asBigDecimal\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5895 "col 1 123456789 123456789\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5896 "col 2 123456789.0 123456789.0\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5897 "col 3 123456789.00 123456789.00\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5898 "col 4 123456789.000 123456789.000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5899 "col 5 123456789.0000 123456789.0000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5900 "col 6 123456789.00000 123456789.00000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5901 "col 7 123456789.000000 123456789.000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5902 "col 8 123456789.0000000 123456789.0000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5903 "col 9 123456789.00000000 123456789.00000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5904 "col 10 123456789.000000000 123456789.000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5905 "col 11 12345678.9000000000 12345678.9000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5906 "col 12 1234567.89000000000 1234567.89000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5907 "col 13 123456.789000000000 123456.789000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5908 "\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
5909 } |
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
|
5910 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5911 // 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
|
5912 private void showTblContents(String tblnm) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5913 Statement stmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5914 ResultSet rs = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5915 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5916 stmt = con.createStatement(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5917 rs = stmt.executeQuery("SELECT * FROM " + tblnm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5918 if (rs != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5919 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
|
5920 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
|
5921 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
|
5922 sb.append("\t").append(rsmd.getColumnLabel(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5923 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5924 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5925 while (rs.next()) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5926 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
|
5927 sb.append("\t").append(rs.getString(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5928 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5929 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5930 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5931 } else |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5932 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
|
5933 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5934 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
|
5935 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5936 closeStmtResSet(stmt, rs); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5937 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5938 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5939 private void showParams(PreparedStatement pstmt) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5940 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5941 // testing and showing parameter meta data |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5942 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5943 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
|
5944 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
|
5945 sb.append("Param ").append(parm).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5946 int nullable = pmd.isNullable(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5947 sb.append(" nullable ").append(nullable).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5948 switch (nullable) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5949 case ParameterMetaData.parameterNoNulls: sb.append("NO"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5950 case ParameterMetaData.parameterNullable: sb.append("YA"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5951 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
|
5952 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
|
5953 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5954 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5955 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
|
5956 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
|
5957 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
|
5958 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
|
5959 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
|
5960 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
|
5961 int mode = pmd.getParameterMode(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5962 sb.append(" mode ").append(mode).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5963 switch (mode) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5964 case ParameterMetaData.parameterModeIn: sb.append("IN"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5965 case ParameterMetaData.parameterModeInOut: sb.append("INOUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5966 case ParameterMetaData.parameterModeOut: sb.append("OUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5967 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
|
5968 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
|
5969 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5970 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5971 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5972 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5973 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
|
5974 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5975 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5976 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5977 private void readExceptions(SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5978 while (e != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5979 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
|
5980 e = e.getNextException(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5981 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5982 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5983 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5984 private void readWarnings(SQLWarning w) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5985 while (w != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5986 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
|
5987 w = w.getNextWarning(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5988 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5989 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5990 |
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
|
5991 private void compareExpectedOutput(String testname, String expected) { |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
5992 final String produced = sb.toString(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
5993 if (!expected.equals(produced)) { |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5994 foundDifferences = true; |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5995 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
|
5996 System.err.print(testname); |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
5997 if (!testname.endsWith(")") && !testname.endsWith(";")) |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5998 System.err.print("()"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5999 System.err.println("' produced different output!"); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6000 int expLen = expected.length(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6001 int prodLen = produced.length(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6002 int max_pos = expLen; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6003 if (prodLen > max_pos) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6004 max_pos = prodLen; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6005 int line = 1; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6006 int rowpos = 0; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6007 for (int pos = 0; pos < max_pos; pos++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6008 char a = (pos < expLen ? expected.charAt(pos) : '~'); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6009 char b = (pos < prodLen ? produced.charAt(pos) : '~'); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6010 if (a == '\n') { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6011 line++; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6012 rowpos = 0; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6013 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6014 rowpos++; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6015 if (a != b) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6016 if (pos + 30 < expLen) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6017 expLen = pos + 30; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6018 if (pos + 30 < prodLen) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6019 prodLen = pos + 30; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6020 System.err.println("Difference found at line " + line + " position " + rowpos |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6021 + ": Expected \"" + expected.substring(pos < expLen ? pos : expLen-1, expLen-1) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6022 + "\" but gotten \"" + produced.substring(pos < prodLen ? pos : prodLen-1, prodLen-1) + "\""); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6023 pos = max_pos; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6024 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6025 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
6026 System.err.println(); |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
6027 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
|
6028 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
|
6029 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
|
6030 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
|
6031 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
|
6032 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
6033 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
|
6034 System.err.println("Test '" + testname |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
6035 + "' produced output > " + sbInitLen |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
6036 + " chars! Enlarge sbInitLen to: " + sb.length()); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
6037 } |
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
|
6038 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6039 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6040 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
|
6041 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
|
6042 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
|
6043 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
|
6044 } 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
|
6045 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6046 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6047 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6048 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
|
6049 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
|
6050 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
|
6051 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
|
6052 } 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
|
6053 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6054 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
|
6055 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
|
6056 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
|
6057 } 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
|
6058 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6059 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
6060 } |