Mercurial > hg > monetdb-java
annotate tests/JDBC_API_Tester.java @ 463:cde144382233
Remove output of Test_PStimezone which changes when summertime or wintertime is changing the default timezone.
This fixes the reported error on Oct2020 testweb.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 07 Apr 2021 20:04:51 +0200 (2021-04-07) |
parents | 333c3752e118 |
children | 3e28de1c4f81 |
rev | line source |
---|---|
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1 /* |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2 * This Source Code Form is subject to the terms of the Mozilla Public |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5 * |
406
bf9f6b6ecf40
Update Copyright year.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
404
diff
changeset
|
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V. |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7 */ |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
8 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
9 import java.sql.*; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
10 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
11 import java.io.StringReader; |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
12 import java.math.BigDecimal; |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
13 import java.math.BigInteger; |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
14 import java.nio.charset.Charset; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
15 import java.text.SimpleDateFormat; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
16 import java.util.ArrayList; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
17 import java.util.Calendar; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
18 import java.util.Iterator; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
19 import java.util.List; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
20 import java.util.TimeZone; |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
21 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
22 import org.monetdb.jdbc.types.INET; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
23 import org.monetdb.jdbc.types.URL; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
24 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
25 /** |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
26 * class to test JDBC Driver API methods and behavior of MonetDB server. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
27 * |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
28 * It combines 40+ tests which were previous individual test programs |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
29 * into one large test program, reusing the connection. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
30 * This speeds up testing considerably as the overhead of starting a JVM and |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
31 * loading the java test program class and MonetDB JDBC driver is now reduced |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
32 * to only one time instead of 40+ times. |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
33 * Also all output is no longer send to system out/err but collected in a StringBuilder. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
34 * The contents of it is compared with the expected output at the end of each test. |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
35 * Only when it deviates the output is sent to system out, see compareExpectedOutput(). |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
44 |
0eef53e06007
Add JDBC_API_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 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
|
46 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
|
47 |
0eef53e06007
Add JDBC_API_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 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
|
49 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
|
50 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
|
51 // 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
|
52 |
0eef53e06007
Add JDBC_API_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 // 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 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
|
59 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
|
60 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
|
61 jt.Test_Dobjects(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
62 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
|
63 jt.Test_Int128(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
64 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
|
65 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
|
66 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
|
67 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
|
68 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
|
69 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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 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
|
96 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
|
97 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
|
98 jt.SQLcopyinto(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
99 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
100 jt.closeConx(jt.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
|
101 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
102 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
103 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
|
104 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
|
105 |
0eef53e06007
Add JDBC_API_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 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
|
107 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
|
108 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
|
109 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
|
110 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
|
111 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
|
112 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
|
113 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
114 // >> 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
|
115 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
|
116 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
|
117 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
|
118 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
|
119 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
120 // 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
|
121 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
|
122 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
|
123 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
|
124 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
|
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 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
|
127 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
|
128 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
|
129 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
|
130 } 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
140 // 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
|
141 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
|
142 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
|
143 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
144 // >> 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
150 // 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
|
151 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
|
152 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
|
153 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
|
154 |
0eef53e06007
Add JDBC_API_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 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
|
156 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
|
157 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
|
158 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
159 sb.append("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
|
160 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
|
161 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
|
162 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
163 sb.append("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
|
164 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
|
165 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
|
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 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
|
168 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
|
169 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
|
170 |
0eef53e06007
Add JDBC_API_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 // 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
|
172 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
|
173 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
|
174 } 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
|
175 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
|
176 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
177 |
0eef53e06007
Add JDBC_API_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 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
|
179 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
|
180 |
0eef53e06007
Add JDBC_API_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 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
|
182 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
183 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
|
184 "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
|
185 "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
|
186 "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
|
187 "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
|
188 "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
|
189 "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
|
190 "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
|
191 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
194 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
|
195 |
0eef53e06007
Add JDBC_API_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 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
|
197 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
|
198 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
|
199 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
|
200 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
|
201 } 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
|
202 // e.printStackTrace(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
203 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
|
204 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
|
205 // test calling conn.isValid() |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
206 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
|
207 // 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
|
208 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
|
209 } catch (SQLException e2) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
210 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
|
211 } |
0eef53e06007
Add JDBC_API_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 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
215 // 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
|
216 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
|
217 } 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
|
218 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
|
219 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
220 |
0eef53e06007
Add JDBC_API_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 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
|
222 |
0eef53e06007
Add JDBC_API_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 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
|
224 "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
|
225 "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
|
226 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
227 |
0eef53e06007
Add JDBC_API_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 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
|
229 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
|
230 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
|
231 "-- 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
|
232 "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
|
233 "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
|
234 "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
|
235 "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
|
236 "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
|
237 "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
|
238 "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
|
239 "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
|
240 "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
|
241 "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
|
242 "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
|
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 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
|
245 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
|
246 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
|
247 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
|
248 } |
0eef53e06007
Add JDBC_API_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 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
|
251 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
|
252 // >> 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
|
253 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
|
254 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
|
255 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
256 // 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
|
257 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
|
258 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
|
259 |
0eef53e06007
Add JDBC_API_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 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
|
261 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
|
262 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
|
263 } |
0eef53e06007
Add JDBC_API_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 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
|
265 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
|
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 if (i != size) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
268 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
|
269 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
270 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
|
271 } 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
|
272 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
|
273 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
276 |
0eef53e06007
Add JDBC_API_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 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
|
278 "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
|
279 "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
|
280 "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
|
281 } |
0eef53e06007
Add JDBC_API_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 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
|
284 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
|
285 |
0eef53e06007
Add JDBC_API_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 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
|
287 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
|
288 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
|
289 // 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
|
290 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
|
291 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
|
292 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
|
293 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
|
294 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
|
295 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
|
296 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
|
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 // 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
|
299 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
|
300 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
|
301 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
|
302 } |
0eef53e06007
Add JDBC_API_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 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
|
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 // 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 // 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
|
311 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
|
312 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
|
313 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
|
314 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
|
315 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
|
316 } |
0eef53e06007
Add JDBC_API_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 } 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
|
318 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
|
319 } |
0eef53e06007
Add JDBC_API_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 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
|
322 "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
|
323 "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
|
324 "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
|
325 "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
|
326 "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
|
327 "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
|
328 "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
|
329 "11, 12, 13, 14, 15, 16, 17, 18, 19, 20, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
330 "21, 22, 23, 24, 25, 26, 27, 28, 29, 30, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
331 "31, 32, 33, 34, 35, 36, 37, 38, 39, 40, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
332 "41, 42, 43, 44, 45, 46, 47, 48, 49, 50, " + |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
333 "51, 52, 53, 54, 55, 56, 57, 58, 59, 60, "); |
0eef53e06007
Add JDBC_API_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 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
337 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
|
338 |
0eef53e06007
Add JDBC_API_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 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
|
340 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
|
341 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
|
342 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
|
343 // >> 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
|
344 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
|
345 |
0eef53e06007
Add JDBC_API_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 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
|
347 // 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
|
348 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
|
349 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
|
350 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
|
351 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
352 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
|
353 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
|
354 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
|
355 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
|
356 |
0eef53e06007
Add JDBC_API_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 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
|
358 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
|
359 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
|
360 |
0eef53e06007
Add JDBC_API_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 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
|
362 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
|
363 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
|
364 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
|
365 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
|
366 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
|
367 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
|
368 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
|
369 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
370 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
|
371 } |
0eef53e06007
Add JDBC_API_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 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
|
373 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
374 sb.append("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
|
375 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
|
376 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
|
377 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
378 sb.append("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
|
379 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
|
380 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
|
381 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
382 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
|
383 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
|
384 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
|
385 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
|
386 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
|
387 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
|
388 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
|
389 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
|
390 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
391 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
|
392 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
393 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
|
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("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
|
396 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
|
397 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
|
398 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
399 sb.append("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
|
400 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
|
401 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
|
402 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
|
403 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
|
404 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
|
405 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
|
406 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
|
407 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
408 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
|
409 } |
0eef53e06007
Add JDBC_API_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 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
|
411 |
0eef53e06007
Add JDBC_API_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("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
|
413 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
|
414 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
|
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 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
|
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 // 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
|
419 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
|
420 } 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
|
421 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
|
422 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
423 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
424 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
|
425 |
0eef53e06007
Add JDBC_API_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 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
|
427 "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
|
428 "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
|
429 "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
|
430 "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
|
431 "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
|
432 "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
|
433 "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
|
434 "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
|
435 "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
|
436 "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
|
437 "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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
441 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
|
442 |
0eef53e06007
Add JDBC_API_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 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
|
444 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
|
445 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
|
446 // >> 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
|
447 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
|
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 // 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
|
450 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
|
451 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
|
452 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
|
453 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
|
454 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
455 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
|
456 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
457 sb.append("\n"); |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
460 // >> 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
|
461 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
|
462 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
463 sb.append("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
|
464 /* 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
|
465 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
|
466 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
|
467 |
0eef53e06007
Add JDBC_API_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 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
|
469 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
|
470 |
0eef53e06007
Add JDBC_API_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 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
|
472 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
|
473 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
|
474 |
0eef53e06007
Add JDBC_API_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 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
|
476 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
|
477 int items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
478 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
|
479 while (rs.next()) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
480 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
|
481 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
|
482 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
484 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
|
485 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
486 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
|
487 |
0eef53e06007
Add JDBC_API_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 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
|
489 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
|
490 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
|
491 |
0eef53e06007
Add JDBC_API_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 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
|
493 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
|
494 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
|
495 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
496 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
|
497 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
|
498 items = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
499 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
|
500 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
501 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
|
502 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
|
503 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
505 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
|
506 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
507 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
|
508 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
509 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
|
510 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
|
511 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
|
512 |
0eef53e06007
Add JDBC_API_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 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
|
514 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
|
515 items = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
516 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
|
517 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
518 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
|
519 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
|
520 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
522 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
|
523 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
524 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
|
525 |
0eef53e06007
Add JDBC_API_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 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
|
527 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
|
528 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
|
529 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
530 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
|
531 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
|
532 items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
533 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
|
534 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
535 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
|
536 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
|
537 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
539 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
|
540 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
541 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
|
542 |
0eef53e06007
Add JDBC_API_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 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
|
544 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
545 // 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
|
546 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
|
547 } 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
|
548 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
|
549 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
550 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
551 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
|
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 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
|
554 "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
|
555 "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
|
556 "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
|
557 "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
|
558 "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
|
559 "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
|
560 "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
|
561 "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
|
562 "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
|
563 "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
|
564 "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
|
565 "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
|
566 } |
0eef53e06007
Add JDBC_API_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 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
|
569 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
|
570 |
0eef53e06007
Add JDBC_API_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 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
|
572 // 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
|
573 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
|
574 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
|
575 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
|
576 } 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
|
577 // 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
|
578 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
|
579 } |
0eef53e06007
Add JDBC_API_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 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
|
581 |
0eef53e06007
Add JDBC_API_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 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
|
583 // 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
|
584 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
|
585 // >> 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
|
586 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
|
587 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
588 // 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
|
589 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
|
590 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
|
591 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
|
592 |
0eef53e06007
Add JDBC_API_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 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
|
594 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
|
595 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
|
596 |
0eef53e06007
Add JDBC_API_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 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
|
598 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
|
599 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
|
600 } 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
|
601 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
|
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 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
|
606 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
|
607 // 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
|
608 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
|
609 // >> 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
|
610 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
|
611 |
0eef53e06007
Add JDBC_API_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 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
|
613 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
|
614 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
|
615 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
|
616 |
0eef53e06007
Add JDBC_API_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 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
|
618 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
|
619 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
|
620 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
621 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
|
622 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
|
623 |
0eef53e06007
Add JDBC_API_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("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
|
625 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
|
626 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
|
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 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
|
629 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
|
630 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
|
631 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
632 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
|
633 } 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
|
634 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
|
635 } |
0eef53e06007
Add JDBC_API_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("\n"); |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
638 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
|
639 // 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
|
640 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
|
641 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
|
642 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
|
643 } 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
|
644 // 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
|
645 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
|
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("\n"); |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
649 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
|
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 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
|
652 "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
|
653 "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
|
654 "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
|
655 "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
|
656 "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
|
657 "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
|
658 "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
|
659 "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
|
660 "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
|
661 "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
|
662 "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
|
663 "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
|
664 "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
|
665 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
668 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
|
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 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
|
671 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
|
672 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
673 // 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
|
674 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
|
675 "Resultset with 1 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
676 "TABLE_CAT\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
677 |
0eef53e06007
Add JDBC_API_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 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
|
679 "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
|
680 "TABLE_SCHEM TABLE_CATALOG\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
681 "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
|
682 |
0eef53e06007
Add JDBC_API_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 compareResultSet(dbmd.getTables(null, "tmp", null, null), "getTables(null, tmp, null, null)", // schema tmp has 6 tables |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
684 "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
|
685 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
686 "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
|
687 "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
|
688 "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
|
689 "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
|
690 "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
|
691 "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
|
692 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
693 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
|
694 "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
|
695 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
696 "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
|
697 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
698 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
|
699 "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
|
700 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE IS_AUTOINCREMENT IS_GENERATEDCOLUMN\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
701 "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
|
702 "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
|
703 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
704 compareResultSet(dbmd.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
|
705 "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
|
706 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
707 "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
|
708 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
709 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
|
710 "Resultset with 14 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
711 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
712 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
713 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
|
714 "Resultset with 14 columns\n" + |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
715 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n"); |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
716 |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
717 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
|
718 "Resultset with 14 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
719 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
720 |
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
|
721 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
|
722 "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
|
723 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
724 "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
|
725 "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
|
726 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
727 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
|
728 "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
|
729 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
730 "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
|
731 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
732 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
|
733 "Resultset with 8 columns\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
734 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
735 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
736 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
|
737 "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
|
738 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
739 "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
|
740 "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
|
741 "null sys url org.monetdb.jdbc.types.URL 2000 url null\n" + |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
742 "null sys uuid java.lang.String 2000 uuid null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
743 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
744 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
|
745 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
|
746 "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
|
747 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
748 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
749 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
|
750 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
751 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
|
752 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
|
753 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
754 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
755 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
|
756 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
757 |
0eef53e06007
Add JDBC_API_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 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
|
759 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
|
760 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
761 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
|
762 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
|
763 sb.append("Resultset with ").append(columnCount).append(" columns\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
764 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
|
765 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
|
766 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
|
767 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
|
768 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
769 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
|
770 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
|
771 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
|
772 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
|
773 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
|
774 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
|
775 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
776 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
|
777 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
778 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
|
779 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
780 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
|
781 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
782 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
783 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
|
784 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
|
785 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
786 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
|
787 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
|
788 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
|
789 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
|
790 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
|
791 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
792 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
|
793 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
|
794 |
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
|
795 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
|
796 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
|
797 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
798 sb.append("Statement fetch size 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
|
799 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
|
800 |
0eef53e06007
Add JDBC_API_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 } 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
|
802 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
|
803 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
805 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
|
806 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
807 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
|
808 "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
|
809 "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
|
810 "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
|
811 "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
|
812 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
813 |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
814 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
|
815 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
|
816 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
817 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
|
818 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
|
819 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
820 // 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
|
821 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
|
822 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
823 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
|
824 // 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
|
825 rs = stmt.executeQuery("SELECT sqlname from sys.types where sqlname = 'hugeint';"); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
826 if (rs != null && rs.next()) { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
827 String sqlname = rs.getString(1); |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
828 if ("hugeint".equals(sqlname)) |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
829 supportsHugeInt = true; |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
830 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
831 } 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
|
832 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
|
833 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
834 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
835 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
|
836 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
|
837 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
|
838 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
|
839 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
840 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
841 // 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
|
842 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
|
843 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
844 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
|
845 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
|
846 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
847 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
|
848 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
|
849 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
850 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
|
851 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
|
852 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
|
853 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
|
854 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
855 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
|
856 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
857 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
|
858 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
|
859 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
|
860 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
|
861 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
|
862 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
|
863 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
|
864 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
865 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
866 rs = 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
|
867 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
|
868 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
|
869 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
|
870 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
|
871 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
|
872 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
|
873 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
874 } 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
|
875 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
|
876 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
877 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
878 // cleanup |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
879 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
880 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
|
881 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
|
882 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
|
883 } 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
|
884 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
|
885 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
886 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
|
887 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
|
888 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
889 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
|
890 "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
|
891 "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
|
892 "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
|
893 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
894 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
895 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
|
896 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
|
897 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
898 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
|
899 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
|
900 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
|
901 // >> 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
|
902 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
|
903 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
904 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
|
905 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
|
906 "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
|
907 " 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
|
908 " 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
|
909 ")"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
910 stmt.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
|
911 } 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
|
912 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
|
913 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
914 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
|
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 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
|
917 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
|
918 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
|
919 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
|
920 "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
|
921 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
|
922 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
923 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
|
924 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
|
925 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
|
926 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
|
927 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
|
928 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
929 // 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
|
930 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
|
931 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
|
932 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
|
933 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
|
934 } 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
|
935 while (keys.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
936 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
|
937 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
938 if (keys.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
|
939 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
|
940 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
941 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
|
942 } |
0eef53e06007
Add JDBC_API_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 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
|
944 } 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
|
945 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
|
946 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
947 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
|
948 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
949 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
|
950 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
|
951 // 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
|
952 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
|
953 } 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
|
954 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
|
955 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
956 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
957 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
|
958 "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
|
959 "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
|
960 "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
|
961 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
962 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
963 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
|
964 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
|
965 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
966 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
|
967 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
|
968 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
|
969 // >> 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
|
970 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
|
971 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
972 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
|
973 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
|
974 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
|
975 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
|
976 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
|
977 } 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
|
978 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
|
979 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
980 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
|
981 |
0eef53e06007
Add JDBC_API_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 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
|
983 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
|
984 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
|
985 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
|
986 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
|
987 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
|
988 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
|
989 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
|
990 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
|
991 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
|
992 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
993 pstmt.setShort(1, (short)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
|
994 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
|
995 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
|
996 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
|
997 pstmt.addBatch(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
998 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
999 pstmt.setShort(1, (short)-127); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1000 pstmt.setShort(2, (short)-12700); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1001 pstmt.setInt (3, -1270000); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1002 pstmt.setLong(4, (long)-127000000); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1003 pstmt.addBatch(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1004 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1005 pstmt.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
|
1006 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
|
1007 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
|
1008 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1009 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
|
1010 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
|
1011 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
|
1012 } 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
|
1013 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
|
1014 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
|
1015 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
|
1016 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1017 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1018 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
|
1019 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
|
1020 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
|
1021 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
|
1022 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
|
1023 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1024 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
|
1025 // 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
|
1026 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
|
1027 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
|
1028 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
|
1029 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
|
1030 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1031 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
|
1032 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1033 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1034 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
|
1035 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
|
1036 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
|
1037 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1038 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
|
1039 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
|
1040 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
|
1041 } 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
|
1042 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
|
1043 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
|
1044 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
|
1045 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1046 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
|
1047 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1048 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
|
1049 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
|
1050 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
|
1051 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
|
1052 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1053 // 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
|
1054 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
|
1055 } 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
|
1056 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
|
1057 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1058 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1059 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
|
1060 "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
|
1061 "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
|
1062 "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
|
1063 "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
|
1064 " 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
|
1065 " 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
|
1066 " 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
|
1067 " 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
|
1068 "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
|
1069 "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
|
1070 " 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
|
1071 " 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
|
1072 " 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
|
1073 "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
|
1074 "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
|
1075 "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
|
1076 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1077 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1078 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
|
1079 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
|
1080 |
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
|
1081 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
|
1082 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
|
1083 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
|
1084 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
|
1085 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
|
1086 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1087 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
|
1088 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1089 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
|
1090 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
|
1091 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
|
1092 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
|
1093 // >> 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
|
1094 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
|
1095 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1096 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
|
1097 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
|
1098 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
|
1099 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
|
1100 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1101 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
|
1102 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
|
1103 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
|
1104 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1105 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
|
1106 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
|
1107 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
|
1108 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
|
1109 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
|
1110 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
|
1111 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1112 /* 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
|
1113 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
|
1114 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
|
1115 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
|
1116 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
|
1117 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
|
1118 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
|
1119 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1120 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
|
1121 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
|
1122 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1123 pstmt.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
|
1124 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
|
1125 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
|
1126 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
|
1127 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
|
1128 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
|
1129 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1130 pstmt.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
|
1131 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1132 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
|
1133 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
|
1134 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
|
1135 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
|
1136 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
|
1137 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1138 sb.append("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
|
1139 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
|
1140 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
|
1141 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
|
1142 } 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
|
1143 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
|
1144 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
|
1145 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
|
1146 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1147 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
|
1148 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
|
1149 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1150 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
|
1151 "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
|
1152 "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
|
1153 "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
|
1154 "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
|
1155 "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
|
1156 "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
|
1157 "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
|
1158 "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
|
1159 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1160 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1161 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
|
1162 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
|
1163 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1164 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
|
1165 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
|
1166 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
|
1167 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1168 // 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
|
1169 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
|
1170 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
|
1171 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
|
1172 else |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1173 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
|
1174 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
|
1175 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1176 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
|
1177 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
|
1178 // 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
|
1179 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
|
1180 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
|
1181 } 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
|
1182 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
|
1183 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1184 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
|
1185 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1186 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
|
1187 "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
|
1188 "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
|
1189 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1190 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1191 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
|
1192 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
|
1193 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1194 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
|
1195 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
|
1196 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1197 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
|
1198 // 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
|
1199 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
|
1200 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
|
1201 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
|
1202 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
|
1203 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
|
1204 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
|
1205 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1206 // 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
|
1207 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
|
1208 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
|
1209 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1210 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
|
1211 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1212 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
|
1213 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1214 // 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
|
1215 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
|
1216 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
|
1217 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
|
1218 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
|
1219 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1220 // 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
|
1221 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
|
1222 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
|
1223 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
|
1224 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1225 ResultSet rs = pstmt.getResultSet(); |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1226 if (!rs.next()) |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1227 sb.append("ResultSet is empty"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1228 sb.append(" result: ").append(rs.getString(1)); |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1229 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1230 // 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
|
1231 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
|
1232 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
|
1233 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1234 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
|
1235 // 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
|
1236 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
|
1237 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
|
1238 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
|
1239 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
|
1240 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
|
1241 } 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
|
1242 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
|
1243 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1244 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
|
1245 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
|
1246 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
|
1247 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
1248 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1249 } 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
|
1250 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
|
1251 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1252 |
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
|
1253 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
|
1254 "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
|
1255 "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
|
1256 "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
|
1257 "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
|
1258 "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
|
1259 "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
|
1260 "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
|
1261 "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
|
1262 "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
|
1263 "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
|
1264 "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
|
1265 "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
|
1266 "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
|
1267 "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
|
1268 "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
|
1269 "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
|
1270 "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
|
1271 "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
|
1272 "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
|
1273 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1274 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1275 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
|
1276 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
|
1277 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1278 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
|
1279 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1280 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1281 // >> 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
|
1282 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
|
1283 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1284 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1285 int updates = 0; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1286 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
|
1287 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1288 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
|
1289 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1290 // all NULLs |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1291 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
|
1292 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1293 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
|
1294 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1295 // all filled in |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1296 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
|
1297 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1298 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
|
1299 } catch (SQLException e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1300 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
|
1301 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1302 closeStmtResSet(stmt, null); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1303 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1304 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1305 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1306 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
|
1307 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
|
1308 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1309 // testing and showing result set meta data |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1310 ResultSetMetaData rsmd = pstmt.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1311 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
|
1312 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
|
1313 sb.append("RCol ").append(col).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1314 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
|
1315 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
|
1316 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
|
1317 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
|
1318 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
|
1319 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
|
1320 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
|
1321 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
|
1322 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
|
1323 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
|
1324 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
|
1325 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
|
1326 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
|
1327 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
|
1328 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
|
1329 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
|
1330 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
|
1331 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
|
1332 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
|
1333 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
|
1334 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1335 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1336 showParams(pstmt); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1337 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1338 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1339 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1340 // >> 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
|
1341 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
|
1342 } 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
|
1343 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
|
1344 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1345 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
|
1346 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1347 compareExpectedOutput("Test_PSmetadata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1348 "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
|
1349 "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
|
1350 " 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
|
1351 "rsmd. 6 columns:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1352 "RCol 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1353 " classname java.lang.Short\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1354 " displaysize 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1355 " label intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1356 " name intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1357 " type -6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1358 " typename tinyint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1359 " precision 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1360 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1361 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1362 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1363 " tablename \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1364 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1365 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1366 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1367 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1368 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1369 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1370 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1371 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1372 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1373 "RCol 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1374 " classname java.lang.Integer\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1375 " displaysize 32\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1376 " label myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1377 " name myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1378 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1379 " typename int\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1380 " precision 32\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1381 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1382 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1383 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1384 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1385 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1386 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1387 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1388 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1389 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1390 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1391 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1392 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1393 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1394 "RCol 3\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1395 " classname java.lang.Double\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1396 " displaysize 53\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1397 " label mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1398 " name mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1399 " type 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1400 " typename double\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1401 " precision 53\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1402 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1403 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1404 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1405 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1406 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1407 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1408 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1409 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1410 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1411 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1412 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1413 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1414 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1415 "RCol 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1416 " classname java.lang.Boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1417 " displaysize 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1418 " label mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1419 " name mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1420 " type 16\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1421 " typename boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1422 " precision 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1423 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1424 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1425 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1426 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1427 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1428 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1429 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1430 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1431 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1432 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1433 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1434 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1435 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1436 "RCol 5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1437 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1438 " displaysize 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1439 " label myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1440 " name myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1441 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1442 " typename varchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1443 " precision 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1444 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1445 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1446 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1447 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1448 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1449 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1450 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1451 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1452 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1453 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1454 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1455 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1456 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1457 "RCol 6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1458 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1459 " displaysize 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1460 " label myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1461 " name myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1462 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1463 " typename clob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1464 " precision 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1465 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1466 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1467 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1468 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1469 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1470 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1471 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1472 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1473 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1474 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1475 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1476 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1477 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1478 "pmd. 1 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1479 "Param 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1480 " nullable 2 (UNKNOWN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1481 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1482 " precision 32\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1483 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1484 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1485 " typename int\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1486 " classname java.lang.Integer\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1487 " mode 1 (IN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1488 "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
|
1489 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1490 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1491 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
|
1492 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
|
1493 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1494 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1495 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
|
1496 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1497 // >> 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
|
1498 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
|
1499 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
1500 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
|
1501 for (int i = 0; i < 120; i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1502 pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1503 pstmt.setInt(1, i); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1504 rs = pstmt.executeQuery(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1505 if (rs.next() && i % 20 == 0) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1506 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
|
1507 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1508 /* 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
|
1509 pstmt.close(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1510 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1511 } 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
|
1512 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
|
1513 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1514 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1515 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
|
1516 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1517 compareExpectedOutput("Test_PSsomeamount", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1518 "0. true true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1519 "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
|
1520 "0, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1521 "20, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1522 "40, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1523 "60, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1524 "80, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1525 "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
|
1526 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1527 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1528 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
|
1529 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
|
1530 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1531 Statement stmt = null; |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1532 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1533 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
|
1534 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1535 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1536 // >> 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
|
1537 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
|
1538 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1539 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1540 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
|
1541 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1542 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
|
1543 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1544 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
|
1545 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1546 sb.append(pmd.getParameterCount()).append(" parameters:\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1547 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
|
1548 sb.append("Parm ").append(parm).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1549 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
|
1550 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
|
1551 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
|
1552 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1553 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1554 INET tinet = new INET(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1555 tinet.fromString("172.5.5.5/24"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1556 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1557 URL turl = new URL(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1558 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1559 turl.fromString("http://www.monetdb.org/"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1560 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1561 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
|
1562 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1563 pstmt.setObject(1, tinet); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1564 pstmt.setObject(2, turl); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1565 // insert first record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1566 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
|
1567 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
|
1568 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1569 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1570 tinet.setNetmaskBits(16); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1571 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1572 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
|
1573 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1574 // insert second record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1575 pstmt.execute(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1576 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1577 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
|
1578 ResultSetMetaData rsmd = rs.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1579 for (int i = 1; rs.next(); i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1580 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
|
1581 Object x = rs.getObject(col); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1582 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
|
1583 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
|
1584 } else { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1585 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
|
1586 if (x instanceof INET) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1587 INET inet = (INET)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1588 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
|
1589 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
|
1590 } else if (x instanceof URL) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1591 URL url = (URL)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1592 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
|
1593 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1594 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1595 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1596 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1597 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1598 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1599 // >> 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
|
1600 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
|
1601 } 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
|
1602 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
|
1603 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1604 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1605 closeStmtResSet(stmt, rs); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1606 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
|
1607 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1608 compareExpectedOutput("Test_PSsqldata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1609 "0. false false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1610 "2 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1611 "Parm 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1612 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1613 " typename inet\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1614 " classname org.monetdb.jdbc.types.INET\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1615 "Parm 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1616 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1617 " typename url\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1618 " 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
|
1619 "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
|
1620 " 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
|
1621 " 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
|
1622 "1. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1623 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1624 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1625 "1. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1626 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1627 "2. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1628 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1629 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1630 "2. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1631 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
1632 "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
|
1633 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1634 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1635 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
|
1636 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
|
1637 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1638 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1639 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1640 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
|
1641 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1642 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1643 // >> 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
|
1644 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
|
1645 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1646 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1647 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
|
1648 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1649 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
|
1650 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1651 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
|
1652 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1653 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1654 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1655 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1656 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1657 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1658 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1659 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1660 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1661 sb.append("2. inserting a record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1662 java.util.Date d = new java.util.Date(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1663 pstmt.setTime(1, new java.sql.Time(d.getTime())); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1664 pstmt.setTimestamp(2, new java.sql.Timestamp(d.getTime())); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1665 pstmt.setDate(3, new java.sql.Date(d.getTime())); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1666 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1667 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1668 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1669 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1670 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1671 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1672 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1673 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1674 sb.append("4. selecting record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1675 pstmt = con.prepareStatement("SELECT * FROM Test_PStimedate"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1676 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1677 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1678 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1679 while (rs.next()) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1680 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
|
1681 sb.append((j+4)).append(". retrieving..."); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1682 java.util.Date x = (java.util.Date)(rs.getObject(j)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1683 boolean matches = false; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1684 if (x instanceof Time) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1685 sb.append(" (Time)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1686 matches = (new Time(d.getTime())).toString().equals(x.toString()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1687 } else if (x instanceof Date) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1688 sb.append(" (Date)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1689 matches = (new Date(d.getTime())).toString().equals(x.toString()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1690 } else if (x instanceof Timestamp) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1691 sb.append(" (Timestamp)"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1692 matches = (new Timestamp(d.getTime())).toString().equals(x.toString()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1693 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1694 if (matches) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1695 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1696 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1697 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
|
1698 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1699 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1700 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1701 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1702 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1703 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1704 // >> 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
|
1705 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
|
1706 } 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
|
1707 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
|
1708 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1710 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1711 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
|
1712 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1713 compareExpectedOutput("Test_PStimedate", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1714 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1715 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1716 "2. inserting a record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1717 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1718 "4. selecting record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1719 "5. retrieving... (Time) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1720 "6. retrieving... (Timestamp) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1721 "7. retrieving... (Date) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1722 "0. true true\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1723 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1724 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1725 private void Test_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
|
1726 sb.setLength(0); // clear the output log buffer |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1727 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1728 // 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
|
1729 // setting, by overriding the VM's default |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1730 // 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
|
1731 // savings corrections |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1732 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1733 |
395
0eef53e06007
Add JDBC_API_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 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1735 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1736 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
|
1737 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1738 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1739 // >> 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
|
1740 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
|
1741 |
395
0eef53e06007
Add JDBC_API_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 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1743 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
|
1744 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1745 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
|
1746 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1747 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
|
1748 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1749 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1750 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1751 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1752 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1753 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1754 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1755 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1756 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1757 sb.append("2. inserting records...\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1758 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
|
1759 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
|
1760 Calendar c = Calendar.getInstance(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1761 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
|
1762 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
|
1763 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1764 tsz.setTimeZone(c.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1765 tz.setTimeZone(tsz.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1766 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
|
1767 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1768 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1769 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1770 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1771 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1772 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1773 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1774 c.setTimeZone(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1775 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
|
1776 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1777 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1778 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1779 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1780 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1781 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1782 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
|
1783 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
|
1784 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1785 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1786 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1787 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1788 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1789 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1790 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
|
1791 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
|
1792 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1793 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1794 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1795 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1796 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1797 sb.append(" done\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1798 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1799 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1800 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1801 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1802 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1803 sb.append("4. selecting records..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1804 pstmt = con.prepareStatement("SELECT * FROM Test_PStimezone"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1805 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1806 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1807 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1808 // 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
|
1809 // (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
|
1810 // 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
|
1811 // 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
|
1812 // 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
|
1813 // 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
|
1814 // 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
|
1815 // eventually see 1st Jan 1970. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1816 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
|
1817 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
|
1818 .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
|
1819 // .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
|
1820 .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
|
1821 // .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
|
1822 .append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1823 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1824 tsz.setTimeZone(TimeZone.getDefault()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1825 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
|
1826 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
|
1827 .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
|
1828 .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
|
1829 .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
|
1830 .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
|
1831 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1832 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
|
1833 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
|
1834 .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
|
1835 .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
|
1836 .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
|
1837 .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
|
1838 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1839 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
|
1840 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
|
1841 .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
|
1842 .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
|
1843 .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
|
1844 .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
|
1845 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1846 SQLWarning w = rs.getWarnings(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1847 while (w != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1848 sb.append(w.getMessage()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1849 w = w.getNextWarning(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1850 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1851 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1852 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1853 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1854 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1855 // >> 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
|
1856 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
|
1857 } 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
|
1858 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
|
1859 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1860 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1861 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1862 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
|
1863 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1864 compareExpectedOutput("Test_PStimezone", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1865 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1866 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1867 "2. inserting records...\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1868 "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
|
1869 "inserting with calendar timezone UTC\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1870 "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
|
1871 "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
|
1872 " done\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1873 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1874 "4. selecting records... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1875 "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
|
1876 // 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
|
1877 "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
|
1878 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1879 "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
|
1880 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1881 "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
|
1882 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1883 "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
|
1884 "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
|
1885 // 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
|
1886 "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
|
1887 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1888 "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
|
1889 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1890 "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
|
1891 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1892 "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
|
1893 "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
|
1894 // 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
|
1895 "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
|
1896 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1897 "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
|
1898 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1899 "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
|
1900 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1901 "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
|
1902 "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
|
1903 // 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
|
1904 "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
|
1905 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1906 "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
|
1907 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1908 "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
|
1909 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1910 "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
|
1911 "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
|
1912 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1913 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1914 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
|
1915 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
|
1916 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1917 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1918 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
|
1919 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1920 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1921 // >> 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
|
1922 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
|
1923 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1924 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1925 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1926 "CREATE TABLE htmtest (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1927 " htmid bigint NOT NULL," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1928 " ra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1929 " decl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1930 " dra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1931 " ddecl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1932 " flux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1933 " dflux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1934 " freq double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1935 " bw double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1936 " type decimal(1,0)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1937 " imageurl varchar(100)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1938 " comment varchar(100)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1939 " CONSTRAINT htmtest_htmid_pkey PRIMARY KEY (htmid)" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1940 ")" ); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1941 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1942 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
|
1943 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1944 // 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
|
1945 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
|
1946 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1947 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
|
1948 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1949 stmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1950 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1951 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
|
1952 sb.append("1. inserting a record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1953 pstmt.setLong(1, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1954 pstmt.setFloat(2, (float)1.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1955 pstmt.setDouble(3, 2.4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1956 pstmt.setDouble(4, 3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1957 pstmt.setString(5, "vlavbla"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1958 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1959 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1960 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1961 // try an update like bug #1757923 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1962 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
|
1963 sb.append("2. updating record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1964 pstmt.setString(1, "some update"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1965 pstmt.setObject(2, (float)3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1966 pstmt.setLong(3, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1967 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1968 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1969 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1970 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1971 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1972 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1973 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1974 // >> 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
|
1975 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
|
1976 } 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
|
1977 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
|
1978 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1979 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1980 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1981 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
|
1982 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1983 compareExpectedOutput("Test_PStypes", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1984 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1985 "1. inserting a record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1986 "2. updating record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1987 "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
|
1988 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1989 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1990 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
|
1991 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
|
1992 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1993 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1994 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
|
1995 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1996 String tbl_nm = "tbl6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1997 String proc_nm = "proc6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
1998 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1999 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2000 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2001 // create a test table. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2002 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
|
2003 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
|
2004 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2005 // 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
|
2006 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
|
2007 " 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
|
2008 "END;"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2009 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
|
2010 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2011 // 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
|
2012 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
|
2013 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
|
2014 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2015 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2016 // now use a CallableStament object |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2017 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
|
2018 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
|
2019 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2020 // specify first set of params |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2021 cstmt.setInt(1, 2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2022 cstmt.setDouble(2, 2.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2023 cstmt.setBoolean(3, true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2024 cstmt.setString(4, "Two"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2025 Clob myclob = con.createClob(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2026 myclob.setString(1, "TWOs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2027 cstmt.setClob(5, myclob); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2028 cstmt.setString(6, "http://www.monetdb.org/"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2029 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2030 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
|
2031 showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2032 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2033 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2034 myclob.setString(1, "TREEs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2035 // 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
|
2036 cstmt.setDouble(2, 3.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2037 cstmt.setString(4, "Tree"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2038 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2039 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
|
2040 } catch (java.net.MalformedURLException mfue) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2041 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
|
2042 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2043 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2044 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
|
2045 // showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2046 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2047 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2048 // 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
|
2049 cstmt.setInt(1, 4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2050 cstmt.setBoolean(3, false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2051 cstmt.setString(4, "Four"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2052 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2053 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
|
2054 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2055 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2056 // test setNull() also |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2057 cstmt.setNull(3, Types.BOOLEAN); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2058 cstmt.setNull(5, Types.CLOB); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2059 cstmt.setNull(2, Types.DOUBLE); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2060 cstmt.setNull(4, Types.VARCHAR); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2061 cstmt.setNull(1, Types.INTEGER); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2062 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2063 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
|
2064 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2065 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
2066 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
|
2067 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
|
2068 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
|
2069 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2070 } 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
|
2071 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
|
2072 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2073 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2074 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2075 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
|
2076 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2077 compareExpectedOutput("Test_CallableStmt", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2078 "Created table: tbl6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2079 "Created procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2080 "Called procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2081 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2082 " 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
|
2083 " 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
|
2084 "Prepared Callable procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2085 "Called Prepared procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2086 "pmd. 6 parameters:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2087 "Param 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2088 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2089 " signed true\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2090 " precision 32\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2091 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2092 " type 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2093 " typename int\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2094 " classname java.lang.Integer\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2095 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2096 "Param 2\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2097 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2098 " signed true\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2099 " precision 53\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2100 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2101 " type 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2102 " typename double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2103 " classname java.lang.Double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2104 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2105 "Param 3\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2106 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2107 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2108 " precision 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2109 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2110 " type 16\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2111 " typename boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2112 " classname java.lang.Boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2113 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2114 "Param 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2115 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2116 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2117 " precision 15\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2118 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2119 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2120 " typename varchar\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2121 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2122 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2123 "Param 5\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2124 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2125 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2126 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2127 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2128 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2129 " typename clob\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2130 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2131 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2132 "Param 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2133 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2134 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2135 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2136 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2137 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2138 " typename url\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2139 " classname org.monetdb.jdbc.types.URL\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2140 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2141 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2142 " 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
|
2143 " 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
|
2144 " 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
|
2145 "Called Prepared procedure (2): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2146 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2147 " 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
|
2148 " 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
|
2149 " 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
|
2150 " 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
|
2151 "Called Prepared procedure (3): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2152 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2153 " 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
|
2154 " 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
|
2155 " 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
|
2156 " 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
|
2157 " 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
|
2158 "Called Prepared procedure (with NULLs): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2159 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2160 " 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
|
2161 " 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
|
2162 " 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
|
2163 " 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
|
2164 " 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
|
2165 " 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
|
2166 "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
|
2167 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2168 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2169 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
|
2170 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
|
2171 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2172 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2173 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
|
2174 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2175 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2176 // >> 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
|
2177 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
|
2178 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2179 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2180 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2181 "CREATE TABLE Test_Rbooleans (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2182 " 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
|
2183 " 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
|
2184 " 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
|
2185 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
|
2186 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
|
2187 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2188 // all falses |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2189 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
|
2190 // all trues |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2191 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
|
2192 // sneakier |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2193 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
|
2194 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
|
2195 if (updates != 4) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2196 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
|
2197 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2198 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
|
2199 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2200 // all should give false |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2201 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2202 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
|
2203 .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
|
2204 .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
|
2205 .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
|
2206 .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
|
2207 .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
|
2208 .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
|
2209 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2210 // 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
|
2211 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2212 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
|
2213 .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
|
2214 .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
|
2215 .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
|
2216 .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
|
2217 .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
|
2218 .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
|
2219 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2220 // 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
|
2221 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2222 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
|
2223 .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
|
2224 .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
|
2225 .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
|
2226 .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
|
2227 .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
|
2228 .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
|
2229 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2230 // 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
|
2231 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2232 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
|
2233 .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
|
2234 .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
|
2235 .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
|
2236 .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
|
2237 .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
|
2238 .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
|
2239 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2240 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2241 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2242 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2243 // >> 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
|
2244 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
|
2245 } 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
|
2246 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
|
2247 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2248 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2249 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
|
2250 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2251 compareExpectedOutput("Test_Rbooleans", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2252 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2253 "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
|
2254 "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
|
2255 "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
|
2256 "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
|
2257 "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
|
2258 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2259 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2260 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
|
2261 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
|
2262 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2263 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2264 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
|
2265 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2266 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2267 // >> 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
|
2268 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
|
2269 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2270 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2271 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
|
2272 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2273 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2274 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
|
2275 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2276 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
|
2277 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2278 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
|
2279 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2280 ResultSetMetaData rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2281 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
|
2282 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
|
2283 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
|
2284 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
|
2285 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
|
2286 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
|
2287 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
|
2288 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
|
2289 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
|
2290 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
|
2291 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
|
2292 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
|
2293 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
|
2294 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
|
2295 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
|
2296 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
|
2297 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
|
2298 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
|
2299 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
|
2300 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
|
2301 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
|
2302 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
|
2303 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
|
2304 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2305 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2306 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
|
2307 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
|
2308 Object obj = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2309 String type = rsmd.getColumnClassName(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2310 String isInstance = "(null)"; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2311 if (obj != null && type != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2312 try { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2313 Class<?> c = Class.forName(type); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2314 if (c.isInstance(obj)) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2315 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
|
2316 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2317 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
|
2318 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2319 } catch (ClassNotFoundException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2320 isInstance = "No such class: " + type; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2321 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2322 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2323 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
|
2324 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2325 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2326 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2327 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2328 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2329 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2330 // >> 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
|
2331 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
|
2332 } 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
|
2333 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
|
2334 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2335 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2336 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2337 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2338 compareExpectedOutput("Test_Rmetadata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2339 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2340 "0. 5 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2341 "Colnr 1.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2342 " classname java.lang.Integer\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2343 " displaysize 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2344 " label myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2345 " name myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2346 " type 4\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2347 " typename int\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2348 " precision 10\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2349 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2350 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2351 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2352 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2353 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2354 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2355 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2356 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2357 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2358 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2359 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2360 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2361 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2362 "Colnr 2.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2363 " classname java.lang.Double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2364 " displaysize 24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2365 " label mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2366 " name mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2367 " type 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2368 " typename double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2369 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2370 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2371 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2372 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2373 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2374 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2375 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2376 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2377 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2378 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2379 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2380 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2381 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2382 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2383 "Colnr 3.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2384 " classname java.lang.Boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2385 " displaysize 5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2386 " label mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2387 " name mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2388 " type 16\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2389 " typename boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2390 " precision 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2391 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2392 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2393 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2394 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2395 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2396 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2397 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2398 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2399 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2400 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2401 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2402 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2403 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2404 "Colnr 4.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2405 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2406 " displaysize 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2407 " label myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2408 " name myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2409 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2410 " typename varchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2411 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2412 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2413 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2414 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2415 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2416 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2417 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2418 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2419 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2420 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2421 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2422 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2423 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2424 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2425 "Colnr 5.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2426 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2427 " displaysize 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2428 " label myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2429 " name myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2430 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2431 " typename clob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2432 " precision 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2433 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2434 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2435 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2436 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2437 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2438 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2439 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2440 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2441 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2442 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2443 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2444 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2445 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2446 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2447 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2448 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2449 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2450 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2451 "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
|
2452 "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
|
2453 "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
|
2454 "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
|
2455 "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
|
2456 "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
|
2457 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2458 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2459 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
|
2460 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
|
2461 |
0eef53e06007
Add JDBC_API_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 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2463 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
|
2464 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
|
2465 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2466 // get a one rowed resultset |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2467 rs = stmt.executeQuery("SELECT 1"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2468 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2469 // >> 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
|
2470 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
|
2471 // >> 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
|
2472 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
|
2473 // >> 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
|
2474 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
|
2475 // >> 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
|
2476 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
|
2477 // >> 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
|
2478 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
|
2479 // >> 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
|
2480 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
|
2481 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2482 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
|
2483 // >> 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
|
2484 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
|
2485 // >> 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
|
2486 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
|
2487 // >> 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
|
2488 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
|
2489 // >> 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
|
2490 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
|
2491 // >> 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
|
2492 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
|
2493 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2494 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2495 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2496 // 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
|
2497 DatabaseMetaData dbmd = con.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2498 rs = dbmd.getTableTypes(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2499 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2500 // >> 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
|
2501 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
|
2502 // >> 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
|
2503 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
|
2504 // >> 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
|
2505 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
|
2506 // >> 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
|
2507 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
|
2508 // >> 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
|
2509 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
|
2510 // move to last row |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2511 rs.last(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2512 // >> 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
|
2513 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
|
2514 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2515 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
|
2516 // >> 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
|
2517 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
|
2518 // >> 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
|
2519 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
|
2520 // >> 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
|
2521 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
|
2522 // >> 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
|
2523 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
|
2524 // >> 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
|
2525 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
|
2526 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2527 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
|
2528 } 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
|
2529 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
|
2530 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2531 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2532 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2533 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2534 compareExpectedOutput("Test_Rpositioning", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2535 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2536 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2537 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2538 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2539 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2540 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2541 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2542 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2543 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2544 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2545 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2546 "12.true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2547 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2548 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2549 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2550 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2551 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2552 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2553 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2554 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2555 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2556 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2557 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2558 "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
|
2559 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2560 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2561 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
|
2562 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
|
2563 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2564 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2565 ResultSet rs = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2566 ResultSetMetaData rsmd = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2567 |
395
0eef53e06007
Add JDBC_API_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 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2569 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2570 // >> 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
|
2571 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
|
2572 |
395
0eef53e06007
Add JDBC_API_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 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2574 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
|
2575 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2576 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
|
2577 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2578 stmt.executeUpdate(InsertInto + "(NULL, NULL)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2579 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2580 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
|
2581 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
|
2582 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
|
2583 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
|
2584 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2585 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
|
2586 rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2587 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2588 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
|
2589 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
|
2590 sb.append(col).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2591 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
|
2592 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
|
2593 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
|
2594 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
|
2595 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
|
2596 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2597 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2598 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
|
2599 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
|
2600 sb.append(i).append(".\t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2601 Object x = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2602 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
|
2603 sb.append("<null>\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2604 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2605 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
|
2606 if (x instanceof INET) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2607 INET inet = (INET)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2608 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
|
2609 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
|
2610 } else if (x instanceof URL) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2611 URL url = (URL)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2612 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
|
2613 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2614 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2615 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2616 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2617 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2618 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2619 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2620 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2621 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2622 // >> 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
|
2623 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
|
2624 } 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
|
2625 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
|
2626 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2627 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2628 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2629 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2630 compareExpectedOutput("Test_Rsqldata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2631 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2632 "0. 2 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2633 "1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2634 " 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
|
2635 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2636 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2637 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2638 " columnname myinet\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2639 "2\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2640 " 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
|
2641 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2642 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2643 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2644 " columnname myurl\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2645 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2646 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2647 "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
|
2648 " 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
|
2649 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2650 "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
|
2651 " http://www.monetdb.org/\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2652 "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
|
2653 " 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
|
2654 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2655 "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
|
2656 " 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
|
2657 "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
|
2658 " 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
|
2659 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2660 "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
|
2661 " 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
|
2662 "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
|
2663 " 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
|
2664 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2665 "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
|
2666 " 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
|
2667 "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
|
2668 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2669 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2670 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
|
2671 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
|
2672 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2673 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2674 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
|
2675 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2676 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2677 // >> 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
|
2678 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
|
2679 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2680 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2681 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
|
2682 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2683 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
|
2684 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
|
2685 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
|
2686 // 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
|
2687 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
|
2688 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
|
2689 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
|
2690 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2691 // 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
|
2692 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
|
2693 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
|
2694 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
|
2695 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
|
2696 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
|
2697 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
|
2698 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
|
2699 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
|
2700 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
|
2701 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2702 // 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
|
2703 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
|
2704 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
|
2705 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
|
2706 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
|
2707 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
|
2708 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
|
2709 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2710 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
|
2711 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2712 readNextRow(rs, 1, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2713 readNextRow(rs, 2, "t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2714 readNextRow(rs, 3, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2715 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2716 readNextRow(rs, 4, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2717 readNextRow(rs, 5, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2718 readNextRow(rs, 6, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2719 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2720 readNextRow(rs, 11, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2721 readNextRow(rs, 12, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2722 readNextRow(rs, 13, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2723 readNextRow(rs, 14, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2724 readNextRow(rs, 15, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2725 readNextRow(rs, 16, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2726 readNextRow(rs, 17, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2727 readNextRow(rs, 18, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2728 readNextRow(rs, 19, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2729 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2730 readNextRow(rs, 21, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2731 readNextRow(rs, 22, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2732 readNextRow(rs, 23, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2733 readNextRow(rs, 24, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2734 readNextRow(rs, 25, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2735 readNextRow(rs, 26, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2736 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2737 readWarnings(stmt.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2738 readWarnings(con.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2739 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2740 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2741 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2742 // >> 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
|
2743 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
|
2744 } 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
|
2745 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
|
2746 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2747 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2748 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2749 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2750 compareExpectedOutput("Test_Rtimedate", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2751 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2752 "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
|
2753 "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
|
2754 "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
|
2755 "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
|
2756 "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
|
2757 "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
|
2758 "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
|
2759 "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
|
2760 "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
|
2761 "4. vc 2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2762 "4. vc 2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"2004-04-24 11:43:53.654321\" at pos: 5\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2763 "4. vc 2004-04-24 11:43:53.654321 to dt: 2004-04-24\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2764 "5. vc 11:43:53 to ts: rs.getTimestamp(colnm) failed with error: parsing failed, found: ':' in: \"11:43:53\" at pos: 3\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2765 "5. vc 11:43:53 to tm: 11:43:53\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2766 "5. vc 11:43:53 to dt: rs.getDate(colnm) failed with error: parsing failed, found: ':' in: \"11:43:53\" at pos: 3\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2767 "6. vc 2004-04-24 to ts: 2004-04-24 00:00:00.0\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2768 "6. vc 2004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"2004-04-24\" at pos: 5\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2769 "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
|
2770 "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
|
2771 "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
|
2772 "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
|
2773 "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
|
2774 "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
|
2775 "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
|
2776 "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
|
2777 "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
|
2778 "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
|
2779 "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
|
2780 "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
|
2781 "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
|
2782 "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
|
2783 "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
|
2784 "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
|
2785 "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
|
2786 "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
|
2787 "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
|
2788 "17. vc 904-04-24 11:43:53.567 to ts: 0904-04-24 11:43:53.567\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2789 "17. vc 904-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"904-04-24 11:43:53.567\" at pos: 4\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2790 "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
|
2791 "18. vc 74-04-24 11:43:53.567 to ts: 0074-04-24 11:43:53.567\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2792 "18. vc 74-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"74-04-24 11:43:53.567\" at pos: 3\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2793 "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
|
2794 "19. vc 4-04-24 11:43:53.567 to ts: 0004-04-24 11:43:53.567\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2795 "19. vc 4-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"4-04-24 11:43:53.567\" at pos: 2\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2796 "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
|
2797 "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
|
2798 "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
|
2799 "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
|
2800 "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
|
2801 "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
|
2802 "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
|
2803 "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
|
2804 "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
|
2805 "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
|
2806 "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
|
2807 "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
|
2808 "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
|
2809 "25. vc -2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2810 "25. vc -2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"-2004-04-24 11:43:53.654321\" at pos: 6\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2811 "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
|
2812 "26. vc -3004-04-24 to ts: 3004-04-24 00:00:00.0\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
2813 "26. vc -3004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed, found: '-' in: \"-3004-04-24\" at pos: 6\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2814 "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
|
2815 "0. true true\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2816 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2817 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2818 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
|
2819 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2820 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2821 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2822 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2823 // 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
|
2824 // 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
|
2825 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
|
2826 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2827 // 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
|
2828 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
|
2829 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
|
2830 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2831 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
|
2832 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2833 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2834 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2835 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2836 // 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
|
2837 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
|
2838 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
|
2839 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2840 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
|
2841 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2842 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2843 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2844 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2845 // 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
|
2846 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
|
2847 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
|
2848 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2849 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
|
2850 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2851 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2852 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
|
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 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2855 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
|
2856 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
|
2857 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2858 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2859 PreparedStatement pstmt = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2860 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
|
2861 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2862 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2863 // >> 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
|
2864 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
|
2865 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2866 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2867 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2868 sb.append("1. create..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2869 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
|
2870 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
|
2871 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2872 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2873 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2874 // 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
|
2875 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
|
2876 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
|
2877 if (i % 1500 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2878 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
|
2879 int[] cnts = stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2880 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2881 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
|
2882 if (cnts.length != 1500) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2883 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
|
2884 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
|
2885 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
|
2886 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
|
2887 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2888 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
|
2889 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2890 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2891 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2892 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2893 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2894 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
|
2895 stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2896 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2897 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2898 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2899 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
|
2900 // 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
|
2901 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
|
2902 pstmt.setInt(1, i); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2903 pstmt.addBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2904 if (i % 3000 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2905 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
|
2906 long[] cnts = pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2907 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2908 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
|
2909 if (cnts.length != 3000) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2910 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
|
2911 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
|
2912 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
|
2913 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
|
2914 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2915 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
|
2916 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2917 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2918 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2919 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2920 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2921 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
|
2922 pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2923 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2924 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2925 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2926 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
|
2927 stmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2928 pstmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2929 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2930 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2931 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
|
2932 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
|
2933 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2934 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
|
2935 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2936 sb.append("8. drop table..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2937 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
|
2938 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
|
2939 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2940 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2941 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2942 // rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2943 stmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2944 pstmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2945 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2946 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2947 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2948 // >> 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
|
2949 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
|
2950 } 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
|
2951 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
|
2952 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2953 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2954 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2955 closeStmtResSet(pstmt, null); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2956 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2957 compareExpectedOutput("Test_Sbatching", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2958 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2959 "1. create...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2960 "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
|
2961 "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
|
2962 "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
|
2963 "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
|
2964 "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
|
2965 "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
|
2966 "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
|
2967 "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
|
2968 "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
|
2969 "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
|
2970 "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
|
2971 "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
|
2972 "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
|
2973 "8. drop table...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2974 "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
|
2975 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2976 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2977 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
|
2978 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
|
2979 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2980 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
|
2981 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
|
2982 // >> 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
|
2983 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
|
2984 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2985 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
|
2986 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
|
2987 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
|
2988 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
|
2989 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
|
2990 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2991 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
|
2992 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
|
2993 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
|
2994 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
|
2995 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2996 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
|
2997 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
|
2998 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
|
2999 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
|
3000 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3001 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
|
3002 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
|
3003 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
|
3004 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
|
3005 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3006 } 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
|
3007 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
|
3008 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3009 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3010 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
|
3011 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3012 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
|
3013 "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
|
3014 "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
|
3015 "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
|
3016 "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
|
3017 "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
|
3018 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3019 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3020 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
|
3021 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
|
3022 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3023 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
|
3024 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
|
3025 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
|
3026 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3027 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
|
3028 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3029 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
|
3030 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
|
3031 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
|
3032 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
|
3033 |
0eef53e06007
Add JDBC_API_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 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
|
3035 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
|
3036 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
|
3037 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
|
3038 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
|
3039 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3040 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
|
3041 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
|
3042 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
|
3043 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
|
3044 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
|
3045 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3046 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
|
3047 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
|
3048 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
|
3049 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
|
3050 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
|
3051 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
|
3052 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3053 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
|
3054 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3055 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
|
3056 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
|
3057 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
|
3058 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
|
3059 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
|
3060 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3061 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
|
3062 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3063 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
|
3064 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
|
3065 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
|
3066 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
|
3067 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
|
3068 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
|
3069 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
|
3070 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3071 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
|
3072 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
|
3073 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
|
3074 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
|
3075 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
|
3076 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
|
3077 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3078 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
|
3079 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
|
3080 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
|
3081 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
|
3082 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
|
3083 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
|
3084 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3085 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
|
3086 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3087 } 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
|
3088 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
|
3089 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
|
3090 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3091 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3092 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
|
3093 "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
|
3094 "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
|
3095 "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
|
3096 "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
|
3097 "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
|
3098 "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
|
3099 "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
|
3100 "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
|
3101 "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
|
3102 "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
|
3103 "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
|
3104 "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
|
3105 "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
|
3106 "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
|
3107 "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
|
3108 "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
|
3109 "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
|
3110 "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
|
3111 "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
|
3112 "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
|
3113 "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
|
3114 "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
|
3115 "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
|
3116 "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
|
3117 "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
|
3118 "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
|
3119 "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
|
3120 "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
|
3121 "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
|
3122 "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
|
3123 "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
|
3124 "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
|
3125 "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
|
3126 "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
|
3127 "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
|
3128 "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
|
3129 "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
|
3130 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3131 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3132 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
|
3133 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
|
3134 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
|
3135 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
|
3136 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
|
3137 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
|
3138 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
|
3139 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
|
3140 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3141 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
|
3142 } 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
|
3143 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
|
3144 } 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
|
3145 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
|
3146 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3147 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3148 |
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
|
3149 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
|
3150 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
|
3151 |
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
|
3152 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
|
3153 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
|
3154 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
|
3155 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
|
3156 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
|
3157 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
|
3158 // 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
|
3159 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
|
3160 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
|
3161 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
|
3162 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
|
3163 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
|
3164 |
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
|
3165 // 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
|
3166 // 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
|
3167 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
|
3168 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
|
3169 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
|
3170 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
|
3171 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
|
3172 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
|
3173 |
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
|
3174 // 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
|
3175 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
|
3176 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
|
3177 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
|
3178 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
|
3179 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
|
3180 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
|
3181 |
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
|
3182 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
|
3183 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
|
3184 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
|
3185 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
|
3186 } |
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
|
3187 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
|
3188 |
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
|
3189 // 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
|
3190 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
|
3191 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
|
3192 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
|
3193 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
|
3194 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
|
3195 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
|
3196 |
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
|
3197 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
|
3198 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
|
3199 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
|
3200 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
|
3201 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
|
3202 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
|
3203 } 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
|
3204 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
|
3205 } |
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
|
3206 |
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
|
3207 // 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
|
3208 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
|
3209 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
|
3210 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
|
3211 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
|
3212 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
|
3213 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
|
3214 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
|
3215 } 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
|
3216 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
|
3217 } |
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
|
3218 |
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
|
3219 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
|
3220 |
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
|
3221 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
|
3222 "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
|
3223 "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
|
3224 "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
|
3225 "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
|
3226 "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
|
3227 "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
|
3228 "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
|
3229 } |
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
|
3230 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3231 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
|
3232 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
|
3233 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3234 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
|
3235 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
|
3236 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
|
3237 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
|
3238 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
|
3239 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
|
3240 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
|
3241 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
|
3242 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
|
3243 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
|
3244 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3245 // >> 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
|
3246 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
|
3247 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
|
3248 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
|
3249 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3250 // 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
|
3251 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
|
3252 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
|
3253 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
|
3254 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3255 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
|
3256 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
|
3257 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
|
3258 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
|
3259 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
|
3260 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3261 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
|
3262 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
|
3263 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
|
3264 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
|
3265 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
|
3266 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3267 // 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
|
3268 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
|
3269 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
|
3270 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
|
3271 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
|
3272 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
|
3273 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
|
3274 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
|
3275 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3276 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
|
3277 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
|
3278 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
|
3279 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
|
3280 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
|
3281 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3282 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
|
3283 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
|
3284 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
|
3285 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
|
3286 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
|
3287 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3288 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
|
3289 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
|
3290 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
|
3291 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
|
3292 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
|
3293 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3294 // 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
|
3295 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
|
3296 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
|
3297 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
|
3298 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
|
3299 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
|
3300 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
|
3301 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
|
3302 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3303 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
|
3304 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
|
3305 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
|
3306 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
|
3307 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
|
3308 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3309 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
|
3310 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
|
3311 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
|
3312 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
|
3313 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
|
3314 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3315 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
|
3316 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
|
3317 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
|
3318 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
|
3319 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
|
3320 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3321 // 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
|
3322 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
|
3323 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
|
3324 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
|
3325 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
|
3326 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
|
3327 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
|
3328 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
|
3329 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3330 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
|
3331 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
|
3332 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
|
3333 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
|
3334 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
|
3335 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3336 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
|
3337 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
|
3338 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
|
3339 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
|
3340 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
|
3341 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3342 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
|
3343 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
|
3344 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
|
3345 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
|
3346 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
|
3347 } 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
|
3348 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
|
3349 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
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
|
3351 // 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
|
3352 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
|
3353 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
|
3354 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
|
3355 } 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
|
3356 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
|
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
|
3358 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3359 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
|
3360 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
|
3361 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
|
3362 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3363 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
|
3364 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
|
3365 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
|
3366 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3367 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
|
3368 "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
|
3369 "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
|
3370 "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
|
3371 "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
|
3372 "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
|
3373 "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
|
3374 "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
|
3375 "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
|
3376 "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
|
3377 "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
|
3378 "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
|
3379 "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
|
3380 "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
|
3381 "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
|
3382 "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
|
3383 "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
|
3384 "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
|
3385 "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
|
3386 "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
|
3387 "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
|
3388 "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
|
3389 "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
|
3390 "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
|
3391 "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
|
3392 "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
|
3393 "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
|
3394 "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
|
3395 "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
|
3396 "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
|
3397 "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
|
3398 "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
|
3399 "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
|
3400 "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
|
3401 "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
|
3402 "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
|
3403 "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
|
3404 "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
|
3405 "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
|
3406 "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
|
3407 "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
|
3408 "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
|
3409 "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
|
3410 "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
|
3411 "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
|
3412 "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
|
3413 "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
|
3414 "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
|
3415 "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
|
3416 "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
|
3417 "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
|
3418 "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
|
3419 "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
|
3420 "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
|
3421 "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
|
3422 "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
|
3423 "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
|
3424 "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
|
3425 "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
|
3426 "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
|
3427 "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
|
3428 "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
|
3429 "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
|
3430 "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
|
3431 "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
|
3432 "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
|
3433 "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
|
3434 "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
|
3435 "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
|
3436 "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
|
3437 "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
|
3438 "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
|
3439 "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
|
3440 "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
|
3441 "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
|
3442 "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
|
3443 "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
|
3444 "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
|
3445 "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
|
3446 "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
|
3447 "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
|
3448 "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
|
3449 "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
|
3450 "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
|
3451 "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
|
3452 "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
|
3453 "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
|
3454 "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
|
3455 "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
|
3456 "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
|
3457 "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
|
3458 "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
|
3459 "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
|
3460 "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
|
3461 "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
|
3462 "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
|
3463 "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
|
3464 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3465 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3466 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
|
3467 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
|
3468 |
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
|
3469 boolean isPostOct2020 = false; |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3470 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
|
3471 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
|
3472 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
|
3473 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
|
3474 con1 = DriverManager.getConnection(arg0); |
458
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3475 DatabaseMetaData dbmd = con1.getMetaData(); |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3476 isPostOct2020 = (dbmd.getDatabaseMajorVersion() >=11) && (dbmd.getDatabaseMinorVersion() > 39); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3477 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
|
3478 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
|
3479 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
|
3480 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3481 // >> 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
|
3482 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
|
3483 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
|
3484 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3485 // 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
|
3486 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
|
3487 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
|
3488 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
|
3489 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3490 // 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
|
3491 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
|
3492 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
|
3493 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
|
3494 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3495 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
|
3496 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
|
3497 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
|
3498 |
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
|
3499 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
|
3500 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
|
3501 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3502 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
|
3503 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
|
3504 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
|
3505 } 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
|
3506 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
|
3507 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3508 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
|
3509 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
|
3510 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
|
3511 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3512 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
|
3513 rs1 = stmt1.executeQuery("SELECT * FROM tconc_seq"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3514 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
|
3515 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
|
3516 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
|
3517 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3518 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
|
3519 rs2 = stmt2.executeQuery("SELECT * FROM tconc_seq"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3520 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
|
3521 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
|
3522 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
|
3523 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3524 // 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
|
3525 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
|
3526 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
|
3527 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
|
3528 |
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
|
3529 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
|
3530 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
|
3531 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
|
3532 } 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
|
3533 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
|
3534 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3535 |
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
|
3536 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
|
3537 isPostOct2020 ? |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3538 "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
|
3539 "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
|
3540 "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
|
3541 "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
|
3542 "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
|
3543 "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
|
3544 "transaction client 2 passed :)\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3545 "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
|
3546 "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
|
3547 "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
|
3548 "2, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3549 "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
|
3550 "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
|
3551 "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
|
3552 "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
|
3553 "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
|
3554 "2, client2\n" + |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3555 "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
|
3556 "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
|
3557 "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
|
3558 "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
|
3559 "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
|
3560 : // behavior of older MonetDB versions (up to Oct2020 release) was different |
333c3752e118
Adjust test BugConcurrent_sequences to check for the version of MonetDB server and accept the post Oct2020 server response as correct.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
453
diff
changeset
|
3561 "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
|
3562 "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
|
3563 "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
|
3564 "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
|
3565 "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
|
3566 "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
|
3567 "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
|
3568 "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
|
3569 "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
|
3570 "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
|
3571 "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
|
3572 "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
|
3573 "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
|
3574 "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
|
3575 "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
|
3576 "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
|
3577 "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
|
3578 "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
|
3579 "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
|
3580 "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
|
3581 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
|
3582 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3583 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
|
3584 // 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
|
3585 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
|
3586 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
|
3587 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
|
3588 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
|
3589 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
|
3590 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
|
3591 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
|
3592 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
|
3593 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3594 // 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
|
3595 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
|
3596 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
|
3597 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
|
3598 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
|
3599 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
|
3600 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
|
3601 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
|
3602 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
|
3603 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3604 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
|
3605 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
|
3606 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
|
3607 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
|
3608 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
|
3609 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
|
3610 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
|
3611 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3612 sb.append("passed :)\n"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3613 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3614 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
|
3615 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
|
3616 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
|
3617 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
|
3618 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
|
3619 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
|
3620 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
|
3621 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3622 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
|
3623 } 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
|
3624 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
|
3625 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3626 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3627 // 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
|
3628 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
|
3629 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
|
3630 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
|
3631 } 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
|
3632 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
|
3633 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3634 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3635 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
|
3636 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
|
3637 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3638 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
|
3639 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
|
3640 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3641 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
|
3642 "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
|
3643 "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
|
3644 "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
|
3645 "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
|
3646 "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
|
3647 "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
|
3648 "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
|
3649 "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
|
3650 "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
|
3651 "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
|
3652 "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
|
3653 "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
|
3654 "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
|
3655 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3656 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3657 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
|
3658 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
|
3659 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3660 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
|
3661 // 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
|
3662 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
|
3663 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
|
3664 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
|
3665 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
|
3666 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
|
3667 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
|
3668 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
|
3669 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
|
3670 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
|
3671 } 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
|
3672 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
|
3673 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3674 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3675 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
|
3676 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
|
3677 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
|
3678 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
|
3679 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
|
3680 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
|
3681 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3682 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
|
3683 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3684 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
|
3685 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
|
3686 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3687 sb.append("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
|
3688 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
|
3689 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3690 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
|
3691 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
|
3692 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
|
3693 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
|
3694 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3695 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
|
3696 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
|
3697 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3698 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
|
3699 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
|
3700 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
|
3701 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3702 sb.append("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
|
3703 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
|
3704 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
|
3705 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
|
3706 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
|
3707 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
|
3708 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3709 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
|
3710 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3711 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
|
3712 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3713 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
|
3714 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
|
3715 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
|
3716 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
|
3717 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
|
3718 // post Oct2020 releases the STREAM TABLE type is removed, so filter it out for a stable output |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3719 if (!"STREAM TABLE".equals(rs2.getString(1))) |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3720 sb.append(rs2.getString(1)).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3721 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3722 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
|
3723 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3724 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
|
3725 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3726 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
|
3727 } 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
|
3728 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
|
3729 } 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
|
3730 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
|
3731 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
|
3732 } 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
|
3733 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
|
3734 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3735 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3736 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3737 // 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
|
3738 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
|
3739 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
|
3740 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
|
3741 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
|
3742 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
|
3743 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
|
3744 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
|
3745 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
|
3746 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
|
3747 } 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
|
3748 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
|
3749 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3750 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3751 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
|
3752 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
|
3753 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3754 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
|
3755 "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
|
3756 "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
|
3757 "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
|
3758 "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
|
3759 "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
|
3760 "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
|
3761 "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
|
3762 "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
|
3763 "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
|
3764 "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
|
3765 "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
|
3766 "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
|
3767 "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
|
3768 "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
|
3769 "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
|
3770 "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
|
3771 "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
|
3772 "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
|
3773 "_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
|
3774 "_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
|
3775 "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
|
3776 "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
|
3777 "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
|
3778 "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
|
3779 "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
|
3780 "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
|
3781 "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
|
3782 "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
|
3783 "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
|
3784 "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
|
3785 "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
|
3786 "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
|
3787 "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
|
3788 "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
|
3789 "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
|
3790 "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
|
3791 "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
|
3792 "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
|
3793 "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
|
3794 "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
|
3795 "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
|
3796 "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
|
3797 "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
|
3798 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3799 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3800 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
|
3801 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
|
3802 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3803 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
|
3804 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
|
3805 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
|
3806 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
|
3807 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
|
3808 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
|
3809 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
|
3810 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
|
3811 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
|
3812 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
|
3813 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
|
3814 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
|
3815 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
|
3816 } 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
|
3817 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
|
3818 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3819 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3820 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
|
3821 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3822 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
|
3823 "_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
|
3824 "_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
|
3825 "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
|
3826 "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
|
3827 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3828 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3829 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
|
3830 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
|
3831 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3832 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
|
3833 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
|
3834 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
|
3835 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
|
3836 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
|
3837 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
|
3838 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
|
3839 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3840 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
|
3841 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
|
3842 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
|
3843 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
|
3844 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
|
3845 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
|
3846 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
|
3847 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
|
3848 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3849 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
|
3850 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
|
3851 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
|
3852 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
|
3853 } 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
|
3854 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
|
3855 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3856 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
|
3857 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
|
3858 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3859 // 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
|
3860 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
|
3861 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
|
3862 } 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
|
3863 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
|
3864 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3865 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
|
3866 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3867 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
|
3868 "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
|
3869 "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
|
3870 "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
|
3871 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3872 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3873 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
|
3874 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
|
3875 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3876 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
|
3877 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
|
3878 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
|
3879 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
|
3880 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
|
3881 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
|
3882 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3883 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
|
3884 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
|
3885 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
|
3886 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3887 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
|
3888 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
|
3889 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
|
3890 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
|
3891 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
|
3892 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
|
3893 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
|
3894 } 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
|
3895 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
|
3896 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3897 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
|
3898 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3899 // 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
|
3900 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
|
3901 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
|
3902 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
|
3903 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
|
3904 } 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
|
3905 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
|
3906 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3907 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3908 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
|
3909 "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
|
3910 "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
|
3911 "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
|
3912 "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
|
3913 "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
|
3914 "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
|
3915 "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
|
3916 "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
|
3917 "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
|
3918 "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
|
3919 "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
|
3920 "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
|
3921 "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
|
3922 "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
|
3923 "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
|
3924 "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
|
3925 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3926 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3927 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
|
3928 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
|
3929 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
|
3930 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
|
3931 } 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
|
3932 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
|
3933 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3934 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3935 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
|
3936 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
|
3937 } 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
|
3938 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
|
3939 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3940 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3941 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3942 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
|
3943 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
|
3944 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3945 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
|
3946 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
|
3947 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
|
3948 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
|
3949 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
|
3950 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3951 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
|
3952 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
|
3953 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
|
3954 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
|
3955 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3956 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
|
3957 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3958 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
|
3959 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
|
3960 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3961 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
|
3962 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
|
3963 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
|
3964 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3965 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
|
3966 con.isValid(3); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3967 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
|
3968 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
|
3969 } 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
|
3970 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
|
3971 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3972 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
|
3973 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
|
3974 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3975 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
|
3976 "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
|
3977 "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
|
3978 "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
|
3979 "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
|
3980 "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
|
3981 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3982 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3983 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
|
3984 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
|
3985 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3986 // 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
|
3987 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
|
3988 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
|
3989 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
|
3990 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
|
3991 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
|
3992 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
|
3993 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
|
3994 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
|
3995 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
3996 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
|
3997 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
|
3998 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
|
3999 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
|
4000 // 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
|
4001 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
|
4002 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
|
4003 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
|
4004 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
|
4005 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
|
4006 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
|
4007 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
|
4008 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
|
4009 } 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
|
4010 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
|
4011 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4012 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
|
4013 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4014 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
|
4015 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
|
4016 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
|
4017 } 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
|
4018 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
|
4019 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4020 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4021 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
|
4022 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
|
4023 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
|
4024 } 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
|
4025 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
|
4026 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4027 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4028 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
|
4029 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4030 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
|
4031 "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
|
4032 "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
|
4033 "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
|
4034 "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
|
4035 "Completed first 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
|
4036 "Second 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
|
4037 "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
|
4038 "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
|
4039 "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
|
4040 "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
|
4041 "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
|
4042 "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
|
4043 "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
|
4044 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4045 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4046 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
|
4047 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
|
4048 "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
|
4049 + "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
|
4050 + "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
|
4051 + "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
|
4052 + "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
|
4053 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
|
4054 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4055 // 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
|
4056 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
|
4057 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
|
4058 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
|
4059 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
|
4060 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
|
4061 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
|
4062 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
|
4063 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4064 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4065 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
|
4066 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4067 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
|
4068 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4069 // 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
|
4070 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
|
4071 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
|
4072 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
|
4073 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
|
4074 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
|
4075 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
|
4076 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
|
4077 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
|
4078 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
|
4079 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
|
4080 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4081 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4082 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4083 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
|
4084 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
|
4085 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4086 // 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
|
4087 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
|
4088 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
|
4089 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
|
4090 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
|
4091 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
|
4092 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
|
4093 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
|
4094 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
|
4095 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
|
4096 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
|
4097 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
|
4098 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
|
4099 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
|
4100 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
|
4101 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4102 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4104 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4105 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
|
4106 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4109 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
|
4110 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
|
4111 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
|
4112 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
|
4113 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
|
4114 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
|
4115 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
|
4116 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
|
4117 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
|
4118 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
|
4119 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
|
4120 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
|
4121 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4122 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
|
4123 } 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
|
4124 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
|
4125 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
|
4126 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
|
4127 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4128 } 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
|
4129 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 /* 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
|
4131 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
|
4132 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
|
4133 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
|
4134 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
|
4135 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
|
4136 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
|
4137 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4138 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4139 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
|
4140 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
|
4141 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4142 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
|
4143 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
|
4144 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
|
4145 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
|
4146 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
|
4147 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
|
4148 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
|
4149 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
|
4150 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
|
4151 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4152 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
|
4153 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
|
4154 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
|
4155 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
|
4156 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
|
4157 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4158 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
|
4159 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
|
4160 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
|
4161 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
|
4162 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4163 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
|
4164 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
|
4165 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
|
4166 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
|
4167 } 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
|
4168 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
|
4169 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4170 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4171 // 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
|
4172 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
|
4173 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
|
4174 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
|
4175 } 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
|
4176 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
|
4177 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4179 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
|
4180 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4181 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
|
4182 "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
|
4183 "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
|
4184 "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
|
4185 "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
|
4186 "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
|
4187 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4188 |
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
|
4189 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
|
4190 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
|
4191 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4192 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
|
4193 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
|
4194 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
|
4195 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
|
4196 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
|
4197 // >> 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
|
4198 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
|
4199 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4200 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
|
4201 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
|
4202 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
|
4203 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
|
4204 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4205 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
|
4206 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
|
4207 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
|
4208 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
|
4209 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
|
4210 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
|
4211 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
|
4212 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
|
4213 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
|
4214 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
|
4215 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4216 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
|
4217 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
|
4218 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
|
4219 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
|
4220 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
|
4221 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
|
4222 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
|
4223 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4224 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4225 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
|
4226 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
|
4227 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
|
4228 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
|
4229 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
|
4230 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
|
4231 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
|
4232 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
|
4233 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
|
4234 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
|
4235 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4236 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
|
4237 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
|
4238 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
|
4239 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
|
4240 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
|
4241 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
|
4242 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
|
4243 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
|
4244 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4245 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
|
4246 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
|
4247 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
|
4248 pstmt.setObject(3, "+3.1415E-06"); |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4249 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
|
4250 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
|
4251 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
|
4252 } 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
|
4253 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
|
4254 } |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4256 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
|
4257 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
|
4258 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4259 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
|
4260 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
|
4261 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
|
4262 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
|
4263 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
|
4264 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
|
4265 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
|
4266 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
|
4267 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4268 /* 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
|
4269 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
|
4270 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
|
4271 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
|
4272 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
|
4273 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
|
4274 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
|
4275 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
|
4276 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
|
4277 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
|
4278 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
|
4279 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4280 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
|
4281 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
|
4282 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
|
4283 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
|
4284 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
|
4285 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
|
4286 try { |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4287 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
|
4288 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
|
4289 } 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
|
4290 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
|
4291 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4292 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
|
4293 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
|
4294 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
|
4295 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
|
4296 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
|
4297 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
|
4298 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4299 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
|
4300 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
|
4301 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
|
4302 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
|
4303 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
|
4304 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
|
4305 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
|
4306 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
|
4307 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
|
4308 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
|
4309 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4310 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
|
4311 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4312 } 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
|
4313 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
|
4314 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4315 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4316 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
|
4317 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
|
4318 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
|
4319 } 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
|
4320 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
|
4321 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4322 |
437
1333c19b0c1b
include missing )
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
436
diff
changeset
|
4323 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
|
4324 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
|
4325 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4326 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
|
4327 "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
|
4328 "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
|
4329 "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
|
4330 "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
|
4331 "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
|
4332 " 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
|
4333 " 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
|
4334 " 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
|
4335 " 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
|
4336 " 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
|
4337 " 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
|
4338 "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
|
4339 "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
|
4340 "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
|
4341 "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
|
4342 "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
|
4343 "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
|
4344 "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
|
4345 "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
|
4346 "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
|
4347 "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
|
4348 "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
|
4349 "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
|
4350 "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
|
4351 "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
|
4352 "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
|
4353 "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
|
4354 "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
|
4355 "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
|
4356 "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
|
4357 "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
|
4358 " \"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
|
4359 " \"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
|
4360 " \"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
|
4361 " \"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
|
4362 " {\"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
|
4363 " {\"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
|
4364 " {\"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
|
4365 " ]\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
|
4366 " }\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
|
4367 "}} 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
|
4368 "row 7 7 row 7 null 4a148b7d-8d47-4e1e-a21e-09a71abf2215 null null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4369 "row 8 8 row 8 +3.1415E-06 null https://www.cwi.nl/ null\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4370 "row 9 9 row 9 +3.1415E-06 null null 127.255.255.255\n" + |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4371 "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
|
4372 " \"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
|
4373 " \"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
|
4374 " {\"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
|
4375 " {\"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
|
4376 " 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
|
4377 " {\"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
|
4378 " {\"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
|
4379 " {\"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
|
4380 " 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
|
4381 " {\"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
|
4382 " {\"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
|
4383 " {\"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
|
4384 " 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
|
4385 " {\"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
|
4386 " {\"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
|
4387 " ]\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
|
4388 "}}] 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
|
4389 "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
|
4390 "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
|
4391 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
4392 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4393 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
|
4394 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
|
4395 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4397 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
|
4398 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
|
4399 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
|
4400 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
|
4401 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
|
4402 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4403 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
|
4404 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
|
4405 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
|
4406 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
|
4407 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4408 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
|
4409 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4410 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
|
4411 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
|
4412 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
|
4413 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
|
4414 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
|
4415 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
|
4416 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
|
4417 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
|
4418 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4419 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
|
4420 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
|
4421 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
|
4422 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4423 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
|
4424 } 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
|
4425 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
|
4426 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
|
4427 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
|
4428 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4431 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
|
4432 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
|
4433 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
|
4434 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4435 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
|
4436 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
|
4437 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
|
4438 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
|
4439 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4440 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
|
4441 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
|
4442 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
|
4443 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
|
4444 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
|
4445 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
|
4446 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4448 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
|
4449 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4451 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
|
4452 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
|
4453 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4454 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
|
4455 } 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
|
4456 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
|
4457 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
|
4458 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
|
4459 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 } 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
|
4461 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
|
4462 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4465 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
|
4466 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
|
4467 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
|
4468 } 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
|
4469 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
|
4470 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4473 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
|
4474 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4476 "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
|
4477 "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
|
4478 "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
|
4479 "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
|
4480 "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
|
4481 "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
|
4482 "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
|
4483 "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
|
4484 "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
|
4485 "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
|
4486 "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
|
4487 "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
|
4488 "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
|
4489 "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
|
4490 "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
|
4491 "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
|
4492 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4493 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4495 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
|
4496 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4498 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
|
4499 , "\"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
|
4500 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
|
4501 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
|
4502 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
|
4503 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
|
4504 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
|
4505 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
|
4506 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
|
4507 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
|
4508 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
|
4509 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
|
4510 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
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 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
|
4514 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
|
4515 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
|
4516 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
|
4517 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
|
4518 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4519 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
|
4520 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
|
4521 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
|
4522 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
|
4523 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4524 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
|
4525 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
|
4526 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
|
4527 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
|
4528 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
|
4529 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
|
4530 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
|
4531 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
|
4532 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
|
4533 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4534 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
|
4535 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
|
4536 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
|
4537 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
|
4538 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4539 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
|
4540 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
|
4541 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
|
4542 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
|
4543 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
|
4544 // 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
|
4545 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
|
4546 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
|
4547 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
|
4548 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
|
4549 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4550 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
|
4551 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
|
4552 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
|
4553 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
|
4554 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4555 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
|
4556 "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
|
4557 "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
|
4558 "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
|
4559 " 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
|
4560 "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
|
4561 "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
|
4562 "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
|
4563 "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
|
4564 "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
|
4565 "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
|
4566 "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
|
4567 "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
|
4568 "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
|
4569 "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
|
4570 "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
|
4571 "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
|
4572 "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
|
4573 "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
|
4574 "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
|
4575 "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
|
4576 "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
|
4577 "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
|
4578 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
|
4579 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4580 // 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
|
4581 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
|
4582 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
|
4583 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
|
4584 "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
|
4585 "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
|
4586 " 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
|
4587 "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
|
4588 "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
|
4589 "\"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
|
4590 "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
|
4591 "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
|
4592 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
|
4593 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4595 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
|
4596 "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
|
4597 "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
|
4598 " 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
|
4599 "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
|
4600 "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
|
4601 "\"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
|
4602 "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
|
4603 "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
|
4604 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
|
4605 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4607 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
|
4608 "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
|
4609 "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
|
4610 " 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
|
4611 "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
|
4612 "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
|
4613 "\"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
|
4614 "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
|
4615 "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
|
4616 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
|
4617 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4619 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
|
4620 "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
|
4621 "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
|
4622 " 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
|
4623 "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
|
4624 "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
|
4625 "\"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
|
4626 "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
|
4627 "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
|
4628 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
|
4629 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4631 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
|
4632 "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
|
4633 "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
|
4634 " 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
|
4635 "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
|
4636 "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
|
4637 "\"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
|
4638 "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
|
4639 "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
|
4640 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
|
4641 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4643 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
|
4644 "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
|
4645 "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
|
4646 " 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
|
4647 "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
|
4648 "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
|
4649 "\"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
|
4650 "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
|
4651 "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
|
4652 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
|
4653 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4655 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
|
4656 "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
|
4657 "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
|
4658 " 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
|
4659 "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
|
4660 "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
|
4661 "\"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
|
4662 "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
|
4663 "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
|
4664 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
|
4665 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4667 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
|
4668 "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
|
4669 "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
|
4670 " 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
|
4671 "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
|
4672 "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
|
4673 "\"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
|
4674 "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
|
4675 "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
|
4676 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
|
4677 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4679 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
|
4680 "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
|
4681 "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
|
4682 " 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
|
4683 "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
|
4684 "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
|
4685 "\"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
|
4686 "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
|
4687 "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
|
4688 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
|
4689 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4691 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
|
4692 "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
|
4693 "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
|
4694 " 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
|
4695 "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
|
4696 "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
|
4697 "\" \"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 " \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 "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
|
4700 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
|
4701 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4703 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
|
4704 "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
|
4705 "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
|
4706 " 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
|
4707 "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
|
4708 "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
|
4709 "\"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
|
4710 "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
|
4711 "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
|
4712 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
|
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 // 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
|
4715 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
|
4716 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
|
4717 "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
|
4718 "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
|
4719 " 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
|
4720 "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
|
4721 "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
|
4722 "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
|
4723 "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
|
4724 "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
|
4725 "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
|
4726 "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
|
4727 "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
|
4728 "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
|
4729 "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
|
4730 "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
|
4731 "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
|
4732 "\"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
|
4733 "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
|
4734 "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
|
4735 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
|
4736 } 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
|
4737 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
|
4738 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 { |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4742 sb.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
|
4743 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
|
4744 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
|
4745 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
|
4746 } 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
|
4747 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
|
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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4751 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4753 "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
|
4754 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4757 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
|
4758 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
|
4759 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
|
4760 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4763 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
|
4764 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
|
4765 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
|
4766 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
|
4767 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
|
4768 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
|
4769 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4771 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
|
4772 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
|
4773 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
|
4774 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
|
4775 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
|
4776 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
|
4777 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
|
4778 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
|
4779 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
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 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
|
4783 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
|
4784 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4787 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
|
4788 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 int originalQueryTimeout = 1; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4790 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
|
4791 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
|
4792 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
|
4793 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
|
4794 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
|
4795 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4797 testTimeout_3357(st, 123456); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4798 testTimeout_3357(st, 2134567890); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4799 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
|
4800 testTimeout_3357(st, 10); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4801 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
|
4802 } 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
|
4803 sb.append("\n SQLException: setQueryTimeout(timeout_value) throws: ").append(se).append("\n"); |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4804 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4806 // 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
|
4807 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
|
4808 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
|
4809 } 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
|
4810 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
|
4811 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4813 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4815 "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
|
4816 "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
|
4817 "setQueryTimeout = 123456. getQueryTimeout = 123456\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4818 "setQueryTimeout = 2134567890. getQueryTimeout = 2134567890\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4819 "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
|
4820 "setQueryTimeout = 10. getQueryTimeout = 10\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4821 "setQueryTimeout = -1. \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4822 " SQLException: setQueryTimeout(timeout_value) throws: java.sql.SQLException: Illegal timeout value: -1\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
4823 "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
|
4824 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 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
|
4827 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
|
4828 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
|
4829 // 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
|
4830 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
|
4831 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
|
4832 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
|
4833 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
|
4834 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output 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 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4836 /** |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4837 * 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
|
4838 * 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
|
4839 * 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
|
4840 * |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4841 * @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
|
4842 */ |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4843 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
|
4844 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
|
4845 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4846 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
|
4847 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
|
4848 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
|
4849 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
|
4850 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
|
4851 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
|
4852 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4853 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
|
4854 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4855 // 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
|
4856 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
|
4857 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
|
4858 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
|
4859 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
|
4860 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
|
4861 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
|
4862 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
|
4863 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
|
4864 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4865 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
|
4866 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
|
4867 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4868 } 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
|
4869 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
|
4870 } 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
|
4871 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
|
4872 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4873 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4874 // 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
|
4875 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
|
4876 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
|
4877 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
|
4878 } 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
|
4879 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
|
4880 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4881 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
|
4882 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4883 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
|
4884 "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
|
4885 "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
|
4886 "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
|
4887 "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
|
4888 "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
|
4889 "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
|
4890 "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
|
4891 "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
|
4892 "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
|
4893 "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
|
4894 "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
|
4895 "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
|
4896 "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
|
4897 "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
|
4898 "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
|
4899 "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
|
4900 "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
|
4901 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4902 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4903 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
|
4904 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
|
4905 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4906 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
|
4907 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
|
4908 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
|
4909 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4910 // 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
|
4911 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
|
4912 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
|
4913 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
|
4914 String passw = con.getClientInfo("password"); |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4915 // 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
|
4916 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4917 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
|
4918 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
|
4919 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
|
4920 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
|
4921 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
|
4922 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4923 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4924 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
|
4925 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4926 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
|
4927 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
|
4928 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4929 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
|
4930 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
|
4931 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
|
4932 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4933 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
|
4934 |
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 // 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
|
4936 // 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
|
4937 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
|
4938 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
|
4939 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
|
4940 // 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
|
4941 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
|
4942 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
|
4943 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
|
4944 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4945 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
|
4946 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4947 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
|
4948 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
|
4949 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
|
4950 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4951 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
|
4952 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4953 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
|
4954 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
|
4955 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
|
4956 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4957 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
|
4958 } 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
|
4959 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
|
4960 } 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
|
4961 // 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
|
4962 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
|
4963 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4964 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4965 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
|
4966 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
4967 |
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
|
4968 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4969 // 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
|
4970 private void showTblContents(String tblnm) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4971 Statement stmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4972 ResultSet rs = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4973 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4974 stmt = con.createStatement(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4975 rs = stmt.executeQuery("SELECT * FROM " + tblnm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4976 if (rs != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4977 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
|
4978 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
|
4979 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
|
4980 sb.append("\t").append(rsmd.getColumnLabel(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4981 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4982 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4983 while (rs.next()) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4984 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
|
4985 sb.append("\t").append(rs.getString(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4986 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4987 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4988 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4989 } else |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4990 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
|
4991 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4992 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
|
4993 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4994 closeStmtResSet(stmt, rs); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4995 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4996 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4997 private void showParams(PreparedStatement pstmt) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4998 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
4999 // testing and showing parameter meta data |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5000 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5001 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
|
5002 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
|
5003 sb.append("Param ").append(parm).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5004 int nullable = pmd.isNullable(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5005 sb.append(" nullable ").append(nullable).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5006 switch (nullable) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5007 case ParameterMetaData.parameterNoNulls: sb.append("NO"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5008 case ParameterMetaData.parameterNullable: sb.append("YA"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5009 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
|
5010 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
|
5011 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5012 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5013 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
|
5014 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
|
5015 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
|
5016 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
|
5017 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
|
5018 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
|
5019 int mode = pmd.getParameterMode(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5020 sb.append(" mode ").append(mode).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5021 switch (mode) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5022 case ParameterMetaData.parameterModeIn: sb.append("IN"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5023 case ParameterMetaData.parameterModeInOut: sb.append("INOUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5024 case ParameterMetaData.parameterModeOut: sb.append("OUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5025 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
|
5026 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
|
5027 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5028 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5029 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5030 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5031 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
|
5032 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5033 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
5034 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5035 private void readExceptions(SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5036 while (e != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5037 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
|
5038 e = e.getNextException(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5039 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5040 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5041 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5042 private void readWarnings(SQLWarning w) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5043 while (w != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5044 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
|
5045 w = w.getNextWarning(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5046 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5047 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
5048 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5049 private void compareExpectedOutput(String testname, String expected) { |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5050 if (!expected.equals(sb.toString())) { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5051 System.out.print("Test '"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5052 System.out.print(testname); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5053 if (!testname.endsWith(")")) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5054 System.out.print("()"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5055 System.out.println("' produced different output!"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5056 System.out.println("Expected:"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5057 System.out.println(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
|
5058 System.out.println("Gotten:"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5059 System.out.println(sb); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5060 System.out.println(); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5061 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5062 if (sb.length() > sbInitLen) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5063 System.out.println("Test '" + testname |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5064 + "' produced output > " + sbInitLen |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5065 + " chars! Enlarge sbInitLen to: " + sb.length()); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
5066 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5067 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5068 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5069 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
|
5070 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
|
5071 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
|
5072 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
|
5073 } 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
|
5074 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5075 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5076 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5077 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
|
5078 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
|
5079 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
|
5080 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
|
5081 } 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
|
5082 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5083 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
|
5084 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
|
5085 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
|
5086 } 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
|
5087 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5088 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
5089 } |