Mercurial > hg > monetdb-java
annotate tests/JDBC_API_Tester.java @ 938:64ea9d5fbf87
Fix some compile with -Xlint flag errors and warnings
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 02 Jan 2025 19:42:36 +0100 (3 months ago) |
parents | d416e9b6b3d0 |
children | ff075ed5ce81 |
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 /* |
833
e890195256ac
Update copyright for the new year, move to MonetDB Foundation, add SPDX.
Sjoerd Mullender <sjoerd@acm.org>
parents:
832
diff
changeset
|
2 * SPDX-License-Identifier: MPL-2.0 |
e890195256ac
Update copyright for the new year, move to MonetDB Foundation, add SPDX.
Sjoerd Mullender <sjoerd@acm.org>
parents:
832
diff
changeset
|
3 * |
395
0eef53e06007
Add JDBC_API_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 * 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
|
5 * 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
|
6 * 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
|
7 * |
937
d416e9b6b3d0
Update Copyright year.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
932
diff
changeset
|
8 * Copyright 2024, 2025 MonetDB Foundation; |
833
e890195256ac
Update copyright for the new year, move to MonetDB Foundation, add SPDX.
Sjoerd Mullender <sjoerd@acm.org>
parents:
832
diff
changeset
|
9 * Copyright August 2008 - 2023 MonetDB B.V.; |
e890195256ac
Update copyright for the new year, move to MonetDB Foundation, add SPDX.
Sjoerd Mullender <sjoerd@acm.org>
parents:
832
diff
changeset
|
10 * Copyright 1997 - July 2008 CWI. |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
11 */ |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
12 |
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
|
13 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
|
14 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
|
15 import java.math.BigInteger; |
749
a604e71a875e
UTF-8 is a standard character set always available on Java, so use it where needed.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
748
diff
changeset
|
16 import java.nio.charset.StandardCharsets; |
931
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
17 import java.sql.*; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
18 import java.text.SimpleDateFormat; |
813
a71afa48f269
Use new MapiSocket.connect() method In CopyIntoSTDIN test
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
812
diff
changeset
|
19 import java.util.*; |
a71afa48f269
Use new MapiSocket.connect() method In CopyIntoSTDIN test
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
812
diff
changeset
|
20 |
a71afa48f269
Use new MapiSocket.connect() method In CopyIntoSTDIN test
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
812
diff
changeset
|
21 import org.monetdb.jdbc.MonetConnection; |
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. |
713
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
33 * Also all output is no longer send to system out/err but collected in a global StringBuilder. |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
34 * The contents of it is compared with the expected output at the end of each test. |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
35 * Only when it deviates the output is sent to system err, see compareExpectedOutput(). |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
36 * |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
37 * @author Martin van Dinther |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
38 * @version 0.3 |
395
0eef53e06007
Add JDBC_API_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 */ |
917
c2164decf7f1
Add final to classes
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
909
diff
changeset
|
40 public final class JDBC_API_Tester { |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
41 private StringBuilder sb; // buffer to collect the test output |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
42 private Connection con; // main connection shared by all tests |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
43 final private int dbmsMajorVersion; |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
44 final private int dbmsMinorVersion; |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
45 final private boolean isPostDec2023; // flag to support version specific output |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
46 private boolean foundDifferences = false; |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
47 |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
48 final private static int sbInitLen = 5468; // max needed size of sb |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
49 |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
50 /** |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
51 * constructor |
938
64ea9d5fbf87
Fix some compile with -Xlint flag errors and warnings
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
937
diff
changeset
|
52 * @param con_ an active connection |
64ea9d5fbf87
Fix some compile with -Xlint flag errors and warnings
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
937
diff
changeset
|
53 * @throws SQLException if a connection or database access error occurs |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
54 */ |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
55 JDBC_API_Tester(Connection con_) throws SQLException { |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
56 this.con = con_; |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
57 sb = new StringBuilder(sbInitLen); |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
58 |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
59 DatabaseMetaData dbmd = con_.getMetaData(); |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
60 dbmsMajorVersion = dbmd.getDatabaseMajorVersion(); |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
61 dbmsMinorVersion = dbmd.getDatabaseMinorVersion(); |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
62 // from version 11.50 on, the MonetDB server returns different metadata for |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
63 // integer digits (1 less) and for clob and char columns (now return varchar). |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
64 isPostDec2023 = versionIsAtLeast(11, 50); |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
65 } |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
66 |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
67 /** |
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
68 * main function |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
69 * @param args args[0] should contain the connectionURL string, args[1] an optional flag: -skipMALoutput |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
70 * @throws Exception if a connection or database access error occurs |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
71 */ |
395
0eef53e06007
Add JDBC_API_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 public static void main(String[] args) throws Exception { |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
73 if (args.length < 1) { |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
74 System.err.println("Error: Missing required connection URL as first startup argument!"); |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
75 System.exit(-1); |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
76 } |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
77 |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
78 final String con_URL = args[0]; |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
79 final boolean skipMALoutput = (args.length >= 2) ? args[1].equals("-skipMALoutput") : false; |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
80 // System.err.println("skipMALoutput = " + skipMALoutput); |
395
0eef53e06007
Add JDBC_API_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 |
797
9f6fe96c0ead
Arrange testing
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
782
diff
changeset
|
82 // Test this before trying to connect |
9f6fe96c0ead
Arrange testing
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
782
diff
changeset
|
83 UrlTester.runAllTests(); |
9f6fe96c0ead
Arrange testing
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
782
diff
changeset
|
84 |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
85 final Connection conn = DriverManager.getConnection(con_URL); |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
86 JDBC_API_Tester jt = new JDBC_API_Tester(conn); |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
87 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
88 // 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
|
89 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 jt.Test_Ctransaction(); |
931
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
96 jt.Test_Driver(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
|
97 jt.Test_Dobjects(); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
98 jt.Test_DBCmetadata(); |
692
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
99 jt.Test_EmptySql(); |
395
0eef53e06007
Add JDBC_API_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.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
|
101 jt.Test_Int128(); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
102 jt.Test_Interval_Types(); |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
103 jt.Test_PlanExplainTraceDebugCmds(skipMALoutput); |
395
0eef53e06007
Add JDBC_API_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 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
|
105 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
|
106 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
|
107 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
|
108 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
|
109 jt.Test_PSmetadata(); |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
110 jt.Test_PSsetBytes(); |
395
0eef53e06007
Add JDBC_API_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 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
|
112 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
|
113 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
|
114 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
|
115 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
|
116 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
|
117 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
|
118 jt.Test_Rmetadata(); |
694
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
119 jt.Test_RfetchManyColumnsInfo(); |
395
0eef53e06007
Add JDBC_API_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 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
|
121 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
|
122 jt.Test_Rtimedate(); |
713
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
123 jt.Test_RSgetMetaData(); |
395
0eef53e06007
Add JDBC_API_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 jt.Test_Sbatching(); |
725
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
125 jt.Test_SgeneratedKeys(); |
395
0eef53e06007
Add JDBC_API_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 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
|
127 jt.Test_Wrapper(); |
909
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
128 if (jt.isPostDec2023) |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
129 jt.Test_ClientInfo(con_URL); |
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
|
130 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 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
|
138 jt.Bug_LargeQueries_6571_6693(con_URL); |
691
fb55e62c50f3
Fixed an invalid error issue when a PreparedStatement had more than 250 parameters.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
689
diff
changeset
|
139 jt.Bug_PrepStmtManyParams_7337(480); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
140 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
|
141 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
|
142 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
|
143 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
|
144 jt.BugSetQueryTimeout_Bug_3357(); |
764
052c23fbfab2
Corrected implementation of Connection methods getClientInfo() and setClientInfo().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
757
diff
changeset
|
145 jt.SQLcopyinto(con_URL); |
664
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
146 jt.DecimalPrecisionAndScale(); |
694
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
147 |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
148 /* run next long running test (11 minutes) only before a new release */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
149 /* jt.Test_PSlargeamount(); */ |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
150 |
0eef53e06007
Add JDBC_API_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 jt.closeConx(jt.con); |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
152 |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
153 if (jt.foundDifferences) |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
154 System.exit(-1); |
550
c5cf3f00c4c5
Run the OnClient tests from JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
488
diff
changeset
|
155 |
674
b885de91095d
Add tests for autocommit and timezone handshake options
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
667
diff
changeset
|
156 ConnectionTests.runTests(con_URL); |
b885de91095d
Add tests for autocommit and timezone handshake options
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
667
diff
changeset
|
157 |
689
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
158 // invoke running OnClientTester only on Oct2020 (11.39) or older servers |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
159 if (!jt.versionIsAtLeast(11,40)) { |
686
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
160 OnClientTester oct = new OnClientTester(con_URL, 0); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
161 int failures = oct.runTests(); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
162 if (failures > 0) |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
163 System.exit(-1); |
8f989e43265d
Adapt JDBC_API_Tester to conditionally invoke running OnClientTester.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
682
diff
changeset
|
164 } |
395
0eef53e06007
Add JDBC_API_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 } |
0eef53e06007
Add JDBC_API_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 |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
167 private boolean versionIsAtLeast(int major, int minor) { |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
168 return (dbmsMajorVersion > major || (dbmsMajorVersion == major && dbmsMinorVersion >= minor)); |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
169 } |
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
170 |
395
0eef53e06007
Add JDBC_API_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 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
|
172 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
|
173 |
0eef53e06007
Add JDBC_API_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 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
|
175 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
|
176 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
|
177 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
|
178 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
|
179 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
|
180 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
|
181 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
182 // >> 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
|
183 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
|
184 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
|
185 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
|
186 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
|
187 |
0eef53e06007
Add JDBC_API_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 // 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
|
189 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
|
190 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
|
191 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
|
192 sb.append("passed :)\n"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
193 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
194 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
|
195 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
|
196 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
|
197 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
|
198 } 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
|
199 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
|
200 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
|
201 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
|
202 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
|
203 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
|
204 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
|
205 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
206 |
0eef53e06007
Add JDBC_API_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 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
|
208 // 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
|
209 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
|
210 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
|
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 // >> 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
|
213 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
|
214 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
|
215 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
|
216 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
|
217 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
218 // 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
|
219 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
|
220 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
|
221 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
|
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 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
|
224 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
|
225 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
|
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 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
|
228 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
|
229 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
|
230 |
0eef53e06007
Add JDBC_API_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 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
|
232 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
|
233 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
|
234 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
235 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
|
236 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
|
237 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
|
238 |
0eef53e06007
Add JDBC_API_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 // 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
|
240 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
|
241 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
|
242 } 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
|
243 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
|
244 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
245 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
246 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
|
247 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
|
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 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
|
250 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
251 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
|
252 "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
|
253 "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
|
254 "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
|
255 "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
|
256 "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
|
257 "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
|
258 "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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
262 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
|
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 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
|
265 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
|
266 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
|
267 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
|
268 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
|
269 } 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
|
270 // e.printStackTrace(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
271 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
|
272 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
|
273 // test calling conn.isValid() |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
274 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
|
275 // 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
|
276 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
|
277 } catch (SQLException e2) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
278 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
|
279 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
280 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
281 |
0eef53e06007
Add JDBC_API_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 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
|
283 // 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
|
284 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
|
285 } 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
|
286 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
|
287 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
288 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
289 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
|
290 |
0eef53e06007
Add JDBC_API_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 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
|
292 "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
|
293 "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
|
294 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
297 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
|
298 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
|
299 "-- 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
|
300 "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
|
301 "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
|
302 "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
|
303 "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
|
304 "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
|
305 "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
|
306 "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
|
307 "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
|
308 "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
|
309 "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
|
310 "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
|
311 |
0eef53e06007
Add JDBC_API_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 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
|
313 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
|
314 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
|
315 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
|
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 |
0eef53e06007
Add JDBC_API_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 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
|
319 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
|
320 // >> 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
|
321 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
|
322 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
|
323 |
0eef53e06007
Add JDBC_API_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 // 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
|
325 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
|
326 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
|
327 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
328 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
|
329 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
|
330 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
|
331 } |
0eef53e06007
Add JDBC_API_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 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
|
333 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
|
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 if (i != size) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
336 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
|
337 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
338 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
|
339 } 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
|
340 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
|
341 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
342 |
0eef53e06007
Add JDBC_API_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 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
|
344 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
345 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
|
346 "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
|
347 "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
|
348 "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
|
349 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
350 |
0eef53e06007
Add JDBC_API_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 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
|
352 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
|
353 |
0eef53e06007
Add JDBC_API_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 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
|
355 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
|
356 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
|
357 // 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
|
358 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
|
359 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
|
360 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
|
361 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
|
362 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
|
363 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
|
364 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
|
365 |
0eef53e06007
Add JDBC_API_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 // 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
|
367 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
|
368 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
|
369 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
|
370 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
371 sb.append("\n"); |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 // 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
|
374 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
|
375 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
|
376 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
|
377 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
|
378 // 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
|
379 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
|
380 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
|
381 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
|
382 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
|
383 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
|
384 } |
0eef53e06007
Add JDBC_API_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 } catch (SQLException e) { |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
386 sb.append(" FAILED: ").append(e.getMessage()).append("\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
387 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
388 |
0eef53e06007
Add JDBC_API_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 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
|
390 "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
|
391 "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
|
392 "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
|
393 "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
|
394 "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
|
395 "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
|
396 "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
|
397 "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
|
398 "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
|
399 "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
|
400 "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
|
401 "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
|
402 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
405 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
|
406 |
0eef53e06007
Add JDBC_API_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 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
|
408 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
|
409 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
|
410 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
|
411 // >> 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
|
412 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
|
413 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
414 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
|
415 // 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
|
416 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
|
417 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
|
418 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
|
419 |
0eef53e06007
Add JDBC_API_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 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
|
421 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
|
422 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
|
423 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
|
424 |
0eef53e06007
Add JDBC_API_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 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
|
426 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
|
427 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
|
428 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
429 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
|
430 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
|
431 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
|
432 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
|
433 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
|
434 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
|
435 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
|
436 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
|
437 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
438 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
|
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 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
|
441 |
0eef53e06007
Add JDBC_API_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 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
|
443 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
|
444 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
|
445 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
446 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
|
447 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
|
448 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
|
449 |
0eef53e06007
Add JDBC_API_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 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
|
451 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
|
452 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
|
453 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
|
454 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
|
455 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
|
456 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
|
457 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
|
458 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
459 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
|
460 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
461 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
|
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("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
|
464 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
|
465 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
|
466 |
0eef53e06007
Add JDBC_API_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 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
|
468 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
|
469 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
|
470 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
|
471 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
|
472 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
|
473 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
|
474 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
|
475 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
476 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
|
477 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
478 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
|
479 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
480 sb.append("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
|
481 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
|
482 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
|
483 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
484 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
|
485 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
486 // 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
|
487 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
|
488 } 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
|
489 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
|
490 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
491 |
0eef53e06007
Add JDBC_API_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 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
|
493 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
494 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
|
495 "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
|
496 "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
|
497 "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
|
498 "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
|
499 "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
|
500 "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
|
501 "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
|
502 "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
|
503 "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
|
504 "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
|
505 "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
|
506 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
507 |
0eef53e06007
Add JDBC_API_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 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
|
509 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
|
510 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
511 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
|
512 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
|
513 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
|
514 // >> 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
|
515 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
|
516 |
0eef53e06007
Add JDBC_API_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 // 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
|
518 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
|
519 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
|
520 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
|
521 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
|
522 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
523 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
|
524 } |
0eef53e06007
Add JDBC_API_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 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
|
526 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
527 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
|
528 // >> 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
|
529 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
|
530 |
0eef53e06007
Add JDBC_API_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 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
|
532 /* 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
|
533 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
|
534 sb.append("passed\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
535 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
536 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
|
537 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
|
538 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
539 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
|
540 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
|
541 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
|
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 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
|
544 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
|
545 int items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
546 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
|
547 while (rs.next()) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
548 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
|
549 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
|
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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
552 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
|
553 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
554 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
|
555 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
556 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
|
557 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
|
558 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
|
559 |
0eef53e06007
Add JDBC_API_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 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
|
561 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
|
562 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
|
563 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
564 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
|
565 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
|
566 items = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
567 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
|
568 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
569 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
|
570 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
|
571 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
573 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
|
574 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
575 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
|
576 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
577 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
|
578 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
|
579 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
|
580 |
0eef53e06007
Add JDBC_API_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 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
|
582 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
|
583 items = 3; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
584 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
|
585 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
586 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
|
587 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
|
588 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
590 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
|
591 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
592 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
|
593 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
594 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
|
595 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
|
596 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
|
597 |
0eef53e06007
Add JDBC_API_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 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
|
599 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
|
600 items = 0; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
601 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
|
602 while (rs.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
603 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
|
604 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
|
605 } |
0eef53e06007
Add JDBC_API_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 if (i != items) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
607 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
|
608 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
609 sb.append(" 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
|
610 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
611 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
|
612 |
0eef53e06007
Add JDBC_API_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 // 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
|
614 con.setAutoCommit(true); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
615 } 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
|
616 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
|
617 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
618 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
619 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
|
620 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
621 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
|
622 "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
|
623 "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
|
624 "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
|
625 "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
|
626 "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
|
627 "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
|
628 "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
|
629 "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
|
630 "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
|
631 "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
|
632 "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
|
633 "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
|
634 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
635 |
0eef53e06007
Add JDBC_API_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 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
|
637 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
|
638 |
0eef53e06007
Add JDBC_API_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 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
|
640 // 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
|
641 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
|
642 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
|
643 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
|
644 } 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
|
645 // 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
|
646 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
|
647 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
648 sb.append("\n"); |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
651 // 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
|
652 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
|
653 // >> 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
|
654 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
|
655 |
0eef53e06007
Add JDBC_API_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 // 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
|
657 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
|
658 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
|
659 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
|
660 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
661 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
|
662 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
|
663 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
|
664 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
665 sb.append("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
|
666 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
|
667 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
|
668 } 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
|
669 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
|
670 } |
0eef53e06007
Add JDBC_API_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 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
|
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 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
|
674 try { |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
675 // turn on auto commit |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
676 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
|
677 // >> 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
|
678 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
|
679 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
680 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
|
681 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
|
682 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
|
683 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
|
684 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
685 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
|
686 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
|
687 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
|
688 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
689 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
|
690 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
|
691 |
0eef53e06007
Add JDBC_API_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 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
|
693 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
|
694 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
|
695 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
696 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
|
697 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
|
698 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
|
699 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
700 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
|
701 } 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
|
702 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
|
703 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
704 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
|
705 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
706 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
|
707 // 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
|
708 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
|
709 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
|
710 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
|
711 } 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
|
712 // 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
|
713 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
|
714 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
715 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
|
716 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
717 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
|
718 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
719 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
|
720 "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
|
721 "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
|
722 "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
|
723 "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
|
724 "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
|
725 "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
|
726 "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
|
727 "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
|
728 "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
|
729 "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
|
730 "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
|
731 "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
|
732 "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
|
733 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
734 |
931
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
735 private void Test_Driver(String con_URL) { |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
736 sb.setLength(0); // clear the output log buffer |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
737 |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
738 try { |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
739 final Driver driver = DriverManager.getDriver(con_URL); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
740 DriverPropertyInfo[] props = driver.getPropertyInfo(con_URL, null); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
741 DriverPropertyInfo prop; |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
742 final String space = " "; |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
743 for (int i = 0; i < props.length; i++) { |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
744 prop = props[i]; |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
745 sb.append(i).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
746 sb.append(prop.name).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
747 sb.append(prop.required).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
748 sb.append(prop.value).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
749 sb.append(prop.description).append("\n"); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
750 } |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
751 // also test against monetdbs, this should make tls and cert required. |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
752 props = driver.getPropertyInfo("jdbc:monetdbs:", null); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
753 sb.append("getPropertyInfo of jdbc:monetdbs:").append("\n"); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
754 for (int i = 0; i < props.length; i++) { |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
755 prop = props[i]; |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
756 sb.append(i).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
757 sb.append(prop.name).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
758 sb.append(prop.required).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
759 sb.append(prop.value).append(space); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
760 sb.append(prop.description).append("\n"); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
761 } |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
762 } catch (SQLException e) { |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
763 // this means we get what we expect |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
764 sb.append("failed to get Driver class: ").append(e.getMessage()); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
765 sb.append("\n"); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
766 } |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
767 |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
768 compareExpectedOutput("Test_Driver", |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
769 "0 user true null User loginname to use when authenticating on the database server\n" + |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
770 "1 password true null Password to use when authenticating on the database server\n" + |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
771 "getPropertyInfo of jdbc:monetdbs:\n" + |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
772 "0 user true null User loginname to use when authenticating on the database server\n" + |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
773 "1 password true null Password to use when authenticating on the database server\n" + |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
774 "2 tls true null secure the connection using TLS\n" + |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
775 "3 cert true null path to TLS certificate to authenticate server with\n"); |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
776 } |
df18aa5c8a61
Add test for MonetDriver.getPropertyInfo(url, props).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
929
diff
changeset
|
777 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
778 private void handleExecuteDDL(Statement stmt, String action, String objtype, String objname, String sql) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
779 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
780 int response = stmt.executeUpdate(sql); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
781 if (response != Statement.SUCCESS_NO_INFO) |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
782 sb.append(action).append(" ").append(objtype).append(" ").append(objname).append(" failed to return -2!! It returned: ").append(response).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
783 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
784 sb.append("Failed to ").append(action).append(" ").append(objtype).append(" ").append(objname).append(": ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
785 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
786 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
787 |
395
0eef53e06007
Add JDBC_API_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 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
|
789 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
|
790 |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
791 Statement stmt = null; |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
792 try { |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
793 stmt = con.createStatement(); |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
794 } catch (SQLException e) { |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
795 sb.append("failed to createStatement: ").append(e.getMessage()).append("\n"); |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
796 } |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
797 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
798 String action = "Create"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
799 final String objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
800 handleExecuteDDL(stmt, action, objtype, "nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
801 "CREATE TABLE nopk_twoucs (id INT NOT NULL UNIQUE, name VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
802 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
803 handleExecuteDDL(stmt, action, objtype, "tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
804 "CREATE LOCAL TEMP TABLE tmp_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
805 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
806 handleExecuteDDL(stmt, action, objtype, "tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
807 "CREATE LOCAL TEMP TABLE tmp_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
808 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
809 handleExecuteDDL(stmt, action, objtype, "glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
810 "CREATE GLOBAL TEMP TABLE glbl_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
811 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
812 handleExecuteDDL(stmt, action, objtype, "glbl_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
813 "CREATE GLOBAL TEMP TABLE glbl_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE)"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
814 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
815 handleExecuteDDL(stmt, action, "type", "xml", "CREATE TYPE xml EXTERNAL NAME xml"); |
642
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
816 |
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
817 try { |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
818 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
|
819 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
820 // 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
|
821 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
|
822 "Resultset with 1 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
823 "TABLE_CAT\n" + |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
824 "char(1)\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
825 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
826 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
|
827 "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
|
828 "TABLE_SCHEM TABLE_CATALOG\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
829 "varchar(1024) char(1)\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
830 "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
|
831 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
832 compareResultSet(dbmd.getTables(null, "tmp", null, null), "getTables(null, tmp, null, null)", // schema tmp has 6 system tables and 4 temporary test tables |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
833 "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
|
834 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
835 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
836 "null tmp glbl_nopk_twoucs GLOBAL TEMPORARY TABLE null null null null null null\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
837 "null tmp glbl_pk_uc GLOBAL TEMPORARY TABLE null null null null null null\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
838 "null tmp tmp_nopk_twoucs LOCAL TEMPORARY TABLE null null null null null null\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
839 "null tmp tmp_pk_uc LOCAL TEMPORARY TABLE null null null null null null\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
840 "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
|
841 "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
|
842 "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
|
843 "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
|
844 "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
|
845 "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
|
846 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
847 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
|
848 "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
|
849 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
850 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
851 "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
|
852 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
853 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
|
854 "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
|
855 "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" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
856 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint " + (isPostDec2023 ? "var" : "") + "char(3) varchar(3)\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
857 "null sys table_types table_type_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
858 "null sys table_types table_type_name 12 varchar 25 0 0 0 0 null null 0 0 100 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
|
859 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
860 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
|
861 "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
|
862 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
863 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
864 "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
|
865 |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
866 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "tmp_pk_uc"), "getPrimaryKeys(null, tmp, tmp_pk_uc)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
867 "Resultset with 6 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
868 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
869 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
870 "null tmp tmp_pk_uc id1 1 tmp_pk_uc_id1_pkey\n"); |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
871 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
872 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "glbl_pk_uc"), "getPrimaryKeys(null, tmp, glbl_pk_uc)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
873 "Resultset with 6 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
874 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
875 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
876 "null tmp glbl_pk_uc id1 1 glbl_pk_uc_id1_pkey\n"); |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
877 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
878 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
|
879 "Resultset with 14 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
880 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
881 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
882 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
883 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
|
884 "Resultset with 14 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
885 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
886 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
887 |
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
888 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
|
889 "Resultset with 14 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
890 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
891 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
892 |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
893 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
|
894 "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
|
895 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
896 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
898
281b56c61693
Adapt output of Test 'getIndexInfo(null, sys, key_types, false, false)' for servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
894
diff
changeset
|
897 "null sys key_types false null key_types_key_type_id_pkey 2 1 key_type_id null " + (isPostDec2023 ? "5" : "3") + " 0 null\n" + |
281b56c61693
Adapt output of Test 'getIndexInfo(null, sys, key_types, false, false)' for servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
894
diff
changeset
|
898 "null sys key_types false null key_types_key_type_name_unique 2 1 key_type_name null " + (isPostDec2023 ? "5" : "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
|
899 |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
900 compareResultSet(dbmd.getIndexInfo(null, "tmp", "tmp_pk_uc", false, false), "getIndexInfo(null, tmp, tmp_pk_uc, false, false)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
901 "Resultset with 13 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
902 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
903 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
904 "null tmp tmp_pk_uc false null tmp_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
905 "null tmp tmp_pk_uc false null tmp_pk_uc_name1_unique 2 1 name1 null 0 0 null\n"); |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
906 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
907 compareResultSet(dbmd.getIndexInfo(null, "tmp", "glbl_pk_uc", false, false), "getIndexInfo(null, tmp, glbl_pk_uc, false, false)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
908 "Resultset with 13 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
909 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
910 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
911 "null tmp glbl_pk_uc false null glbl_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
912 "null tmp glbl_pk_uc false null glbl_pk_uc_name1_unique 2 1 name1 null 0 0 null\n"); |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
913 |
619
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
914 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
915 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
916 "Resultset with 8 columns\n" + |
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
917 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
918 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
919 "2 language_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
619
ffc2fc8e82ec
Fixed an SQL query problem in DatabaseMetaData.getBestRowIdentifier() method when used with MonetDB Jan2022 (or newer) releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
610
diff
changeset
|
920 |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
921 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
922 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
923 "Resultset with 8 columns\n" + |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
924 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
925 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
926 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
927 |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
928 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
929 "getBestRowIdentifier(null, sys, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
930 "Resultset with 8 columns\n" + |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
931 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
932 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
933 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
934 |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
935 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
936 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
937 "Resultset with 8 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
938 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
939 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
940 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
941 |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
942 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
943 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
944 "Resultset with 8 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
945 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
946 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
947 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
948 |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
949 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
950 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
951 "Resultset with 8 columns\n" + |
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
952 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
953 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
954 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
645
fbed03097738
Corrected DatabaseMetaData methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
643
diff
changeset
|
955 |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
956 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
957 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
958 "Resultset with 8 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
959 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
960 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
961 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
962 |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
963 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
964 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
965 "Resultset with 8 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
966 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
967 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
968 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
969 |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
970 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
971 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
972 "Resultset with 8 columns\n" + |
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
973 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
974 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
975 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
649
060347aa81ea
By fixing methods getPrimaryKeys(), getBestRowIdentifier() and getIndexInfo() for local temporary tables, it also caused it to fail for global temporary tables in schema tmp.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
647
diff
changeset
|
976 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
977 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
|
978 "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
|
979 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
980 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + |
399
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
981 "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
|
982 |
427
e79bfbd0553e
Added support for escaped wildcards (\% en \_) in String arguments of
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
406
diff
changeset
|
983 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
|
984 "Resultset with 8 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
985 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
986 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
987 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
988 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
|
989 "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
|
990 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
991 "char(1) varchar(1024) varchar(1024) " + (isPostDec2023 ? "var" : "") + "char(16) int varchar(256) smallint\n" + |
642
dd9b4fb14256
Added recognition of 'xml' type.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
641
diff
changeset
|
992 "null sys xml java.lang.String 2000 xml null\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
993 |
0eef53e06007
Add JDBC_API_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 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
|
995 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
|
996 "Resultset with 7 columns\n" + |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
997 "TYPE_CAT TYPE_SCHEM TYPE_NAME CLASS_NAME DATA_TYPE REMARKS BASE_TYPE\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
998 "char(1) varchar(1024) varchar(1024) " + (isPostDec2023 ? "var" : "") + "char(16) int varchar(256) smallint\n"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
999 |
0eef53e06007
Add JDBC_API_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 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
|
1001 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1002 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
|
1003 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
|
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 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
1006 // cleanup created db objects |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1007 action = "Drop"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1008 handleExecuteDDL(stmt, action, objtype, "nopk_twoucs", "DROP TABLE nopk_twoucs"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1009 handleExecuteDDL(stmt, action, objtype, "tmp_nopk_twoucs", "DROP TABLE tmp_nopk_twoucs"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1010 handleExecuteDDL(stmt, action, objtype, "tmp_pk_uc", "DROP TABLE tmp_pk_uc"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1011 handleExecuteDDL(stmt, action, objtype, "glbl_nopk_twoucs", "DROP TABLE glbl_nopk_twoucs"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1012 handleExecuteDDL(stmt, action, objtype, "glbl_pk_uc", "DROP TABLE glbl_pk_uc"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1013 handleExecuteDDL(stmt, action, "type", "xml", "DROP TYPE xml"); |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
1014 |
635
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
1015 closeStmtResSet(stmt, null); |
ee90918eab11
Add tests for getBestRowIdentifier() on a table which does not have a primary key but two unique constraints of which one is defined on a column which allows NULL.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
633
diff
changeset
|
1016 |
395
0eef53e06007
Add JDBC_API_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 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
|
1018 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
1021 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
|
1022 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1023 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
|
1024 int columnCount = rsmd.getColumnCount(); |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1025 int suppressSPECIFIC_NAME = 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
|
1026 sb.append("Resultset with ").append(columnCount).append(" columns\n"); |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1027 // print result column header names |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1028 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
|
1029 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
|
1030 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
|
1031 sb.append(rsmd.getColumnName(col)); |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1032 if ("SPECIFIC_NAME".equals(rsmd.getColumnName(col))) |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1033 suppressSPECIFIC_NAME = col; // contains internal id values which change |
395
0eef53e06007
Add JDBC_API_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 } |
0eef53e06007
Add JDBC_API_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 sb.append("\n"); |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1036 // print result column data type info |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1037 for (int col = 1; col <= columnCount; col++) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1038 if (col > 1) |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1039 sb.append("\t"); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1040 sb.append(rsmd.getColumnTypeName(col)); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1041 switch (rsmd.getColumnType(col)) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1042 case Types.CHAR: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1043 case Types.VARCHAR: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1044 case Types.CLOB: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1045 case Types.BLOB: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1046 case Types.DECIMAL: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1047 case Types.NUMERIC: |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1048 { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1049 int prec = rsmd.getPrecision(col); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1050 if (prec != 0) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1051 sb.append('(').append(prec); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1052 int scale = rsmd.getScale(col); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1053 if (scale != 0) { |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1054 sb.append(',').append(scale); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1055 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1056 sb.append(')'); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1057 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1058 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1059 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1060 } |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1061 sb.append("\n"); |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1062 |
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
1063 // print result rows data |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1064 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
|
1065 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
|
1066 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
|
1067 sb.append("\t"); |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1068 if (col == suppressSPECIFIC_NAME) |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1069 sb.append("suppressed"); |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1070 else |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1071 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
|
1072 } |
0eef53e06007
Add JDBC_API_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 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
|
1074 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1075 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
|
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 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
|
1078 } |
0eef53e06007
Add JDBC_API_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 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1080 // same tests as done in clients/odbc/tests/ODBCmetadata.c |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1081 private void Test_DBCmetadata() { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1082 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1083 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1084 Statement stmt = null; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1085 DatabaseMetaData dbmd = null; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1086 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1087 stmt = con.createStatement(); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1088 dbmd = con.getMetaData(); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1089 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1090 sb.append("Failed to createStatement: ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1091 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1092 |
872
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1093 try { |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1094 // test dbmd methods which sent a query to the server and return a String. |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1095 String s = dbmd.getSQLKeywords(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1096 if (s == null || s.length() < 10) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1097 sb.append("getSQLKeywords()").append(" failed to return a large enough list\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1098 s = dbmd.getNumericFunctions(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1099 if (s == null || s.length() < 10) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1100 sb.append("getNumericFunctions()").append(" failed to return a large enough list\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1101 s = dbmd.getStringFunctions(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1102 if (s == null || s.length() < 10) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1103 sb.append("getStringFunctions()").append(" failed to return a large enough list\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1104 s = dbmd.getSystemFunctions(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1105 if (s == null || s.length() < 10) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1106 sb.append("getSystemFunctions()").append(" failed to return a large enough list\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1107 s = dbmd.getTimeDateFunctions(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1108 if (s == null || s.length() < 10) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1109 sb.append("getTimeDateFunctions()").append(" failed to return a large enough list\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1110 s = dbmd.getUserName(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1111 if (s == null || s.length() < 1) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1112 sb.append("getUserName() failed to return a valid name\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1113 s = dbmd.getDatabaseProductVersion(); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1114 if (s == null || s.length() < 1) |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1115 sb.append("getDatabaseProductVersion() failed to return a valid version\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1116 } catch (SQLException e) { |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1117 sb.append(e.getMessage()).append("\n"); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1118 } |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1119 compareExpectedOutput("Test_DBCmetadata() testing dbmd.get...Functions() as String", ""); |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1120 sb.setLength(0); // clear the output log buffer |
aa30a3be8787
Extend Test_DBCmetadata() with calls to DatabaseMetaData methods which return a String and need to sent a query to the server to get the info.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
871
diff
changeset
|
1121 |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1122 /* servers before Jan2022 (11.45) have a problem (server crash and db corruption) |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1123 with indexes created on temp tables, so conditionally execute those commands and tests */ |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1124 final boolean testCreateDropIndexOnTmpTables = !(dbmsMajorVersion == 11 && dbmsMinorVersion <= 43); |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1125 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1126 String action = "Create"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1127 handleExecuteDDL(stmt, action, "schema", "jdbctst", "CREATE SCHEMA jdbctst; SET SCHEMA jdbctst;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1128 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1129 String objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1130 // create tables to populate data dictionary. Used for testing getTables(), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1131 // getColumns(), getBestRowIdentifier(), getPrimaryKeys(), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1132 // getExportedKeys(), getImportedKeys(), getCrossReference() |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1133 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1134 "CREATE TABLE jdbctst.pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1135 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1136 "CREATE LOCAL TEMP TABLE tmp.tmp_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1137 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1138 "CREATE GLOBAL TEMP TABLE tmp.glbl_pk_uc (id1 INT NOT NULL PRIMARY KEY, name1 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1139 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1140 "CREATE TABLE jdbctst.nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1141 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1142 "CREATE LOCAL TEMP TABLE tmp.tmp_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1143 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1144 "CREATE GLOBAL TEMP TABLE tmp.glbl_nopk_twoucs (id2 INT NOT NULL UNIQUE, name2 VARCHAR(99) UNIQUE);"); |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1145 handleExecuteDDL(stmt, action, objtype, "tmp.tlargechar", |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1146 "CREATE TEMP TABLE tlargechar (c1 varchar(2147483647), c2 char(2147483646), c3 clob(2147483645), c4 json(2147483644), c5 url(2147483643)) ON COMMIT PRESERVE ROWS;"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1147 /* next 3 tables copied from example in https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlforeignkeys-function?view=sql-server-ver15 */ |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1148 handleExecuteDDL(stmt, action, objtype, "\"CUSTOMERS\"", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1149 "CREATE TABLE \"CUSTOMERS\" (\"CUSTID\" INT PRIMARY KEY, \"NAME\" VARCHAR(60) NOT NULL, \"ADDRESS\" VARCHAR(90), \"PHONE\" VARCHAR(20));"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1150 handleExecuteDDL(stmt, action, objtype, "\"ORDERS\"", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1151 "CREATE TABLE \"ORDERS\" (\"ORDERID\" INT PRIMARY KEY, \"CUSTID\" INT NOT NULL REFERENCES \"CUSTOMERS\" (\"CUSTID\")" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1152 ", \"OPENDATE\" DATE NOT NULL, \"SALESPERSON\" VARCHAR(60), \"STATUS\" VARCHAR(10) NOT NULL);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1153 handleExecuteDDL(stmt, action, objtype, "\"LINES\"", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1154 "CREATE TABLE \"LINES\" (\"ORDERID\" INT NOT NULL REFERENCES \"ORDERS\" (\"ORDERID\"), \"LINES\" INT" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1155 ", PRIMARY KEY (\"ORDERID\", \"LINES\"), \"PARTID\" INT NOT NULL, \"QUANTITY\" DECIMAL(9,3) NOT NULL);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1156 /* also test situation where one table has multiple fks to the same multi column pk */ |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1157 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk2c", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1158 "CREATE TABLE jdbctst.pk2c (pkc1 INT, pkc2 VARCHAR(99), name1 VARCHAR(99) UNIQUE, PRIMARY KEY (pkc2, pkc1));"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1159 handleExecuteDDL(stmt, action, objtype, "jdbctst.fk2c", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1160 "CREATE TABLE jdbctst.fk2c (fkc1 INT NOT NULL PRIMARY KEY, fkc2 VARCHAR(99), fkc3 INT" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1161 ", FOREIGN KEY (fkc2, fkc1) REFERENCES jdbctst.pk2c (pkc2, pkc1) ON UPDATE CASCADE ON DELETE RESTRICT" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1162 ", FOREIGN KEY (fkc2, fkc3) REFERENCES jdbctst.pk2c (pkc2, pkc1) ON UPDATE SET NULL ON DELETE NO ACTION);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1163 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1164 // create indexes to populate catalog. Used for testing getIndexInfo() |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1165 objtype = "index"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1166 handleExecuteDDL(stmt, action, objtype, "pk_uc_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1167 "CREATE INDEX pk_uc_i ON jdbctst.pk_uc (id1, name1);"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1168 handleExecuteDDL(stmt, action, objtype, "nopk_twoucs_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1169 "CREATE INDEX nopk_twoucs_i ON jdbctst.nopk_twoucs (id2, name2);"); |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1170 if (testCreateDropIndexOnTmpTables) { |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1171 handleExecuteDDL(stmt, action, objtype, "tmp_pk_uc_i", |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1172 "CREATE INDEX tmp_pk_uc_i ON tmp.tmp_pk_uc (id1, name1);"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1173 handleExecuteDDL(stmt, action, objtype, "glbl_pk_uc_i", |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1174 "CREATE INDEX glbl_pk_uc_i ON tmp.glbl_pk_uc (id1, name1);"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1175 handleExecuteDDL(stmt, action, objtype, "tmp_nopk_twoucs_i", |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1176 "CREATE INDEX tmp_nopk_twoucs_i ON tmp.tmp_nopk_twoucs (id2, name2);"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1177 handleExecuteDDL(stmt, action, objtype, "glbl_nopk_twoucs_i", |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1178 "CREATE INDEX glbl_nopk_twoucs_i ON tmp.glbl_nopk_twoucs (id2, name2);"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1179 } |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1180 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1181 // grant privileges to populate catalog. Used for testing getTablePrivileges() and getColumnPrivileges() |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1182 action = "grant"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1183 objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1184 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1185 "GRANT SELECT ON TABLE jdbctst.pk_uc TO PUBLIC;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1186 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1187 "GRANT INSERT, UPDATE, DELETE ON TABLE jdbctst.pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1188 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1189 "GRANT SELECT (id2, name2), UPDATE (name2) ON TABLE jdbctst.nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1190 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1191 "GRANT INSERT, DELETE ON TABLE tmp.tmp_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1192 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1193 "GRANT SELECT (id1, name1), UPDATE (name1) ON TABLE tmp.tmp_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1194 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc ", |
687
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1195 "GRANT INSERT, DELETE ON TABLE tmp.tmp_pk_uc TO monetdb;"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1196 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1197 "GRANT SELECT (id1, name1), UPDATE (name1) ON TABLE tmp.glbl_pk_uc TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1198 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1199 "GRANT INSERT, DELETE ON TABLE tmp.tmp_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1200 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1201 "GRANT SELECT (id2, name2), UPDATE (name2) ON TABLE tmp.tmp_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1202 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1203 "GRANT DELETE, INSERT ON TABLE tmp.glbl_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1204 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1205 "GRANT SELECT (id2, name2), UPDATE (name2) ON TABLE tmp.glbl_nopk_twoucs TO monetdb;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1206 |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1207 // create user procedure to test getProcedures() and getProcedureColumns() |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1208 action = "create"; |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1209 objtype = "procedure"; |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1210 handleExecuteDDL(stmt, action, objtype, "jdbctst.proc", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1211 "CREATE PROCEDURE jdbctst.proc(id bigint, name varchar(999), dt date) BEGIN SET SCHEMA jdbctst; /* ... */ END;"); |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1212 |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1213 // create user function to test getFunctions() and getFunctionColumns() |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1214 action = "create"; |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1215 objtype = "function"; |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1216 handleExecuteDDL(stmt, action, objtype, "jdbctst.func", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1217 "CREATE FUNCTION jdbctst.func(id bigint, name varchar(999), dt date) RETURNS TABLE (val varchar(1022), dt date, id int) BEGIN return SELECT id||' '||name ||' '|| dt, dt, id WHERE id > 0; END;"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1218 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1219 // set COMMENT ON schema, tables, columns, indexes, procedures and functions to fetch (and test) data in the REMARKS result column |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1220 action = "comment on"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1221 handleExecuteDDL(stmt, action, "schema", "jdbctst", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1222 "COMMENT ON SCHEMA jdbctst IS 'jdbctst schema comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1223 objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1224 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1225 "COMMENT ON TABLE jdbctst.pk_uc IS 'jdbctst.pk_uc table comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1226 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1227 "COMMENT ON TABLE jdbctst.nopk_twoucs IS 'jdbctst.nopk_twoucs table comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1228 objtype = "column"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1229 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs.id2", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1230 "COMMENT ON COLUMN jdbctst.nopk_twoucs.id2 IS 'jdbctst.nopk_twoucs.id2 column comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1231 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs.name2", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1232 "COMMENT ON COLUMN jdbctst.nopk_twoucs.name2 IS 'jdbctst.nopk_twoucs.name2 column comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1233 objtype = "index"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1234 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1235 "COMMENT ON INDEX jdbctst.pk_uc_i IS 'jdbctst.pk_uc_i index comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1236 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs_i", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1237 "COMMENT ON INDEX jdbctst.nopk_twoucs_i IS 'jdbctst.nopk_twoucs_i index comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1238 objtype = "procedure"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1239 handleExecuteDDL(stmt, action, objtype, "sys.analyze()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1240 "COMMENT ON PROCEDURE sys.analyze() IS 'sys.analyze() procedure comment';"); |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1241 handleExecuteDDL(stmt, action, objtype, "jdbctst.proc", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1242 "COMMENT ON PROCEDURE jdbctst.proc IS 'jdbctst.proc procedure comment';"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1243 objtype = "function"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1244 handleExecuteDDL(stmt, action, objtype, "sys.sin(double)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1245 "COMMENT ON FUNCTION sys.sin(double) IS 'sys.sin(double) function comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1246 handleExecuteDDL(stmt, action, objtype, "sys.env()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1247 "COMMENT ON FUNCTION sys.env() IS 'sys.env() function comment';"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1248 handleExecuteDDL(stmt, action, objtype, "sys.statistics()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1249 "COMMENT ON FUNCTION sys.statistics() IS 'sys.statistics() function comment';"); |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1250 handleExecuteDDL(stmt, action, objtype, "jdbctst.func", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1251 "COMMENT ON FUNCTION jdbctst.func IS 'jdbctst.func function comment';"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1252 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1253 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1254 // query the catalog by calling DatabaseMetaData methods |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1255 compareResultSet(dbmd.getCatalogs(), "getCatalogs()", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1256 "Resultset with 1 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1257 "TABLE_CAT\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1258 "char(1)\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1259 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1260 compareResultSet(dbmd.getSchemas(null, "jdbctst"), "getSchemas(null, jdbctst)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1261 "Resultset with 2 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1262 "TABLE_SCHEM TABLE_CATALOG\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1263 "varchar(1024) char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1264 "jdbctst null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1265 |
680
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1266 compareResultSet(dbmd.getSchemas(null, ""), "getSchemas(null, emptystring)", |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1267 "Resultset with 2 columns\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1268 "TABLE_SCHEM TABLE_CATALOG\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1269 "varchar(1024) char(1)\n"); |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1270 |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1271 compareResultSet(dbmd.getSchemas("%", "%%"), "getSchemas(%, %%)", |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1272 "Resultset with 2 columns\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1273 "TABLE_SCHEM TABLE_CATALOG\n" + |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1274 "varchar(1024) char(1)\n"); |
238d6a3a6469
Improve composeMatchPart(final String in). Prevent parsing pattern when length is 0. Optimise patterns: % or %%.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
674
diff
changeset
|
1275 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1276 compareResultSet(dbmd.getTables(null, "jdbctst", null, null), "getTables(null, jdbctst, null, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1277 "Resultset with 10 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1278 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1279 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1280 "null jdbctst CUSTOMERS TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1281 "null jdbctst LINES TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1282 "null jdbctst ORDERS TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1283 "null jdbctst fk2c TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1284 "null jdbctst nopk_twoucs TABLE jdbctst.nopk_twoucs table comment null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1285 "null jdbctst pk2c TABLE null null null null null null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1286 "null jdbctst pk_uc TABLE jdbctst.pk_uc table comment null null null null null\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1287 |
827
b2cbe866d020
Enhanced DatabaseMetaData.getTables() method by adding support for SQL table type names: 'BASE TABLE', 'GLOBAL TEMPORARY' and 'LOCAL TEMPORARY' in parameter types[].
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
820
diff
changeset
|
1288 String tabletypes[] = {"BASE TABLE", "LOCAL TEMPORARY", "GLOBAL TEMPORARY"}; |
b2cbe866d020
Enhanced DatabaseMetaData.getTables() method by adding support for SQL table type names: 'BASE TABLE', 'GLOBAL TEMPORARY' and 'LOCAL TEMPORARY' in parameter types[].
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
820
diff
changeset
|
1289 compareResultSet(dbmd.getTables(null, "tmp", "tlargechar", tabletypes), "getTables(null, tmp, tlargechar, tabletypes)", |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1290 "Resultset with 10 columns\n" + |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1291 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1292 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n" + |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1293 "null tmp tlargechar LOCAL TEMPORARY TABLE null null null null null null\n"); |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1294 |
844
9ad9c8c38fe4
The String types[] passed to getTables() may contain entries containing null or empty string "". Those are invalid table types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
833
diff
changeset
|
1295 String badtabletypes[] = {null, "", null, ""}; |
9ad9c8c38fe4
The String types[] passed to getTables() may contain entries containing null or empty string "". Those are invalid table types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
833
diff
changeset
|
1296 compareResultSet(dbmd.getTables(null, "tmp", "tlargechar", badtabletypes), "getTables(null, tmp, tlargechar, badtabletypes)", |
9ad9c8c38fe4
The String types[] passed to getTables() may contain entries containing null or empty string "". Those are invalid table types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
833
diff
changeset
|
1297 "Resultset with 10 columns\n" + |
9ad9c8c38fe4
The String types[] passed to getTables() may contain entries containing null or empty string "". Those are invalid table types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
833
diff
changeset
|
1298 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
9ad9c8c38fe4
The String types[] passed to getTables() may contain entries containing null or empty string "". Those are invalid table types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
833
diff
changeset
|
1299 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n"); |
9ad9c8c38fe4
The String types[] passed to getTables() may contain entries containing null or empty string "". Those are invalid table types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
833
diff
changeset
|
1300 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1301 compareResultSet(dbmd.getTables(null, "jdbctst", "schemas", null), "getTables(null, jdbctst, schemas, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1302 "Resultset with 10 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1303 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1304 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1305 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1306 compareResultSet(dbmd.getColumns(null, "jdbctst", "pk\\_uc", null), "getColumns(null, jdbctst, pk\\_uc, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1307 "Resultset with 24 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1308 "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" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1309 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint " + (isPostDec2023 ? "var" : "") + "char(3) varchar(3)\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1310 "null jdbctst pk_uc id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 2 0 null null 0 0 null 1 NO null null null null NO NO\n" + |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1311 "null jdbctst pk_uc name1 12 varchar 99 0 0 0 1 null null 0 0 396 2 YES null null null null NO NO\n"); |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1312 |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1313 compareResultSet(dbmd.getColumns(null, "tmp", "tlargechar", null), "getColumns(null, tmp, tlargechar, null)", |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1314 "Resultset with 24 columns\n" + |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1315 "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" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1316 "char(1) varchar(1024) varchar(1024) varchar(1024) int varchar(1024) int int int int int varchar(65000) varchar(2048) int int bigint int varchar(3) char(1) char(1) char(1) smallint " + (isPostDec2023 ? "var" : "") + "char(3) varchar(3)\n" + |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1317 "null tmp tlargechar c1 12 varchar 2147483647 0 0 0 1 null null 0 0 8589934588 1 YES null null null null NO NO\n" + |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1318 "null tmp tlargechar c2 1 char 2147483646 0 0 0 1 null null 0 0 8589934584 2 YES null null null null NO NO\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1319 "null tmp tlargechar c3 " + (isPostDec2023 ? "12 varchar" : "2005 clob") + " 2147483645 0 0 0 1 null null 0 0 8589934580 3 YES null null null null NO NO\n" + |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1320 "null tmp tlargechar c4 12 json 2147483644 0 0 0 1 null null 0 0 8589934576 4 YES null null null null NO NO\n" + |
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1321 "null tmp tlargechar c5 12 url 2147483643 0 0 0 1 null null 0 0 8589934572 5 YES null null null null NO NO\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1322 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1323 compareResultSet(dbmd.getPrimaryKeys(null, "jdbctst", "pk\\_uc"), "getPrimaryKeys(null, jdbctst, pk\\_uc)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1324 "Resultset with 6 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1325 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1326 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1327 "null jdbctst pk_uc id1 1 pk_uc_id1_pkey\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1328 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1329 /* MvD: hier verder */ |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1330 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "tmp_pk_uc"), "getPrimaryKeys(null, tmp, tmp_pk_uc)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1331 "Resultset with 6 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1332 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1333 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1334 "null tmp tmp_pk_uc id1 1 tmp_pk_uc_id1_pkey\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1335 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1336 compareResultSet(dbmd.getPrimaryKeys(null, "tmp", "glbl_pk_uc"), "getPrimaryKeys(null, tmp, glbl_pk_uc)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1337 "Resultset with 6 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1338 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1339 "char(1) varchar(1024) varchar(1024) varchar(1024) smallint varchar(1024)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1340 "null tmp glbl_pk_uc id1 1 glbl_pk_uc_id1_pkey\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1341 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1342 compareResultSet(dbmd.getExportedKeys(null, "sys", "table\\_types"), "getExportedKeys(null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1343 "Resultset with 14 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1344 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1345 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1346 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1347 compareResultSet(dbmd.getCrossReference(null, "sys", "tables", null, "sys", "table\\_types"), "getCrossReference(null, sys, tables, null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1348 "Resultset with 14 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1349 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1350 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1351 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1352 compareResultSet(dbmd.getImportedKeys(null, "sys", "table\\_types"), "getImportedKeys(null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1353 "Resultset with 14 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1354 "PKTABLE_CAT PKTABLE_SCHEM PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CAT FKTABLE_SCHEM FKTABLE_NAME FKCOLUMN_NAME KEY_SEQ UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1355 "char(1) varchar(1024) varchar(1024) varchar(1024) char(1) varchar(1024) varchar(1024) varchar(1024) smallint smallint smallint varchar(1024) varchar(1024) smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1356 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1357 compareResultSet(dbmd.getIndexInfo(null, "sys", "key_types", false, false), "getIndexInfo(null, sys, key_types, false, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1358 "Resultset with 13 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1359 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1360 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
898
281b56c61693
Adapt output of Test 'getIndexInfo(null, sys, key_types, false, false)' for servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
894
diff
changeset
|
1361 "null sys key_types false null key_types_key_type_id_pkey 2 1 key_type_id null " + (isPostDec2023 ? "5" : "3") + " 0 null\n" + |
281b56c61693
Adapt output of Test 'getIndexInfo(null, sys, key_types, false, false)' for servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
894
diff
changeset
|
1362 "null sys key_types false null key_types_key_type_name_unique 2 1 key_type_name null " + (isPostDec2023 ? "5" : "3") + " 0 null\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1363 |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1364 if (testCreateDropIndexOnTmpTables) { |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1365 compareResultSet(dbmd.getIndexInfo(null, "tmp", "tmp_pk_uc", false, false), "getIndexInfo(null, tmp, tmp_pk_uc, false, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1366 "Resultset with 13 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1367 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1368 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1369 "null tmp tmp_pk_uc false null tmp_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1370 "null tmp tmp_pk_uc false null tmp_pk_uc_name1_unique 2 1 name1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1371 "null tmp tmp_pk_uc true null tmp_pk_uc_i 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1372 "null tmp tmp_pk_uc true null tmp_pk_uc_i 2 2 name1 null 0 0 null\n"); |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1373 } |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1374 |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1375 if (testCreateDropIndexOnTmpTables) { |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1376 compareResultSet(dbmd.getIndexInfo(null, "tmp", "glbl_pk_uc", false, false), "getIndexInfo(null, tmp, glbl_pk_uc, false, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1377 "Resultset with 13 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1378 "TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1379 "char(1) varchar(1024) varchar(1024) boolean char(1) varchar(1024) tinyint smallint varchar(1024) char(1) int int char(1)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1380 "null tmp glbl_pk_uc false null glbl_pk_uc_id1_pkey 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1381 "null tmp glbl_pk_uc false null glbl_pk_uc_name1_unique 2 1 name1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1382 "null tmp glbl_pk_uc true null glbl_pk_uc_i 2 1 id1 null 0 0 null\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1383 "null tmp glbl_pk_uc true null glbl_pk_uc_i 2 2 name1 null 0 0 null\n"); |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1384 } |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1385 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1386 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "function_languages", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1387 "getBestRowIdentifier(null, sys, function_languages, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1388 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1389 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1390 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1391 "2 language_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1392 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1393 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1394 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1395 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1396 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1397 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1398 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1399 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1400 compareResultSet(dbmd.getBestRowIdentifier(null, "jdbctst", "nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1401 "getBestRowIdentifier(null, jdbctst, nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1402 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1403 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1404 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1405 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1406 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1407 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1408 "getBestRowIdentifier(null, tmp, tmp_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1409 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1410 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1411 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1412 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1413 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1414 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1415 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1416 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1417 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1418 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1419 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1420 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1421 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "tmp_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1422 "getBestRowIdentifier(null, tmp, tmp_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1423 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1424 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1425 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1426 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1427 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1428 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_pk_uc", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1429 "getBestRowIdentifier(null, tmp, glbl_pk_uc, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1430 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1431 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1432 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1433 "2 id1 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1434 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1435 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1436 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1437 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1438 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1439 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1440 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1441 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1442 compareResultSet(dbmd.getBestRowIdentifier(null, "tmp", "glbl_nopk_twoucs", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1443 "getBestRowIdentifier(null, tmp, glbl_nopk_twoucs, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1444 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1445 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1446 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1447 "2 id2 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1448 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1449 // also test a table without pk or uc, it should return a row for each column |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1450 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "schemas", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1451 "getBestRowIdentifier(null, sys, schemas, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1452 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1453 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1454 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1455 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1456 "2 name 12 varchar 1024 0 0 1\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1457 "2 authorization 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1458 "2 owner 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1459 "2 system 16 boolean 1 0 0 1\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1460 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1461 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "_tables", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1462 "getBestRowIdentifier(null, sys, _tables, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1463 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1464 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1465 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1466 "2 id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1467 "2 name 12 varchar 1024 0 0 1\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1468 "2 schema_id 4 int " + (isPostDec2023 ? "31" : "32") + " 0 0 1\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1469 "2 query 12 varchar 1048576 0 0 1\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1470 "2 type 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1471 "2 system 16 boolean 1 0 0 1\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1472 "2 commit_action 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n" + |
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1473 "2 access 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1474 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1475 // also test a view (without pk or uc of course), it should return no rows |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1476 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "tables", DatabaseMetaData.bestRowTransaction, true), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1477 "getBestRowIdentifier(null, sys, tables, DatabaseMetaData.bestRowTransaction, true)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1478 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1479 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1480 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1481 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1482 compareResultSet(dbmd.getBestRowIdentifier(null, "sys", "table\\_types", DatabaseMetaData.bestRowTransaction, false), |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1483 "getBestRowIdentifier(null, sys, table\\_types, DatabaseMetaData.bestRowTransaction, false)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1484 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1485 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1486 "smallint varchar(1024) int varchar(1024) int int smallint smallint\n" + |
854
cd365d70c745
Prepare JDBC_API_Tester for changed output (digits return 31 instead of 32 for int, 15 instead 16 for smallint) once branch cleanup_types will be merged into default.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
852
diff
changeset
|
1487 "2 table_type_id 5 smallint " + (isPostDec2023 ? "15" : "16") + " 0 0 1\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1488 |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1489 compareResultSet(dbmd.getProcedures(null, "jdbctst", "proc"), "getProcedures(null, jdbctst, proc)", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1490 "Resultset with 9 columns\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1491 "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME Field4 Field5 Field6 REMARKS PROCEDURE_TYPE SPECIFIC_NAME\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1492 "char(1) varchar(1024) varchar(256) char(1) char(1) char(1) varchar(65000) smallint varchar(10)\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1493 "null jdbctst proc null null null jdbctst.proc procedure comment 1 suppressed\n"); |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1494 // note that the real SPECIFIC_NAME value (containing the internal functions.id) is replaced with "suppressed" in order to get stable output |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1495 |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1496 compareResultSet(dbmd.getProcedureColumns(null, "jdbctst", "proc", "%%"), "getProcedureColumns(null, jdbctst, proc, %%)", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1497 "Resultset with 20 columns\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1498 "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME COLUMN_NAME COLUMN_TYPE DATA_TYPE TYPE_NAME PRECISION LENGTH SCALE RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SPECIFIC_NAME\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1499 "char(1) varchar(1024) varchar(256) varchar(256) smallint int varchar(1024) int int smallint smallint smallint char(1) char(1) int int bigint int varchar(3) varchar(10)\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1500 "null jdbctst proc id 1 -5 bigint 19 8 0 10 2 null null 0 0 null 1 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1501 "null jdbctst proc name 1 12 varchar 999 999 null null 2 null null 0 0 3996 2 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1502 "null jdbctst proc dt 1 91 date 0 0 null null 2 null null 0 0 null 3 suppressed\n"); |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1503 // note that the real SPECIFIC_NAME value (containing the internal functions.id) is replaced with "suppressed" in order to get stable output |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1504 |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1505 compareResultSet(dbmd.getFunctions(null, "jdbctst", "func"), "getFunctions(null, jdbctst, func)", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1506 "Resultset with 6 columns\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1507 "FUNCTION_CAT FUNCTION_SCHEM FUNCTION_NAME REMARKS FUNCTION_TYPE SPECIFIC_NAME\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1508 "char(1) varchar(1024) varchar(256) varchar(65000) tinyint varchar(10)\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1509 "null jdbctst func jdbctst.func function comment 2 suppressed\n"); |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1510 // note that the real SPECIFIC_NAME value (containing the internal functions.id) is replaced with "suppressed" in order to get stable output |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1511 |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1512 compareResultSet(dbmd.getFunctionColumns(null, "jdbctst", "func", "%%"), "getFunctionColumns(null, jdbctst, func, %%)", |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1513 "Resultset with 17 columns\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1514 "FUNCTION_CAT FUNCTION_SCHEM FUNCTION_NAME COLUMN_NAME COLUMN_TYPE DATA_TYPE TYPE_NAME PRECISION LENGTH SCALE RADIX NULLABLE REMARKS CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SPECIFIC_NAME\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1515 "char(1) varchar(1024) varchar(256) varchar(256) smallint int varchar(1024) int int smallint smallint smallint char(1) bigint int varchar(3) varchar(10)\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1516 "null jdbctst func val 4 12 varchar 1022 1022 null null 2 null 4088 0 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1517 "null jdbctst func dt 3 91 date 0 0 null null 2 null null 1 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1518 "null jdbctst func id 3 4 int 10 4 0 10 2 null null 2 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1519 "null jdbctst func id 1 -5 bigint 19 8 0 10 2 null null 3 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1520 "null jdbctst func name 1 12 varchar 999 999 null null 2 null 3996 4 suppressed\n" + |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1521 "null jdbctst func dt 1 91 date 0 0 null null 2 null null 5 suppressed\n"); |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1522 // note that the real SPECIFIC_NAME value (containing the internal functions.id) is replaced with "suppressed" in order to get stable output |
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1523 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1524 compareResultSet(dbmd.getTablePrivileges(null, "sys", "table\\_types"), "getTablePrivileges(null, sys, table\\_types)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1525 "Resultset with 7 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1526 "TABLE_CAT TABLE_SCHEM TABLE_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1527 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n" + |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1528 "null sys table_types monetdb public SELECT NO\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1529 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1530 compareResultSet(dbmd.getColumnPrivileges(null, "sys", "table\\_types", null), "getColumnPrivileges(null, sys, table\\_types, null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1531 "Resultset with 8 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1532 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME GRANTOR GRANTEE PRIVILEGE IS_GRANTABLE\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1533 "char(1) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(1024) varchar(40) varchar(3)\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1534 |
909
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
1535 if (!isPostDec2023) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
1536 compareResultSet(dbmd.getClientInfoProperties(), "getClientInfoProperties()", |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
1537 "Resultset with 4 columns\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
1538 "NAME MAX_LEN DEFAULT_VALUE DESCRIPTION\n" + |
922
e54a9fc65e0c
Correct expected output of getClientInfoProperties() for Dec2023 and older releases.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
917
diff
changeset
|
1539 "varchar(40) int varchar(128) varchar(256)\n"); |
909
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
1540 } |
757
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1541 |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1542 compareResultSet(dbmd.getSuperTables(null, "jdbctst", "pk_uc"), "getSuperTables(null, jdbctst, pk_uc)", |
757
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1543 "Resultset with 4 columns\n" + |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1544 "TABLE_CAT TABLE_SCHEM TABLE_NAME SUPERTABLE_NAME\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1545 "char(1) " + (isPostDec2023 ? "varchar varchar varchar\n" : "char char char\n")); |
757
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1546 |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1547 compareResultSet(dbmd.getPseudoColumns(null, "jdbctst", "pk_uc", "%"), "getPseudoColumns(null, jdbctst, pk_uc, %)", |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1548 "Resultset with 12 columns\n" + |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1549 "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE COLUMN_SIZE DECIMAL_DIGITS NUM_PREC_RADIX COLUMN_USAGE REMARKS CHAR_OCTET_LENGTH IS_NULLABLE\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1550 "char(1) " + (isPostDec2023 ? "varchar varchar varchar" : "char char char") + " int int int int " + (isPostDec2023 ? "varchar varchar int varchar\n" : "char char int char\n")); |
757
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1551 |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1552 compareResultSet(dbmd.getVersionColumns(null, "jdbctst", "pk_uc"), "getVersionColumns(null, jdbctst, pk_uc)", |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1553 "Resultset with 8 columns\n" + |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1554 "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1555 "smallint char(1) int char(1) int int smallint smallint\n"); |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1556 |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1557 compareResultSet(dbmd.getSuperTypes(null, "sys", "xml"), "getSuperTypes(null, sys, xml)", |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1558 "Resultset with 6 columns\n" + |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1559 "TYPE_CAT TYPE_SCHEM TYPE_NAME SUPERTYPE_CAT SUPERTYPE_SCHEM SUPERTYPE_NAME\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1560 "char(1) " + (isPostDec2023 ? "varchar varchar char(1) varchar varchar\n" : "char char char(1) char char\n")); |
757
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1561 |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1562 compareResultSet(dbmd.getAttributes(null, "sys", "xml", "%"), "getAttributes(null, sys, xml, %)", |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1563 "Resultset with 21 columns\n" + |
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1564 "TYPE_CAT TYPE_SCHEM TYPE_NAME ATTR_NAME DATA_TYPE ATTR_TYPE_NAME ATTR_SIZE DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS ATTR_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE SOURCE_DATA_TYPE\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
1565 "char(1) " + (isPostDec2023 ? "varchar varchar varchar" : "char char char") + " int " + (isPostDec2023 ? "var" : "") + "char int int int int " + (isPostDec2023 ? "varchar varchar" : "char char") + " int int int int " + (isPostDec2023 ? "varchar(3) varchar varchar varchar" : "char(3) char char char") + " smallint\n"); |
757
7f68120de37c
Corrected DatabaseMetaData method getClientProperties().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
754
diff
changeset
|
1566 |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1567 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1568 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1569 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1570 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1571 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1572 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1573 // cleanup created db objects |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1574 action = "Drop"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1575 objtype = "index"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1576 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc_i", "DROP INDEX jdbctst.pk_uc_i;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1577 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs_i", "DROP INDEX jdbctst.nopk_twoucs_i;"); |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1578 if (testCreateDropIndexOnTmpTables) { |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1579 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc_i;", "DROP INDEX tmp.tmp_pk_uc_i;"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1580 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc_i", "DROP INDEX tmp.glbl_pk_uc_i;"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1581 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs_i", "DROP INDEX tmp.tmp_nopk_twoucs_i;"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1582 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs_i", "DROP INDEX tmp.glbl_nopk_twoucs_i;"); |
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1583 } |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1584 objtype = "table"; |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1585 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk_uc", "DROP TABLE jdbctst.pk_uc;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1586 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_pk_uc", "DROP TABLE tmp.tmp_pk_uc;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1587 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_pk_uc", "DROP TABLE tmp.glbl_pk_uc;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1588 handleExecuteDDL(stmt, action, objtype, "jdbctst.nopk_twoucs", "DROP TABLE jdbctst.nopk_twoucs;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1589 handleExecuteDDL(stmt, action, objtype, "tmp.tmp_nopk_twoucs", "DROP TABLE tmp.tmp_nopk_twoucs;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1590 handleExecuteDDL(stmt, action, objtype, "tmp.glbl_nopk_twoucs", "DROP TABLE tmp.glbl_nopk_twoucs;"); |
818
4117aa40a6b9
Fix the computed CHAR_OCTET_LENGTH value of resultsets returned by getColumns(), getFunctionColumns() and getProcedureColumns().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
782
diff
changeset
|
1591 handleExecuteDDL(stmt, action, objtype, "tmp.tlargechar", "DROP TABLE tmp.tlargechar;"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1592 handleExecuteDDL(stmt, action, objtype, "jdbctst.\"LINES\"", "DROP TABLE jdbctst.\"LINES\";"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1593 handleExecuteDDL(stmt, action, objtype, "jdbctst.\"ORDERS\"", "DROP TABLE jdbctst.\"ORDERS\";"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1594 handleExecuteDDL(stmt, action, objtype, "jdbctst.\"CUSTOMERS\"", "DROP TABLE jdbctst.\"CUSTOMERS\";"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1595 handleExecuteDDL(stmt, action, objtype, "jdbctst.fk2c", "DROP TABLE jdbctst.fk2c;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1596 handleExecuteDDL(stmt, action, objtype, "jdbctst.pk2c", "DROP TABLE jdbctst.pk2c;"); |
687
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1597 objtype = "procedure"; |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1598 handleExecuteDDL(stmt, action, objtype, "jdbctst.proc()", "DROP PROCEDURE jdbctst.proc(bigint, varchar(999), date);"); |
687
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1599 handleExecuteDDL(stmt, action, objtype, "sys.analyze()", "COMMENT ON PROCEDURE sys.analyze() IS NULL;"); |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1600 objtype = "function"; |
881
4973317db1cc
Extend Test_DBCmetadata() test with missing calls to getProcedures(), getProcedureColumns(), getFunctions() and getFunctionColumns() for user defined procedure and user defined function.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
872
diff
changeset
|
1601 handleExecuteDDL(stmt, action, objtype, "jdbctst.func()", "DROP FUNCTION jdbctst.func(bigint, varchar(999), date);"); |
687
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1602 handleExecuteDDL(stmt, action, objtype, "sys.sin(double)", "COMMENT ON FUNCTION sys.sin(double) IS NULL;"); |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1603 handleExecuteDDL(stmt, action, objtype, "sys.env()", "COMMENT ON FUNCTION sys.env() IS NULL;"); |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1604 handleExecuteDDL(stmt, action, objtype, "sys.statistics()", "COMMENT ON FUNCTION sys.statistics() IS NULL;"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1605 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1606 // All tables in schema jdbctst should now be gone, else we missed some DROP statements |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1607 try { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1608 compareResultSet(dbmd.getTables(null, "jdbctst", "%%", null), "getTables(null, jdbctst, '%%', null)", |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1609 "Resultset with 10 columns\n" + |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1610 "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS TYPE_CAT TYPE_SCHEM TYPE_NAME SELF_REFERENCING_COL_NAME REF_GENERATION\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
1611 "char(1) varchar(1024) varchar(1024) varchar(25) varchar(1048576) char(1) char(1) char(1) char(1) char(1)\n"); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1612 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1613 } catch (SQLException e) { |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1614 sb.setLength(0); // clear the output log buffer |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1615 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1616 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1617 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1618 handleExecuteDDL(stmt, action, "schema", "jdbctst", "SET SCHEMA sys; DROP SCHEMA jdbctst;"); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1619 |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1620 closeStmtResSet(stmt, null); |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1621 |
699
0ff364f569a1
Adjust Test_DBCmetadata() to exclude creating, retrieving and dropping indices on temporary tables for MonetDB servers before Jan2022 (11.45).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
696
diff
changeset
|
1622 compareExpectedOutput("Test_DBCmetadata", ""); |
653
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1623 } |
5eb9d54057e6
Improved DatabaseMetaData.getBestRowIdentifier() further by introducing an extra cte: tableids. It makes it easier to understand/maintain and possibly faster.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
652
diff
changeset
|
1624 |
692
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1625 private void Test_EmptySql() { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1626 sb.setLength(0); // clear the output log buffer |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1627 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1628 Statement stmt = null; |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1629 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1630 stmt = con.createStatement(); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1631 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1632 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1633 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1634 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1635 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1636 stmt.execute(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1637 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1638 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1639 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1640 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1641 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1642 stmt.execute(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1643 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1644 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1645 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1646 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1647 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1648 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1649 int ret = stmt.executeUpdate(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1650 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1651 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1652 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1653 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1654 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1655 int ret = stmt.executeUpdate(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1656 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1657 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1658 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1659 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1660 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1661 long ret = stmt.executeLargeUpdate(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1662 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1663 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1664 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1665 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1666 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1667 long ret = stmt.executeLargeUpdate(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1668 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1669 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1670 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1671 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1672 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1673 stmt.addBatch(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1674 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1675 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1676 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1677 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1678 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1679 stmt.addBatch(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1680 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1681 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1682 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1683 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1684 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1685 ResultSet rs = null; |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1686 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1687 rs = stmt.executeQuery(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1688 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1689 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1690 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1691 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1692 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1693 rs = stmt.executeQuery(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1694 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1695 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1696 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1697 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1698 closeStmtResSet(stmt, rs); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1699 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1700 PreparedStatement pstmt = null; |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1701 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1702 pstmt = con.prepareStatement(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1703 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1704 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1705 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1706 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1707 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1708 pstmt = con.prepareStatement(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1709 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1710 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1711 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1712 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1713 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1714 pstmt = con.prepareStatement(null, Statement.RETURN_GENERATED_KEYS); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1715 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1716 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1717 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1718 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1719 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1720 pstmt = con.prepareStatement("", Statement.RETURN_GENERATED_KEYS); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1721 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1722 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1723 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1724 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1725 closeStmtResSet(pstmt, null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1726 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1727 CallableStatement cstmt = null; |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1728 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1729 pstmt = con.prepareCall(null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1730 sb.append("Failed to check null parameter!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1731 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1732 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1733 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1734 try { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1735 pstmt = con.prepareCall(""); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1736 sb.append("Failed to check empty sql string!\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1737 } catch (SQLException e) { |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1738 sb.append(e.getMessage()).append("\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1739 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1740 closeStmtResSet(cstmt, null); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1741 |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1742 compareExpectedOutput("Test_EmptySql", |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1743 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1744 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1745 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1746 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1747 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1748 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1749 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1750 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1751 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1752 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1753 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1754 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1755 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1756 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1757 "Missing SQL statement\n" + |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1758 "Missing SQL statement\n"); |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1759 } |
2233b172e06d
Add checks for sql String parameter to prevent NullPointerException or executing an empty sql String.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
691
diff
changeset
|
1760 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1761 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
|
1762 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
|
1763 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1764 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
|
1765 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
|
1766 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
|
1767 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
|
1768 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
|
1769 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1770 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
|
1771 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
|
1772 |
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
|
1773 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
|
1774 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
|
1775 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
1776 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
|
1777 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
|
1778 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1779 } 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
|
1780 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
|
1781 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1782 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1783 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
|
1784 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1785 compareExpectedOutput("Test_FetchSize", |
696
07d60185eeb9
Eliminate hardcoded value 250 in the constructor of MonetPreparedStatement. For this an internal package method MonetConnection.getDefaultFetchSize() is added.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
695
diff
changeset
|
1786 "Statement fetch size before set: 250\n" + |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1787 "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
|
1788 "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
|
1789 "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
|
1790 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
1791 |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1792 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
|
1793 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
|
1794 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1795 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
|
1796 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
|
1797 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1798 // 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
|
1799 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
|
1800 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1801 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
|
1802 // 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
|
1803 rs = stmt.executeQuery("SELECT sqlname from sys.types where sqlname = 'hugeint';"); |
478
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1804 if (rs != null) { |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1805 if (rs.next()) { |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1806 if ("hugeint".equals(rs.getString(1))) |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1807 supportsHugeInt = true; |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1808 } |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1809 rs.close(); |
e239f02fe8b6
Add code to close the resultset after use to free resources on the server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
469
diff
changeset
|
1810 rs = null; |
447
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1811 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1812 } 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
|
1813 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
|
1814 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1815 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1816 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
|
1817 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
|
1818 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
|
1819 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
|
1820 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1821 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1822 // 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
|
1823 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
|
1824 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1825 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
|
1826 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
|
1827 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1828 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
|
1829 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
|
1830 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1831 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
|
1832 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
|
1833 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
|
1834 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
|
1835 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1836 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
|
1837 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1838 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
|
1839 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
|
1840 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
|
1841 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
|
1842 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
|
1843 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
|
1844 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
|
1845 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1846 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1847 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
|
1848 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
|
1849 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
|
1850 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
|
1851 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
|
1852 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
|
1853 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
|
1854 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1855 } 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
|
1856 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
|
1857 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1858 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1859 // cleanup |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1860 try { |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1861 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
|
1862 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
|
1863 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
|
1864 } 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
|
1865 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
|
1866 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1867 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
|
1868 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
|
1869 |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1870 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
|
1871 "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
|
1872 "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
|
1873 "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
|
1874 } |
7147d1252828
Converted and added Test_Int128() to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
446
diff
changeset
|
1875 |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1876 private void Test_Interval_Types() { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1877 sb.setLength(0); // clear the output log buffer |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1878 |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1879 Statement stmt = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1880 ResultSet rs = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1881 PreparedStatement pstmt = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1882 try { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1883 stmt = con.createStatement(); |
887
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1884 stmt.executeUpdate("create table Test_Interval_Types (" |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1885 + "c1 interval year, c2 interval month, c3 interval day, " |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1886 + "c4 interval hour, c5 interval minute, c6 interval second, " |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1887 + "c7 interval year to month, c8 interval day to hour, " |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1888 + "c9 interval day to minute, c10 interval day to second, " |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1889 + "c11 interval hour to minute, c12 interval hour to second, " |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1890 + "c13 interval minute to second)"); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1891 rs = stmt.executeQuery("select * from Test_Interval_Types"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1892 if (rs != null) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1893 sb.append("Showing query ResultSetMetaData\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1894 ResultSetMetaData rsmd = rs.getMetaData(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1895 int colCount = rsmd.getColumnCount(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1896 for (int col = 1; col <= colCount; col++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1897 sb.append("ColumnName: ").append(rsmd.getColumnName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1898 .append("\tColumnTypeName: ").append(rsmd.getColumnTypeName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1899 .append("\tPrecision: ").append(rsmd.getPrecision(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1900 .append("\tScale: ").append(rsmd.getScale(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1901 .append("\tColumnDisplaySize: ").append(rsmd.getColumnDisplaySize(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1902 .append("\tColumnType: ").append(rsmd.getColumnType(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1903 .append("\tColumnClassName: ").append(rsmd.getColumnClassName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1904 .append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1905 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1906 rs.close(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1907 rs = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1908 } |
887
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1909 pstmt = con.prepareStatement("select * from Test_Interval_Types where " |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1910 + "c1=? or c2=? or c3=? or c4=? or c5=? or c6=? or c7=? or c8=? or c9=? or c10=? or c11=? or c12=? or c13=?"); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1911 if (pstmt != null) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1912 sb.append("Showing prepared query ResultSetMetaData\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1913 ResultSetMetaData rsmd = pstmt.getMetaData(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1914 int colCount = rsmd.getColumnCount(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1915 for (int col = 1; col <= colCount; col++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1916 sb.append("ColumnName: ").append(rsmd.getColumnName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1917 .append("\tColumnTypeName: ").append(rsmd.getColumnTypeName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1918 .append("\tPrecision: ").append(rsmd.getPrecision(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1919 .append("\tScale: ").append(rsmd.getScale(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1920 .append("\tColumnDisplaySize: ").append(rsmd.getColumnDisplaySize(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1921 .append("\tColumnType: ").append(rsmd.getColumnType(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1922 .append("\tColumnClassName: ").append(rsmd.getColumnClassName(col)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1923 .append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1924 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1925 sb.append("Showing prepared query ParameterMetaData\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1926 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1927 int paramCount = pmd.getParameterCount(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1928 for (int param = 1; param <= paramCount; param++) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1929 sb.append("ParameterTypeName: ").append(pmd.getParameterTypeName(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1930 .append("\tPrecision: ").append(pmd.getPrecision(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1931 .append("\tScale: ").append(pmd.getScale(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1932 .append("\tParameterType: ").append(pmd.getParameterType(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1933 .append("\tParameterClassName: ").append(pmd.getParameterClassName(param)) |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1934 .append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1935 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1936 pstmt.close(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1937 pstmt = null; |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1938 } |
687
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1939 } catch (SQLException e) { |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1940 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1941 } |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1942 |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1943 // cleanup |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1944 closeStmtResSet(pstmt, null); |
801174945283
Add missing cleanup when an error occurs.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
686
diff
changeset
|
1945 try { |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1946 stmt.executeUpdate("drop table Test_Interval_Types"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1947 } catch (SQLException e) { |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1948 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1949 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1950 closeStmtResSet(stmt, rs); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1951 |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1952 compareExpectedOutput("Test_Interval_Types", |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1953 "Showing query ResultSetMetaData\n" + |
888
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1954 "ColumnName: c1 ColumnTypeName: interval year Precision: 10 Scale: 0 ColumnDisplaySize: 4 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1955 "ColumnName: c2 ColumnTypeName: interval month Precision: 10 Scale: 0 ColumnDisplaySize: 6 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1956 "ColumnName: c3 ColumnTypeName: interval day Precision: 9 Scale: 0 ColumnDisplaySize: 9 ColumnType: 2 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1957 "ColumnName: c4 ColumnTypeName: interval hour Precision: 11 Scale: 3 ColumnDisplaySize: 11 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1958 "ColumnName: c5 ColumnTypeName: interval minute Precision: 13 Scale: 3 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1959 "ColumnName: c6 ColumnTypeName: interval second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1960 "ColumnName: c7 ColumnTypeName: interval year to month Precision: 10 Scale: 0 ColumnDisplaySize: 6 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1961 "ColumnName: c8 ColumnTypeName: interval day to hour Precision: 11 Scale: 3 ColumnDisplaySize: 11 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1962 "ColumnName: c9 ColumnTypeName: interval day to minute Precision: 13 Scale: 3 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1963 "ColumnName: c10 ColumnTypeName: interval day to second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1964 "ColumnName: c11 ColumnTypeName: interval hour to minute Precision: 13 Scale: 3 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1965 "ColumnName: c12 ColumnTypeName: interval hour to second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1966 "ColumnName: c13 ColumnTypeName: interval minute to second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1967 "Showing prepared query ResultSetMetaData\n" + |
888
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1968 "ColumnName: c1 ColumnTypeName: interval year Precision: 10 Scale: 0 ColumnDisplaySize: 4 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1969 "ColumnName: c2 ColumnTypeName: interval month Precision: 10 Scale: 0 ColumnDisplaySize: 6 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1970 "ColumnName: c3 ColumnTypeName: interval day Precision: 9 Scale: 0 ColumnDisplaySize: 9 ColumnType: 2 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1971 "ColumnName: c4 ColumnTypeName: interval hour Precision: 11 Scale: 3 ColumnDisplaySize: 11 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1972 "ColumnName: c5 ColumnTypeName: interval minute Precision: 13 Scale: 3 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1973 "ColumnName: c6 ColumnTypeName: interval second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1974 "ColumnName: c7 ColumnTypeName: interval year to month Precision: 10 Scale: 0 ColumnDisplaySize: 6 ColumnType: 4 ColumnClassName: java.lang.Integer\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1975 "ColumnName: c8 ColumnTypeName: interval day to hour Precision: 11 Scale: 3 ColumnDisplaySize: 11 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1976 "ColumnName: c9 ColumnTypeName: interval day to minute Precision: 13 Scale: 3 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1977 "ColumnName: c10 ColumnTypeName: interval day to second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1978 "ColumnName: c11 ColumnTypeName: interval hour to minute Precision: 13 Scale: 3 ColumnDisplaySize: 13 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1979 "ColumnName: c12 ColumnTypeName: interval hour to second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1980 "ColumnName: c13 ColumnTypeName: interval minute to second Precision: 15 Scale: 3 ColumnDisplaySize: 15 ColumnType: 3 ColumnClassName: java.math.BigDecimal\n" + |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1981 "Showing prepared query ParameterMetaData\n" + |
887
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1982 "ParameterTypeName: interval year Precision: 10 Scale: 0 ParameterType: 4 ParameterClassName: java.lang.Integer\n" + |
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1983 "ParameterTypeName: interval month Precision: 10 Scale: 0 ParameterType: 4 ParameterClassName: java.lang.Integer\n" + |
888
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1984 "ParameterTypeName: interval day Precision: 9 Scale: 0 ParameterType: 2 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1985 "ParameterTypeName: interval hour Precision: 11 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1986 "ParameterTypeName: interval minute Precision: 13 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1987 "ParameterTypeName: interval second Precision: 15 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
887
674f9ed21308
Improved ResultSetMetaData.getColumnTypeName() and ParameterMetaData.getParameterTypeName() for interval types. It now returns more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
881
diff
changeset
|
1988 "ParameterTypeName: interval year to month Precision: 10 Scale: 0 ParameterType: 4 ParameterClassName: java.lang.Integer\n" + |
888
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1989 "ParameterTypeName: interval day to hour Precision: 11 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1990 "ParameterTypeName: interval day to minute Precision: 13 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1991 "ParameterTypeName: interval day to second Precision: 15 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1992 "ParameterTypeName: interval hour to minute Precision: 13 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1993 "ParameterTypeName: interval hour to second Precision: 15 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n" + |
549225b7be85
Corrected ResultSetMetaData methods getPrecision(), getColumnDisplaySize() and ParameterMetaData method getPrecision() for the interval data types. They now return more precise information for the 13 possible interval data types.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
887
diff
changeset
|
1994 "ParameterTypeName: interval minute to second Precision: 15 Scale: 0 ParameterType: 3 ParameterClassName: java.math.BigDecimal\n"); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1995 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
1996 |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
1997 private void Test_PlanExplainTraceDebugCmds(boolean skipMALoutput) { |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1998 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
1999 |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2000 Statement stmt = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2001 ResultSet rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2002 try { |
753
8b3b7b75102f
Adapt output of command: debug SELECT 5; which is now different depending on the tested server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
752
diff
changeset
|
2003 final boolean isPreJan2022 = (dbmsMajorVersion == 11 && dbmsMinorVersion <= 41); |
689
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
2004 |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2005 stmt = con.createStatement(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2006 String qry = "SELECT 1;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2007 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2008 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2009 sb.append(rs.getString(1)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2010 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2011 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2012 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2013 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, "1\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2014 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2015 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
2016 // plan statements are supported via JDBC |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2017 qry = "plan SELECT 2;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2018 rs = stmt.executeQuery(qry); |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2019 if (!skipMALoutput) { |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2020 compareResultSet(rs, qry, |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2021 ! isPreJan2022 ? |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2022 "Resultset with 1 columns\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2023 "rel\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2024 (isPostDec2023 ? "varchar" : "clob") + "(37)\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2025 "project (\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2026 "| [ boolean(1) \"true\" as \"%1\".\"%1\" ]\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2027 ") [ tinyint(2) \"2\" ]\n" |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2028 : |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2029 "Resultset with 1 columns\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2030 "rel\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2031 "clob(21)\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2032 "project (\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2033 "| [ boolean \"true\" ]\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2034 ") [ tinyint \"2\" ]\n"); |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2035 } |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2036 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2037 rs = null; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2038 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2039 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
2040 // explain statements are supported via JDBC |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2041 qry = "explain SELECT 3;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2042 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2043 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2044 String val = rs.getString(1); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2045 if (!val.startsWith("#")) |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2046 sb.append(val).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2047 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2048 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2049 rs = null; |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2050 if (!skipMALoutput) { |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2051 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2052 "function user.main():void;\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2053 " X_1:void := querylog.define(\"explain select 3;\":str, \"default_pipe\":str, 6:int);\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2054 " X_10:int := sql.resultSet(\".%2\":str, \"%2\":str, \"tinyint\":str, 2:int, 0:int, 7:int, 3:bte);\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2055 "end user.main;\n"); |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2056 } |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2057 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2058 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
2059 // trace statements are supported via JDBC. Note that it returns two resultsets, one with the query result and next one with the trace result. |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2060 qry = "trace SELECT 4;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2061 rs = stmt.executeQuery(qry); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2062 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2063 sb.append(rs.getString(1)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2064 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2065 if (stmt.getMoreResults()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2066 sb.append("Another resultset\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2067 rs = stmt.getResultSet(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2068 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2069 sb.append(rs.getString(2)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2070 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2071 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2072 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2073 rs = null; |
925
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2074 if (!skipMALoutput) { |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2075 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2076 ! isPreJan2022 ? |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2077 "4\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2078 "Another resultset\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2079 " X_1=0@0:void := querylog.define(\"trace select 4;\":str, \"default_pipe\":str, 6:int);\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2080 " X_10=0:int := sql.resultSet(\".%2\":str, \"%2\":str, \"tinyint\":str, 3:int, 0:int, 7:int, 4:bte);\n" |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2081 : |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2082 "4\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2083 "Another resultset\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2084 "X_0=0@0:void := querylog.define(\"trace select 4;\":str, \"default_pipe\":str, 6:int);\n" + |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2085 "X_1=0:int := sql.resultSet(\".%2\":str, \"%2\":str, \"tinyint\":str, 3:int, 0:int, 7:int, 4:bte);\n"); |
4dfdb62e3e9d
Extend JDBC_API_Tester program with optional second startup argument '-skipMALoutput'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
923
diff
changeset
|
2086 } |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2087 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2088 |
643
1f444b5ad7d2
Forgot to cleanup created type xml. Now it will be dropped after use.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
642
diff
changeset
|
2089 // debug statements are NOT supported via JDBC driver, so the execution should throw an SQLException |
754
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2090 // Note: as of release 11.47 (Jun2023) the debug statement is not supported anymore, error msg: syntax error in: "debug" |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2091 qry = "debug SELECT 5;"; |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2092 sb.append(qry).append("\n"); |
754
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2093 rs = stmt.executeQuery(qry); // this should throw an SQLException |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2094 while (rs.next()) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2095 sb.append(rs.getString(1)).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2096 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2097 rs.close(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2098 rs = null; |
754
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2099 compareExpectedOutput("Test_PlanExplainTraceDebugCmds: " + qry, qry + "\n5\n"); |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2100 sb.setLength(0); // clear the output log buffer |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2101 } catch (SQLException e) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2102 sb.append("FAILED: "); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2103 while (e != null) { |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2104 sb.append(e.getMessage()).append("\n"); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2105 e = e.getNextException(); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2106 } |
754
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2107 |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2108 final boolean isPreJun2023 = (dbmsMajorVersion == 11 && dbmsMinorVersion <= 45); |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2109 // From Jun2023 we skip the comparison as it gives a different error msg on power8 platform: syntax error, unexpected IDENT in: "debug" |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2110 if (isPreJun2023) { |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2111 compareExpectedOutput("Test_PlanExplainTraceDebugCmds", |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2112 "debug SELECT 5;\n" + |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2113 "FAILED: SQL debugging only supported in interactive mode in: \"debug\"\n" + |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2114 "Current transaction is aborted (please ROLLBACK)\n"); |
b6eb51cb5cee
On power8 platform on testweb the SQL parser gives different error message. Add a condition to skip the comparison for this error msg.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
753
diff
changeset
|
2115 } |
633
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2116 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2117 |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2118 closeStmtResSet(stmt, rs); |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2119 } |
0d026d0bf7f1
Added test to execute PLAN, EXPLAIN, TRACE and DEBUG queries via JDBC API.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
619
diff
changeset
|
2120 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2121 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
|
2122 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
|
2123 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2124 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
|
2125 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
|
2126 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
|
2127 // >> 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
|
2128 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
|
2129 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2130 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
|
2131 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
|
2132 "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
|
2133 " 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
|
2134 " 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
|
2135 ")"); |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2136 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
|
2137 } 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
|
2138 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
|
2139 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2140 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
|
2141 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2142 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
|
2143 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
|
2144 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
|
2145 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
|
2146 "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
|
2147 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
|
2148 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2149 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
|
2150 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
|
2151 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
|
2152 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
|
2153 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
|
2154 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2155 // 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
|
2156 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
|
2157 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
|
2158 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
|
2159 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
|
2160 } 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
|
2161 while (keys.next()) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2162 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
|
2163 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2164 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
|
2165 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
|
2166 } |
0eef53e06007
Add JDBC_API_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 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
|
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 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
|
2170 } 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
|
2171 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
|
2172 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2173 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
|
2174 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2175 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
|
2176 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
|
2177 // 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
|
2178 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
|
2179 } 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
|
2180 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
|
2181 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2182 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2183 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
|
2184 "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
|
2185 "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
|
2186 "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
|
2187 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2188 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2189 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
|
2190 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
|
2191 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2192 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
|
2193 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
|
2194 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
|
2195 // >> 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
|
2196 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
|
2197 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2198 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
|
2199 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
|
2200 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
|
2201 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
|
2202 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
|
2203 } 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
|
2204 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
|
2205 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2206 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
|
2207 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2208 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
|
2209 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
|
2210 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
|
2211 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
|
2212 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
|
2213 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
|
2214 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
|
2215 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
|
2216 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
|
2217 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
|
2218 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2219 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
|
2220 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
|
2221 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
|
2222 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
|
2223 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
|
2224 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2225 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
|
2226 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
|
2227 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
|
2228 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
|
2229 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
|
2230 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2231 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
|
2232 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
|
2233 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
|
2234 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2235 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
|
2236 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
|
2237 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
|
2238 } 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
|
2239 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
|
2240 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
|
2241 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
|
2242 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2243 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2244 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
|
2245 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
|
2246 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
|
2247 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
|
2248 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
|
2249 |
0eef53e06007
Add JDBC_API_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 while (rs.next()) { |
927
d311affc65f0
Stop referring to monetdb.org/bugzilla, point straight to github.
Sjoerd Mullender <sjoerd@acm.org>
parents:
925
diff
changeset
|
2251 // test fix for https://github.com/MonetDB/MonetDB/issues/4026 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2252 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
|
2253 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
|
2254 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
|
2255 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
|
2256 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
2257 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
|
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 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
|
2261 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
|
2262 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
|
2263 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2264 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
|
2265 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
|
2266 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
|
2267 } 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
|
2268 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
|
2269 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
|
2270 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
|
2271 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2272 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
|
2273 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2274 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
|
2275 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
|
2276 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
|
2277 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
|
2278 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2279 // 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
|
2280 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
|
2281 } 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
|
2282 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
|
2283 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2284 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2285 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
|
2286 "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
|
2287 "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
|
2288 "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
|
2289 "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
|
2290 " 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
|
2291 " 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
|
2292 " 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
|
2293 " 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
|
2294 "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
|
2295 "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
|
2296 " 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
|
2297 " 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
|
2298 " 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
|
2299 "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
|
2300 "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
|
2301 "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
|
2302 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2303 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2304 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
|
2305 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
|
2306 |
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
|
2307 byte[] errorBytes = new byte[] { (byte) 0xe2, (byte) 0x80, (byte) 0xa7 }; |
749
a604e71a875e
UTF-8 is a standard character set always available on Java, so use it where needed.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
748
diff
changeset
|
2308 String errorStr = new String(errorBytes, StandardCharsets.UTF_8); |
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
|
2309 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
|
2310 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
|
2311 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
|
2312 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2313 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
|
2314 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2315 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
|
2316 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
|
2317 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
|
2318 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
|
2319 // >> 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
|
2320 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
|
2321 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2322 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
|
2323 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
|
2324 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
|
2325 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
|
2326 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2327 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
|
2328 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
|
2329 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
|
2330 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2331 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
|
2332 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
|
2333 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
|
2334 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
|
2335 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
|
2336 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
|
2337 |
927
d311affc65f0
Stop referring to monetdb.org/bugzilla, point straight to github.
Sjoerd Mullender <sjoerd@acm.org>
parents:
925
diff
changeset
|
2338 /* test issue reported at https://github.com/MonetDB/MonetDB/issues/3470 */ |
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
|
2339 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
|
2340 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
|
2341 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
|
2342 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
|
2343 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
|
2344 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
|
2345 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2346 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
|
2347 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
|
2348 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2349 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
|
2350 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
|
2351 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
|
2352 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
|
2353 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
|
2354 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
|
2355 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2356 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
|
2357 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2358 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
|
2359 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
|
2360 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
|
2361 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
|
2362 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
|
2363 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2364 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
|
2365 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
|
2366 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
|
2367 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
|
2368 } 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
|
2369 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
|
2370 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
|
2371 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
|
2372 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2373 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
|
2374 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
|
2375 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2376 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
|
2377 "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
|
2378 "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
|
2379 "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
|
2380 "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
|
2381 "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
|
2382 "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
|
2383 "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
|
2384 "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
|
2385 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2386 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2387 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
|
2388 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
|
2389 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2390 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
|
2391 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
|
2392 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
|
2393 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2394 // retrieve this to simulate a bug report |
812
a090371d59c8
Remove naive url check because the world has become more complicated
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
797
diff
changeset
|
2395 con.getMetaData().getURL(); |
a090371d59c8
Remove naive url check because the world has become more complicated
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
797
diff
changeset
|
2396 // There used to be a test "if (conURL.startsWith(dbmdURL))" here |
a090371d59c8
Remove naive url check because the world has become more complicated
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
797
diff
changeset
|
2397 // but with the new URLs that is too simplistic. |
a090371d59c8
Remove naive url check because the world has become more complicated
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
797
diff
changeset
|
2398 sb.append("oke").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
|
2399 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2400 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
|
2401 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
|
2402 // 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
|
2403 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
|
2404 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
|
2405 } 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
|
2406 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
|
2407 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2408 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
|
2409 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2410 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
|
2411 "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
|
2412 "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
|
2413 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2414 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2415 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
|
2416 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
|
2417 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2418 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
|
2419 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
|
2420 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2421 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
|
2422 // 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
|
2423 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
|
2424 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
|
2425 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
|
2426 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
|
2427 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
|
2428 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
|
2429 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2430 // 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
|
2431 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
|
2432 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
|
2433 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2434 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
|
2435 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2436 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
|
2437 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2438 // 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
|
2439 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
|
2440 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
|
2441 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
|
2442 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
|
2443 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2444 // 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
|
2445 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
|
2446 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
|
2447 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
|
2448 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2449 ResultSet rs = pstmt.getResultSet(); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2450 if (rs != null) { |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2451 if (!rs.next()) |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2452 sb.append("ResultSet is empty"); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2453 sb.append(" result: ").append(rs.getString(1)); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2454 } |
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
|
2455 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2456 // 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
|
2457 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
|
2458 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
|
2459 |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2460 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
|
2461 // 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
|
2462 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
|
2463 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
|
2464 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
|
2465 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
|
2466 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
|
2467 } 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
|
2468 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
|
2469 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2470 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
|
2471 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
|
2472 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
|
2473 } |
addb345e4fa8
Changed test 'getIndexInfo(null, sys, table_types, false, false)' to resolve difference (9 instead of 10) reported on testweb for default branch.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
395
diff
changeset
|
2474 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2475 } 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
|
2476 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
|
2477 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2478 |
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
|
2479 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
|
2480 "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
|
2481 "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
|
2482 "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
|
2483 "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
|
2484 "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
|
2485 "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
|
2486 "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
|
2487 "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
|
2488 "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
|
2489 "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
|
2490 "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
|
2491 "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
|
2492 "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
|
2493 "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
|
2494 "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
|
2495 "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
|
2496 "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
|
2497 "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
|
2498 "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
|
2499 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2500 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2501 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
|
2502 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
|
2503 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2504 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
|
2505 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2506 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2507 // >> 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
|
2508 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
|
2509 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2510 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2511 int updates = 0; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2512 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
|
2513 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2514 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
|
2515 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2516 // all NULLs |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2517 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
|
2518 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2519 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
|
2520 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2521 // all filled in |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2522 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
|
2523 if (updates != 1) |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2524 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
|
2525 } catch (SQLException e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2526 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
|
2527 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2528 closeStmtResSet(stmt, null); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2529 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2530 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2531 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2532 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
|
2533 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
|
2534 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2535 // testing and showing result set meta data |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2536 ResultSetMetaData rsmd = pstmt.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2537 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
|
2538 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
|
2539 sb.append("RCol ").append(col).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2540 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
|
2541 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
|
2542 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
|
2543 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
|
2544 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
|
2545 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
|
2546 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
|
2547 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
|
2548 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
|
2549 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
|
2550 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
|
2551 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
|
2552 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
|
2553 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
|
2554 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
|
2555 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
|
2556 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
|
2557 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
|
2558 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
|
2559 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
|
2560 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2561 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
2562 showParams(pstmt); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2563 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2564 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2565 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2566 // >> 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
|
2567 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
|
2568 } 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
|
2569 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
|
2570 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2571 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
|
2572 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2573 compareExpectedOutput("Test_PSmetadata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2574 "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
|
2575 "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
|
2576 " 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
|
2577 "rsmd. 6 columns:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2578 "RCol 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2579 " classname java.lang.Short\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2580 " displaysize 3\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2581 " label intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2582 " name intnull\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2583 " type -6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2584 " typename tinyint\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2585 " precision 3\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2586 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2587 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2588 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2589 " tablename \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2590 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2591 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2592 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2593 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2594 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2595 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2596 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2597 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2598 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2599 "RCol 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2600 " classname java.lang.Integer\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2601 " displaysize 10\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2602 " label myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2603 " name myint\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2604 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2605 " typename int\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2606 " precision 10\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2607 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2608 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2609 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2610 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2611 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2612 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2613 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2614 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2615 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2616 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2617 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2618 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2619 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2620 "RCol 3\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2621 " classname java.lang.Double\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2622 " displaysize 15\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2623 " label mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2624 " name mydouble\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2625 " type 8\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2626 " typename double\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2627 " precision 15\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2628 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2629 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2630 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2631 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2632 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2633 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2634 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2635 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2636 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2637 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2638 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2639 " signed true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2640 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2641 "RCol 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2642 " classname java.lang.Boolean\n" + |
717
7240d2dd369f
Improved implementation of PreparedStatement.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
716
diff
changeset
|
2643 " displaysize 5\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2644 " label mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2645 " name mybool\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2646 " type 16\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2647 " typename boolean\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2648 " precision 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2649 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2650 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2651 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2652 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2653 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2654 " casesensitive false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2655 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2656 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2657 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2658 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2659 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2660 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2661 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2662 "RCol 5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2663 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2664 " displaysize 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2665 " label myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2666 " name myvarchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2667 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2668 " typename varchar\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2669 " precision 15\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2670 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2671 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2672 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2673 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2674 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2675 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2676 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2677 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2678 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2679 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2680 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2681 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2682 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2683 "RCol 6\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2684 " classname java.lang.String\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2685 " displaysize 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2686 " label myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2687 " name myclob\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2688 " type 12\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
2689 " typename " + (isPostDec2023 ? "varchar" : "clob") + "\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2690 " precision 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2691 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2692 " catalogname null\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2693 " schemaname \n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2694 " tablename table_test_psmetadata\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2695 " autoincrement false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2696 " casesensitive true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2697 " currency false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2698 " defwritable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2699 " nullable 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2700 " readonly true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2701 " searchable true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2702 " signed false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2703 " writable false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2704 "pmd. 1 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2705 "Param 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2706 " nullable 2 (UNKNOWN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2707 " signed true\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
2708 " precision 10\n" + |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2709 " scale 0\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2710 " type 4\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2711 " typename int\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2712 " classname java.lang.Integer\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2713 " mode 1 (IN)\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2714 "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
|
2715 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2716 |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2717 private void Test_PSsetBytes() { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2718 sb.setLength(0); // clear the output log buffer |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2719 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2720 PreparedStatement pstmt = null; |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2721 ResultSet rs = null; |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2722 try { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2723 sb.append("1 Create table\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2724 pstmt = con.prepareStatement("create table t7346(col1 clob, col2 blob)"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2725 sb.append(" pstmt has ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2726 .append(pstmt.getMetaData().getColumnCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2727 .append(" result columns and ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2728 .append(pstmt.getParameterMetaData().getParameterCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2729 .append(" parameters\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2730 pstmt.execute(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2731 pstmt.close(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2732 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2733 sb.append("2 Prepare Insert data\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2734 pstmt = con.prepareStatement("insert into t7346 (col1,col2) values(?,?)"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2735 sb.append(" pstmt has ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2736 .append(pstmt.getMetaData().getColumnCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2737 .append(" result columns and ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2738 .append(pstmt.getParameterMetaData().getParameterCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2739 .append(" parameters\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2740 String val = "0123456789abcdef"; |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2741 pstmt.setString(1, val); |
749
a604e71a875e
UTF-8 is a standard character set always available on Java, so use it where needed.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
748
diff
changeset
|
2742 pstmt.setBytes(2, val.getBytes(StandardCharsets.UTF_8)); |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2743 sb.append("3 Insert data row 1\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2744 pstmt.execute(); |
748
50b8cc8200cd
Correct test Test_PSsetBytes() by explicitly converting a unicode String to a UTF-8 bytes array.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
746
diff
changeset
|
2745 val = "~!@#$%^&*()_+`1-=][{}\\|';:,<.>/?"; |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2746 pstmt.setString(1, val); |
749
a604e71a875e
UTF-8 is a standard character set always available on Java, so use it where needed.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
748
diff
changeset
|
2747 pstmt.setBytes(2, val.getBytes(StandardCharsets.UTF_8)); |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2748 sb.append("4 Insert data row 2\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2749 pstmt.execute(); |
748
50b8cc8200cd
Correct test Test_PSsetBytes() by explicitly converting a unicode String to a UTF-8 bytes array.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
746
diff
changeset
|
2750 val = "\u00e0\u004f\u20f0\u0020\u00ea\u003a\u0069\u0010\u00a2\u00d8\u0008\u0001\u002b\u0030\u019c\u129e"; |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2751 pstmt.setString(1, val); |
749
a604e71a875e
UTF-8 is a standard character set always available on Java, so use it where needed.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
748
diff
changeset
|
2752 pstmt.setBytes(2, val.getBytes(StandardCharsets.UTF_8)); |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2753 sb.append("4 Insert data row 3\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2754 pstmt.execute(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2755 pstmt.close(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2756 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2757 sb.append("5 Prepare Select data\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2758 pstmt = con.prepareStatement("select col1, length(col1) as len_col1, col2, length(col2) as len_col2 from t7346"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2759 sb.append(" pstmt has ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2760 .append(pstmt.getMetaData().getColumnCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2761 .append(" result columns and ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2762 .append(pstmt.getParameterMetaData().getParameterCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2763 .append(" parameters\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2764 sb.append("6 Execute Select\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2765 rs = pstmt.executeQuery(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2766 if (rs != null) { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2767 sb.append(" rs has ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2768 .append(rs.getMetaData().getColumnCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2769 .append(" result columns\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2770 sb.append("7 Show data rows\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2771 for (int c = 1; c <= rs.getMetaData().getColumnCount(); c++) { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2772 if (c > 1) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2773 sb.append("\t"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2774 sb.append(rs.getMetaData().getColumnName(c)); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2775 } |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2776 sb.append("\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2777 while (rs.next()) { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2778 sb.append(rs.getString("col1")).append("\t") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2779 .append(rs.getInt("len_col1")).append("\t") |
729
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2780 .append(byteArrayToHexStr(rs.getBytes("col2"))).append("\t") |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2781 .append(rs.getString("col2")).append("\t") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2782 .append(rs.getInt("len_col2")).append("\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2783 } |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2784 rs.close(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2785 rs = null; |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2786 } |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2787 pstmt.close(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2788 pstmt = null; |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2789 } catch (SQLException e) { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2790 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2791 } |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2792 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2793 closeStmtResSet(pstmt, rs); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2794 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2795 // cleanup created test table |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2796 try { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2797 sb.append("8 Drop table\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2798 pstmt = con.prepareStatement("drop table if exists t7346"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2799 sb.append(" pstmt has ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2800 .append(pstmt.getMetaData().getColumnCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2801 .append(" result columns and ") |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2802 .append(pstmt.getParameterMetaData().getParameterCount()) |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2803 .append(" parameters\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2804 pstmt.execute(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2805 pstmt.close(); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2806 pstmt = null; |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2807 } catch (SQLException e) { |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2808 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2809 } |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2810 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2811 closeStmtResSet(pstmt, rs); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2812 |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2813 compareExpectedOutput("Test_PSsetBytes", |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2814 "1 Create table\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2815 " pstmt has 0 result columns and 0 parameters\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2816 "2 Prepare Insert data\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2817 " pstmt has 0 result columns and 2 parameters\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2818 "3 Insert data row 1\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2819 "4 Insert data row 2\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2820 "4 Insert data row 3\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2821 "5 Prepare Select data\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2822 " pstmt has 4 result columns and 0 parameters\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2823 "6 Execute Select\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2824 " rs has 4 result columns\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2825 "7 Show data rows\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2826 "col1 len_col1 col2 len_col2\n" + |
729
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2827 "0123456789abcdef 16 30313233343536373839616263646566 30313233343536373839616263646566 16\n" + |
748
50b8cc8200cd
Correct test Test_PSsetBytes() by explicitly converting a unicode String to a UTF-8 bytes array.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
746
diff
changeset
|
2828 "~!@#$%^&*()_+`1-=][{}|';:,<.>/? 31 7E21402324255E262A28295F2B60312D3D5D5B7B7D5C7C273B3A2C3C2E3E2F3F 7E21402324255E262A28295F2B60312D3D5D5B7B7D5C7C273B3A2C3C2E3E2F3F 32\n" + |
50b8cc8200cd
Correct test Test_PSsetBytes() by explicitly converting a unicode String to a UTF-8 bytes array.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
746
diff
changeset
|
2829 "\u00e0\u004f\u20f0\u0020\u00ea\u003a\u0069\u0010\u00a2\u00d8\u0008\u0001\u002b\u0030\u019c\u129e 16 C3A04FE283B020C3AA3A6910C2A2C39808012B30C69CE18A9E C3A04FE283B020C3AA3A6910C2A2C39808012B30C69CE18A9E 25\n" + |
727
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2830 "8 Drop table\n" + |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2831 " pstmt has 0 result columns and 0 parameters\n"); |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2832 } |
55c14e65b4be
Adding a missing test for testing method setBytes() on a PreparedStatement.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
725
diff
changeset
|
2833 |
861
56fe57835912
Resolve warning: no comment
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
854
diff
changeset
|
2834 static private final char[] HEXES = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; |
729
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2835 private String byteArrayToHexStr(final byte[] bytes) { |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2836 if (bytes == null) |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2837 return null; |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2838 final int len = bytes.length; |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2839 final StringBuilder buf = new StringBuilder(len * 2); |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2840 // convert the bytes into hex codes |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2841 for (int i = 0; i < len; i++) { |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2842 byte b = bytes[i]; |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2843 buf.append(HEXES[(b & 0xF0) >> 4]) |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2844 .append(HEXES[(b & 0x0F)]); |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2845 } |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2846 return buf.toString(); |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2847 } |
6c9abd326ad2
Extend JDBC_API_Tester with test on calling ResultSet.getBytes() method on a blob column. It was not yet tested.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
727
diff
changeset
|
2848 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2849 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
|
2850 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
|
2851 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2852 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2853 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
|
2854 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2855 // >> 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
|
2856 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
|
2857 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
2858 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
|
2859 for (int i = 0; i < 120; i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2860 pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2861 pstmt.setInt(1, i); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2862 rs = pstmt.executeQuery(); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2863 if (rs != null && rs.next() && i % 20 == 0) { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2864 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
|
2865 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2866 /* 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
|
2867 pstmt.close(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2868 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2869 } 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
|
2870 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
|
2871 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2872 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2873 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
|
2874 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2875 compareExpectedOutput("Test_PSsomeamount", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2876 "0. true true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2877 "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
|
2878 "0, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2879 "20, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2880 "40, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2881 "60, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2882 "80, true\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2883 "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
|
2884 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2885 |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2886 /* Create a lot of PreparedStatements, to emulate webloads such as those from Hibernate. */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2887 /* this test is same as Test_PSsomeamount() but for many more PreparedStatements to stress the server */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2888 private void Test_PSlargeamount() { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2889 sb.setLength(0); // clear the output log buffer |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2890 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2891 PreparedStatement pstmt = null; |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2892 ResultSet rs = null; |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2893 try { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2894 // >> true: auto commit should be on |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2895 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2896 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2897 sb.append("1. Preparing and executing a unique statement\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2898 for (int i = 0; i < 50001; i++) { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2899 pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2900 pstmt.setInt(1, i); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2901 rs = pstmt.executeQuery(); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
2902 if (rs != null && rs.next() && i % 1000 == 0) { |
464
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2903 sb.append(rs.getInt(1)).append(", ").append(rs.getBoolean(2)).append("\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2904 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2905 /* next call should cause resources on the server to be freed */ |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2906 pstmt.close(); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2907 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2908 } catch (SQLException e) { |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2909 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2910 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2911 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2912 closeStmtResSet(pstmt, rs); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2913 |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2914 compareExpectedOutput("Test_PSlargeamount", |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2915 "0. true true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2916 "1. Preparing and executing a unique statement\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2917 "0, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2918 "1000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2919 "2000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2920 "3000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2921 "4000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2922 "5000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2923 "6000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2924 "7000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2925 "8000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2926 "9000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2927 "10000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2928 "11000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2929 "12000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2930 "13000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2931 "14000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2932 "15000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2933 "16000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2934 "17000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2935 "18000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2936 "19000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2937 "20000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2938 "21000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2939 "22000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2940 "23000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2941 "24000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2942 "25000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2943 "26000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2944 "27000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2945 "28000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2946 "29000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2947 "30000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2948 "31000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2949 "32000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2950 "33000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2951 "34000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2952 "35000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2953 "36000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2954 "37000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2955 "38000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2956 "39000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2957 "40000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2958 "41000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2959 "42000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2960 "43000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2961 "44000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2962 "45000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2963 "46000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2964 "47000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2965 "48000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2966 "49000, true\n" + |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2967 "50000, true\n"); |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2968 } |
3e28de1c4f81
Convert and add Test_PSlargeamount to JDBC_API_Tester.java.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
463
diff
changeset
|
2969 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2970 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
|
2971 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
|
2972 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
2973 Statement stmt = null; |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2974 PreparedStatement pstmt = null; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2975 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
|
2976 try { |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2977 con.setAutoCommit(false); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2978 // >> 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
|
2979 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
|
2980 |
395
0eef53e06007
Add JDBC_API_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 stmt = con.createStatement(); |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2982 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
|
2983 if (updates != Statement.SUCCESS_NO_INFO) |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2984 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
|
2985 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2986 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
|
2987 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2988 sb.append(pmd.getParameterCount()).append(" parameters:\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2989 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
|
2990 sb.append("Parm ").append(parm).append("\n"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2991 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
|
2992 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
|
2993 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
|
2994 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2995 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2996 INET tinet = new INET(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2997 tinet.fromString("172.5.5.5/24"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2998 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
2999 URL turl = new URL(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3000 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3001 turl.fromString("http://www.monetdb.org/"); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3002 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3003 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
|
3004 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3005 pstmt.setObject(1, tinet); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3006 pstmt.setObject(2, turl); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3007 // insert first record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3008 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
|
3009 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
|
3010 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3011 try { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3012 tinet.setNetmaskBits(16); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3013 } catch (Exception e) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3014 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
|
3015 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3016 // insert second record |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3017 pstmt.execute(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3018 |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3019 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
|
3020 ResultSetMetaData rsmd = rs.getMetaData(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3021 for (int i = 1; rs.next(); i++) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3022 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
|
3023 Object x = rs.getObject(col); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3024 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
|
3025 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
|
3026 } else { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3027 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
|
3028 if (x instanceof INET) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3029 INET inet = (INET)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3030 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
|
3031 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
|
3032 } else if (x instanceof URL) { |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3033 URL url = (URL)x; |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3034 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
|
3035 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3036 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3037 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3038 } |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3039 con.rollback(); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3040 con.setAutoCommit(true); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3041 // >> 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
|
3042 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
|
3043 } 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
|
3044 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
|
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 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3047 closeStmtResSet(stmt, rs); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3048 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
|
3049 |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3050 compareExpectedOutput("Test_PSsqldata", |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3051 "0. false false\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3052 "2 parameters:\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3053 "Parm 1\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3054 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3055 " typename inet\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3056 " classname org.monetdb.jdbc.types.INET\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3057 "Parm 2\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3058 " type 12\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3059 " typename url\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3060 " 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
|
3061 "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
|
3062 " 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
|
3063 " 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
|
3064 "1. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3065 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3066 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3067 "1. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3068 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3069 "2. 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3070 " 172.5.5.5/24\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3071 " /172.5.5.5\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3072 "2. http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3073 " http://www.monetdb.org/\n" + |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
3074 "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
|
3075 } |
0eef53e06007
Add JDBC_API_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 |
0eef53e06007
Add JDBC_API_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 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
|
3078 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
|
3079 |
0eef53e06007
Add JDBC_API_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 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3081 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3082 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
|
3083 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3084 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3085 // >> 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
|
3086 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
|
3087 |
395
0eef53e06007
Add JDBC_API_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 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3089 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
|
3090 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3091 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
|
3092 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3093 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
|
3094 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3095 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3096 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3097 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3098 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3099 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3100 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3101 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3102 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3103 sb.append("2. inserting a record..."); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3104 final java.util.Date d = new java.util.Date(); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3105 final long tm = d.getTime(); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3106 pstmt.setTime(1, new java.sql.Time(tm)); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3107 pstmt.setTimestamp(2, new java.sql.Timestamp(tm)); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3108 pstmt.setDate(3, new java.sql.Date(tm)); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3109 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3110 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3111 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3112 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3113 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3114 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3115 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3116 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3117 sb.append("4. selecting record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3118 pstmt = con.prepareStatement("SELECT * FROM Test_PStimedate"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3119 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3120 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3121 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3122 while (rs != null && rs.next()) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3123 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
|
3124 sb.append((j+4)).append(". retrieving..."); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3125 Object x = rs.getObject(j); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3126 boolean matches = false; |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3127 if (x instanceof java.sql.Time) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3128 sb.append(" (Time)"); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3129 matches = (new java.sql.Time(tm)).toString().equals(x.toString()); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3130 } else if (x instanceof java.sql.Date) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3131 sb.append(" (Date)"); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3132 matches = (new java.sql.Date(tm)).toString().equals(x.toString()); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3133 } else if (x instanceof java.sql.Timestamp) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3134 sb.append(" (Timestamp)"); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3135 matches = (new java.sql.Timestamp(tm)).toString().equals(x.toString()); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3136 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3137 if (matches) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3138 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3139 } else { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3140 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
|
3141 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3142 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3143 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3144 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3145 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3146 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3147 // >> 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
|
3148 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
|
3149 } 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
|
3150 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
|
3151 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3152 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3153 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3154 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
|
3155 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3156 compareExpectedOutput("Test_PStimedate", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3157 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3158 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3159 "2. inserting a record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3160 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3161 "4. selecting record... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3162 "5. retrieving... (Time) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3163 "6. retrieving... (Timestamp) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3164 "7. retrieving... (Date) passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3165 "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
|
3166 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3167 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3168 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
|
3169 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
|
3170 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3171 // 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
|
3172 // setting, by overriding the VM's default |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3173 // 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
|
3174 // savings corrections |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3175 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3176 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3177 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3178 PreparedStatement pstmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3179 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
|
3180 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3181 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3182 // >> 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
|
3183 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
|
3184 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3185 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3186 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
|
3187 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3188 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
|
3189 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3190 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
|
3191 sb.append("1. empty call..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3192 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3193 // should fail (as no parameters set) |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3194 pstmt.execute(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3195 sb.append(" UNexpected PASS!\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3196 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3197 sb.append(" expected exception\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3198 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3199 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3200 sb.append("2. inserting records...\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3201 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
|
3202 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
|
3203 Calendar c = Calendar.getInstance(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3204 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
|
3205 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
|
3206 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3207 tsz.setTimeZone(c.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3208 tz.setTimeZone(tsz.getTimeZone()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3209 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
|
3210 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3211 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3212 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3213 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3214 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3215 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3216 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3217 c.setTimeZone(TimeZone.getTimeZone("UTC")); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3218 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
|
3219 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3220 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3221 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3222 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3223 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3224 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3225 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
|
3226 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
|
3227 pstmt.setTimestamp(1, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3228 pstmt.setTimestamp(2, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3229 pstmt.setTime(3, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3230 pstmt.setTime(4, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3231 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3232 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3233 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
|
3234 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
|
3235 pstmt.setTimestamp(1, ts); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3236 pstmt.setTimestamp(2, ts, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3237 pstmt.setTime(3, t); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3238 pstmt.setTime(4, t, c); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3239 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3240 sb.append(" done\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3241 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3242 sb.append("3. closing PreparedStatement..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3243 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3244 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3245 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3246 sb.append("4. selecting records..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3247 pstmt = con.prepareStatement("SELECT * FROM Test_PStimezone"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3248 rs = pstmt.executeQuery(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3249 sb.append(" passed\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3250 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3251 // 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
|
3252 // (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
|
3253 // 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
|
3254 // 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
|
3255 // 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
|
3256 // 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
|
3257 // 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
|
3258 // eventually see 1st Jan 1970. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3259 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
|
3260 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
|
3261 .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
|
3262 // .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
|
3263 .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
|
3264 // .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
|
3265 .append("\n"); |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3266 rs.getString("tsz"); |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3267 rs.getString("tz"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3268 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3269 tsz.setTimeZone(TimeZone.getDefault()); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3270 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
|
3271 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
|
3272 .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
|
3273 .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
|
3274 .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
|
3275 .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
|
3276 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3277 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
|
3278 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
|
3279 .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
|
3280 .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
|
3281 .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
|
3282 .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
|
3283 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3284 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
|
3285 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
|
3286 .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
|
3287 .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
|
3288 .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
|
3289 .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
|
3290 |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3291 sb.append("getObject:\n") |
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3292 .append(rs.getObject("ts")).append(" | ") |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3293 // .append(rs.getObject("tsz")).append(" | ") -- this value changes on different time zones, so no stable output |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3294 .append(rs.getObject("t")).append(" | ") |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3295 // .append(rs.getObject("tz")) -- this value changes on different time zones, so no stable output |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3296 .append("\n"); |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3297 rs.getObject("tsz"); |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3298 rs.getObject("tz"); |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3299 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3300 SQLWarning w = rs.getWarnings(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3301 while (w != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3302 sb.append(w.getMessage()).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3303 w = w.getNextWarning(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3304 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3305 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3306 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3307 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3308 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3309 // >> 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
|
3310 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
|
3311 } 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
|
3312 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
|
3313 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3314 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3315 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3316 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
|
3317 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3318 compareExpectedOutput("Test_PStimezone", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3319 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3320 "1. empty call... expected exception\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3321 "2. inserting records...\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3322 "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
|
3323 "inserting with calendar timezone UTC\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3324 "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
|
3325 "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
|
3326 " done\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3327 "3. closing PreparedStatement... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3328 "4. selecting records... passed\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3329 "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
|
3330 // 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
|
3331 "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
|
3332 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3333 "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
|
3334 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3335 "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
|
3336 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3337 "1969-12-31 22:00:00.0 | 1970-01-01 00:00:00.0 | 22:00:00 | 00:00:00\n" + |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3338 "getObject:\n" + |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3339 // old output "1970-01-01 00:00:00.0 | 1970-01-01T01:00+01:00 | 00:00:00 | 01:00+01:00\n" + |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3340 "1970-01-01 00:00:00.0 | 00:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3341 "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
|
3342 // 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
|
3343 "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
|
3344 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3345 "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
|
3346 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3347 "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
|
3348 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3349 "1969-12-31 22:00:00.0 | 1970-01-01 00:00:00.0 | 22:00:00 | 00:00:00\n" + |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3350 "getObject:\n" + |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3351 // old output "1970-01-01 00:00:00.0 | 1970-01-01T01:00+01:00 | 00:00:00 | 01:00+01:00\n" + |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3352 "1970-01-01 00:00:00.0 | 00:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3353 "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
|
3354 // 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
|
3355 "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
|
3356 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3357 "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
|
3358 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3359 "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
|
3360 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3361 "1969-12-31 14:00:00.0 | 1970-01-01 00:00:00.0 | 14:00:00 | 00:00:00\n" + |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3362 "getObject:\n" + |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3363 // old output "1969-12-31 16:00:00.0 | 1970-01-01T01:00+01:00 | 16:00:00 | 01:00+01:00\n" + |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3364 "1969-12-31 16:00:00.0 | 16:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3365 "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
|
3366 // 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
|
3367 "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
|
3368 "default (UTC):\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3369 "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
|
3370 "America/Los_Angeles:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3371 "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
|
3372 "Africa/Windhoek:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3373 "1969-12-31 22:00:00.0 | 1970-01-01 00:00:00.0 | 22:00:00 | 00:00:00\n" + |
820
4c35009cd59c
In ResultSet.getObject() method added support for retrieving
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
818
diff
changeset
|
3374 "getObject:\n" + |
845
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3375 // old output "1970-01-01 00:00:00.0 | 1970-01-01T01:00+01:00 | 00:00:00 | 01:00+01:00\n" + |
d7ffef8faf38
Adjust test to not compare output that changes when run in different time zones.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
844
diff
changeset
|
3376 "1970-01-01 00:00:00.0 | 00:00:00 | \n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3377 "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
|
3378 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3379 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3380 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
|
3381 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
|
3382 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3383 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3384 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
|
3385 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3386 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3387 // >> 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
|
3388 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
|
3389 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3390 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3391 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3392 "CREATE TABLE htmtest (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3393 " htmid bigint NOT NULL," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3394 " ra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3395 " decl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3396 " dra double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3397 " ddecl double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3398 " flux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3399 " dflux double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3400 " freq double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3401 " bw double ," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3402 " type decimal(1,0)," + |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3403 " imageurl url(100)," + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3404 " comment varchar(100)," + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3405 " CONSTRAINT htmtest_htmid_pkey PRIMARY KEY (htmid)" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3406 ")" ); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3407 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3408 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
|
3409 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3410 // 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
|
3411 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
|
3412 if (updates != Statement.SUCCESS_NO_INFO) |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3413 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
|
3414 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3415 stmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3416 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3417 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
|
3418 sb.append("1. inserting a record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3419 pstmt.setLong(1, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3420 pstmt.setFloat(2, (float)1.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3421 pstmt.setDouble(3, 2.4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3422 pstmt.setDouble(4, 3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3423 pstmt.setString(5, "vlavbla"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3424 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3425 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3426 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3427 // try an update like bug #1757923 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3428 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
|
3429 sb.append("2. updating record..."); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3430 pstmt.setString(1, "some update"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3431 pstmt.setObject(2, (float)3.2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3432 pstmt.setLong(3, 1L); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3433 pstmt.executeUpdate(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3434 sb.append("success\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3435 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3436 pstmt.close(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3437 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3438 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3439 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3440 // >> 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
|
3441 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
|
3442 } 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
|
3443 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
|
3444 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3445 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3446 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3447 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
|
3448 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3449 compareExpectedOutput("Test_PStypes", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3450 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3451 "1. inserting a record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3452 "2. updating record...success\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3453 "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
|
3454 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3455 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3456 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
|
3457 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
|
3458 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3459 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3460 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
|
3461 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3462 String tbl_nm = "tbl6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3463 String proc_nm = "proc6402"; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3464 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3465 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3466 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3467 // create a test table. |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3468 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
|
3469 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
|
3470 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3471 // 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
|
3472 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
|
3473 " 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
|
3474 "END;"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3475 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
|
3476 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3477 // 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
|
3478 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
|
3479 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
|
3480 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3481 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3482 // now use a CallableStament object |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3483 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
|
3484 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
|
3485 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3486 // specify first set of params |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3487 cstmt.setInt(1, 2); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3488 cstmt.setDouble(2, 2.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3489 cstmt.setBoolean(3, true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3490 cstmt.setString(4, "Two"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3491 Clob myclob = con.createClob(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3492 myclob.setString(1, "TWOs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3493 cstmt.setClob(5, myclob); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3494 cstmt.setString(6, "http://www.monetdb.org/"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3495 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3496 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
|
3497 showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3498 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3499 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3500 myclob.setString(1, "TREEs"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3501 // 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
|
3502 cstmt.setDouble(2, 3.02); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3503 cstmt.setString(4, "Tree"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3504 try { |
769
b6d113ee35ae
Fixed javac version 20 compiler warnings.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
764
diff
changeset
|
3505 cstmt.setURL(6, new java.net.URI("https://www.monetdb.org/").toURL()); |
b6d113ee35ae
Fixed javac version 20 compiler warnings.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
764
diff
changeset
|
3506 } catch (java.net.URISyntaxException | java.net.MalformedURLException mfue) { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3507 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
|
3508 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3509 cstmt.execute(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3510 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
|
3511 // showParams(cstmt); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3512 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3513 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3514 // 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
|
3515 cstmt.setInt(1, 4); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3516 cstmt.setBoolean(3, false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3517 cstmt.setString(4, "Four"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3518 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3519 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
|
3520 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3521 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3522 // test setNull() also |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3523 cstmt.setNull(3, Types.BOOLEAN); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3524 cstmt.setNull(5, Types.CLOB); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3525 cstmt.setNull(2, Types.DOUBLE); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3526 cstmt.setNull(4, Types.VARCHAR); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3527 cstmt.setNull(1, Types.INTEGER); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3528 cstmt.executeUpdate(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3529 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
|
3530 showTblContents(tbl_nm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3531 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3532 cstmt.clearParameters(); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
3533 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
3534 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
|
3535 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
|
3536 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
|
3537 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3538 } 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
|
3539 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
|
3540 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3541 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3542 closeStmtResSet(stmt, null); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3543 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
|
3544 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3545 compareExpectedOutput("Test_CallableStmt", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3546 "Created table: tbl6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3547 "Created procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3548 "Called procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3549 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3550 " 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
|
3551 " 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
|
3552 "Prepared Callable procedure: proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3553 "Called Prepared procedure (1): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3554 "pmd. 6 parameters:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3555 "Param 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3556 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3557 " signed true\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
3558 " precision 10\n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3559 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3560 " type 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3561 " typename int\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3562 " classname java.lang.Integer\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3563 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3564 "Param 2\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3565 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3566 " signed true\n" + |
667
ed3d0c1a60cf
Corrected PreparedStatement methods getMetaData().getColumnDisplaySize(), getMetaData().getPrecision() and getParameterMetaData().getPrecision().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
665
diff
changeset
|
3567 " precision 15\n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3568 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3569 " type 8\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3570 " typename double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3571 " classname java.lang.Double\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3572 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3573 "Param 3\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3574 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3575 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3576 " precision 1\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3577 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3578 " type 16\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3579 " typename boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3580 " classname java.lang.Boolean\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3581 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3582 "Param 4\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3583 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3584 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3585 " precision 15\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3586 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3587 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3588 " typename varchar\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3589 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3590 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3591 "Param 5\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3592 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3593 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3594 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3595 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3596 " type 12\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
3597 " typename " + (isPostDec2023 ? "varchar" : "clob") + "\n" + |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3598 " classname java.lang.String\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3599 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3600 "Param 6\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3601 " nullable 2 (UNKNOWN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3602 " signed false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3603 " precision 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3604 " scale 0\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3605 " type 12\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3606 " typename url\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3607 " classname org.monetdb.jdbc.types.URL\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3608 " mode 1 (IN)\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3609 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3610 " 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
|
3611 " 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
|
3612 " 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
|
3613 "Called Prepared procedure (2): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3614 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3615 " 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
|
3616 " 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
|
3617 " 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
|
3618 " 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
|
3619 "Called Prepared procedure (3): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3620 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3621 " 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
|
3622 " 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
|
3623 " 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
|
3624 " 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
|
3625 " 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
|
3626 "Called Prepared procedure (with NULLs): proc6402\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3627 "Table tbl6402 has 7 columns:\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3628 " 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
|
3629 " 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
|
3630 " 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
|
3631 " 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
|
3632 " 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
|
3633 " 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
|
3634 "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
|
3635 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3636 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3637 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
|
3638 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
|
3639 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3640 Statement stmt = null; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3641 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
|
3642 try { |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3643 con.setAutoCommit(false); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3644 // >> 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
|
3645 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
|
3646 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3647 stmt = con.createStatement(); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3648 int updates = stmt.executeUpdate( |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3649 "CREATE TABLE Test_Rbooleans (" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3650 " 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
|
3651 " 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
|
3652 " 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
|
3653 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
|
3654 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
|
3655 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3656 // all falses |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3657 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
|
3658 // all trues |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3659 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
|
3660 // sneakier |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3661 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
|
3662 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
|
3663 if (updates != 4) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3664 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
|
3665 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3666 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
|
3667 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3668 // all should give false |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3669 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3670 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
|
3671 .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
|
3672 .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
|
3673 .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
|
3674 .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
|
3675 .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
|
3676 .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
|
3677 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3678 // 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
|
3679 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3680 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
|
3681 .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
|
3682 .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
|
3683 .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
|
3684 .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
|
3685 .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
|
3686 .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
|
3687 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3688 // 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
|
3689 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3690 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
|
3691 .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
|
3692 .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
|
3693 .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
|
3694 .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
|
3695 .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
|
3696 .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
|
3697 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3698 // 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
|
3699 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3700 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
|
3701 .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
|
3702 .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
|
3703 .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
|
3704 .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
|
3705 .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
|
3706 .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
|
3707 rs.next(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3708 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3709 con.rollback(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3710 con.setAutoCommit(true); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3711 // >> 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
|
3712 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
|
3713 } 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
|
3714 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
|
3715 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3716 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3717 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
|
3718 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3719 compareExpectedOutput("Test_Rbooleans", |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3720 "0. false false\n" + |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
3721 "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
|
3722 "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
|
3723 "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
|
3724 "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
|
3725 "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
|
3726 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3727 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3728 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
|
3729 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
|
3730 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3731 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3732 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
|
3733 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3734 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3735 // >> 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
|
3736 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
|
3737 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3738 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3739 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
|
3740 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3741 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3742 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
|
3743 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3744 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
|
3745 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3746 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
|
3747 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3748 ResultSetMetaData rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3749 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
|
3750 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
|
3751 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
|
3752 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
|
3753 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
|
3754 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
|
3755 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
|
3756 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
|
3757 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
|
3758 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
|
3759 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
|
3760 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
|
3761 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
|
3762 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
|
3763 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
|
3764 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
|
3765 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
|
3766 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
|
3767 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
|
3768 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
|
3769 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
|
3770 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
|
3771 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
|
3772 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3773 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3774 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
|
3775 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
|
3776 Object obj = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3777 String type = rsmd.getColumnClassName(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3778 String isInstance = "(null)"; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3779 if (obj != null && type != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3780 try { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3781 Class<?> c = Class.forName(type); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3782 if (c.isInstance(obj)) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3783 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
|
3784 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3785 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
|
3786 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3787 } catch (ClassNotFoundException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3788 isInstance = "No such class: " + type; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3789 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3790 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3791 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
|
3792 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3793 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3794 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3795 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3796 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3797 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3798 // >> 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
|
3799 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
|
3800 } 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
|
3801 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
|
3802 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3803 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3804 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3805 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3806 compareExpectedOutput("Test_Rmetadata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3807 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3808 "0. 5 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3809 "Colnr 1.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3810 " classname java.lang.Integer\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3811 " displaysize 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3812 " label myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3813 " name myint\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3814 " type 4\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3815 " typename int\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3816 " precision 10\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3817 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3818 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3819 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3820 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3821 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3822 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3823 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3824 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3825 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3826 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3827 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3828 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3829 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3830 "Colnr 2.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3831 " classname java.lang.Double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3832 " displaysize 24\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3833 " label mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3834 " name mydouble\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3835 " type 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3836 " typename double\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3837 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3838 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3839 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3840 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3841 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3842 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3843 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3844 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3845 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3846 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3847 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3848 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3849 " signed true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3850 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3851 "Colnr 3.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3852 " classname java.lang.Boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3853 " displaysize 5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3854 " label mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3855 " name mybool\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3856 " type 16\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3857 " typename boolean\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3858 " precision 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3859 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3860 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3861 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3862 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3863 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3864 " casesensitive false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3865 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3866 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3867 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3868 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3869 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3870 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3871 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3872 "Colnr 4.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3873 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3874 " displaysize 8\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3875 " label myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3876 " name myvarchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3877 " type 12\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3878 " typename varchar\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3879 " precision 15\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3880 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3881 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3882 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3883 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3884 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3885 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3886 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3887 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3888 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3889 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3890 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3891 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3892 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3893 "Colnr 5.\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3894 " classname java.lang.String\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3895 " displaysize 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3896 " label myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3897 " name myclob\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3898 " type 12\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
3899 " typename " + (isPostDec2023 ? "varchar" : "clob") + "\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3900 " precision 11\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3901 " scale 0\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3902 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3903 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3904 " tablename test_rmetadata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3905 " autoincrement false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3906 " casesensitive true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3907 " currency false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3908 " defwritable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3909 " nullable 1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3910 " readonly true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3911 " searchable true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3912 " signed false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3913 " writable false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3914 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3915 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3916 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3917 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3918 "6. (null)\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
3919 "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
|
3920 "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
|
3921 "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
|
3922 "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
|
3923 "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
|
3924 "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
|
3925 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
3926 |
713
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3927 private void Test_RSgetMetaData() { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3928 sb.setLength(0); // clear the output log buffer |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3929 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3930 Statement stmt = null; |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3931 ResultSet rs = null; |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3932 try { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3933 con.setAutoCommit(false); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3934 // >> false: auto commit should be off now |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3935 sb.append("0. false\t").append(con.getAutoCommit()).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3936 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3937 stmt = con.createStatement(); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3938 stmt.executeUpdate("CREATE TABLE Test_RSmetadata ( myint int, mydouble double, mybool boolean, myvarchar varchar(15), myclob clob )"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3939 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3940 // all NULLs |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3941 stmt.executeUpdate("INSERT INTO Test_RSmetadata VALUES (NULL, NULL, NULL, NULL, NULL)"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3942 // all filled in |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3943 stmt.executeUpdate("INSERT INTO Test_RSmetadata VALUES (2 , 3.0, true, 'A string', 'bla bla bla')"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3944 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3945 rs = stmt.executeQuery("SELECT * FROM Test_RSmetadata"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3946 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3947 sb.append("0. ").append(rs.getMetaData().getColumnCount()).append(" columns:\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3948 for (int col = 1; col <= rs.getMetaData().getColumnCount(); col++) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3949 sb.append("Colnr ").append(col).append(".\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3950 sb.append("\tclassname ").append(rs.getMetaData().getColumnClassName(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3951 sb.append("\tdisplaysize ").append(rs.getMetaData().getColumnDisplaySize(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3952 sb.append("\tlabel ").append(rs.getMetaData().getColumnLabel(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3953 sb.append("\tname ").append(rs.getMetaData().getColumnName(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3954 sb.append("\ttype ").append(rs.getMetaData().getColumnType(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3955 sb.append("\ttypename ").append(rs.getMetaData().getColumnTypeName(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3956 sb.append("\tprecision ").append(rs.getMetaData().getPrecision(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3957 sb.append("\tscale ").append(rs.getMetaData().getScale(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3958 sb.append("\tcatalogname ").append(rs.getMetaData().getCatalogName(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3959 sb.append("\tschemaname ").append(rs.getMetaData().getSchemaName(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3960 sb.append("\ttablename ").append(rs.getMetaData().getTableName(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3961 sb.append("\tautoincrement ").append(rs.getMetaData().isAutoIncrement(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3962 sb.append("\tcasesensitive ").append(rs.getMetaData().isCaseSensitive(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3963 sb.append("\tcurrency ").append(rs.getMetaData().isCurrency(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3964 sb.append("\tdefwritable ").append(rs.getMetaData().isDefinitelyWritable(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3965 sb.append("\tnullable ").append(rs.getMetaData().isNullable(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3966 sb.append("\treadonly ").append(rs.getMetaData().isReadOnly(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3967 sb.append("\tsearchable ").append(rs.getMetaData().isSearchable(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3968 sb.append("\tsigned ").append(rs.getMetaData().isSigned(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3969 sb.append("\twritable ").append(rs.getMetaData().isWritable(col)).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3970 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3971 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3972 for (int i = 6; rs.next(); i++) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3973 for (int col = 1; col <= rs.getMetaData().getColumnCount(); col++) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3974 Object obj = rs.getObject(col); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3975 String type = rs.getMetaData().getColumnClassName(col); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3976 String isInstance = "(null)"; |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3977 if (obj != null && type != null) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3978 try { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3979 Class<?> c = Class.forName(type); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3980 if (c.isInstance(obj)) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3981 isInstance = (obj.getClass().getName() + " is an instance of " + type); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3982 } else { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3983 isInstance = (obj.getClass().getName() + " is NOT an instance of " + type); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3984 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3985 } catch (ClassNotFoundException e) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3986 isInstance = "No such class: " + type; |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3987 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3988 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3989 sb.append(i).append(".\t").append(isInstance).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3990 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3991 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3992 rs.close(); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3993 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3994 con.rollback(); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3995 con.setAutoCommit(true); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3996 // >> true: auto commit was just switched on |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3997 sb.append("0. true\t").append(con.getAutoCommit()).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3998 } catch (SQLException e) { |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
3999 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4000 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4001 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4002 closeStmtResSet(stmt, rs); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4003 |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4004 compareExpectedOutput("Test_RSgetMetaData", |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4005 "0. false false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4006 "0. 5 columns:\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4007 "Colnr 1.\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4008 " classname java.lang.Integer\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4009 " displaysize 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4010 " label myint\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4011 " name myint\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4012 " type 4\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4013 " typename int\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4014 " precision 10\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4015 " scale 0\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4016 " catalogname null\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4017 " schemaname sys\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4018 " tablename test_rsmetadata\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4019 " autoincrement false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4020 " casesensitive false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4021 " currency false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4022 " defwritable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4023 " nullable 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4024 " readonly true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4025 " searchable true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4026 " signed true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4027 " writable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4028 "Colnr 2.\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4029 " classname java.lang.Double\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4030 " displaysize 24\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4031 " label mydouble\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4032 " name mydouble\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4033 " type 8\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4034 " typename double\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4035 " precision 15\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4036 " scale 0\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4037 " catalogname null\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4038 " schemaname sys\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4039 " tablename test_rsmetadata\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4040 " autoincrement false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4041 " casesensitive false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4042 " currency false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4043 " defwritable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4044 " nullable 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4045 " readonly true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4046 " searchable true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4047 " signed true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4048 " writable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4049 "Colnr 3.\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4050 " classname java.lang.Boolean\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4051 " displaysize 5\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4052 " label mybool\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4053 " name mybool\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4054 " type 16\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4055 " typename boolean\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4056 " precision 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4057 " scale 0\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4058 " catalogname null\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4059 " schemaname sys\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4060 " tablename test_rsmetadata\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4061 " autoincrement false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4062 " casesensitive false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4063 " currency false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4064 " defwritable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4065 " nullable 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4066 " readonly true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4067 " searchable true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4068 " signed false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4069 " writable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4070 "Colnr 4.\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4071 " classname java.lang.String\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4072 " displaysize 8\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4073 " label myvarchar\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4074 " name myvarchar\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4075 " type 12\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4076 " typename varchar\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4077 " precision 15\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4078 " scale 0\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4079 " catalogname null\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4080 " schemaname sys\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4081 " tablename test_rsmetadata\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4082 " autoincrement false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4083 " casesensitive true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4084 " currency false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4085 " defwritable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4086 " nullable 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4087 " readonly true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4088 " searchable true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4089 " signed false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4090 " writable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4091 "Colnr 5.\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4092 " classname java.lang.String\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4093 " displaysize 11\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4094 " label myclob\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4095 " name myclob\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4096 " type 12\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
4097 " typename " + (isPostDec2023 ? "varchar" : "clob") + "\n" + |
713
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4098 " precision 11\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4099 " scale 0\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4100 " catalogname null\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4101 " schemaname sys\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4102 " tablename test_rsmetadata\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4103 " autoincrement false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4104 " casesensitive true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4105 " currency false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4106 " defwritable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4107 " nullable 1\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4108 " readonly true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4109 " searchable true\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4110 " signed false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4111 " writable false\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4112 "6. (null)\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4113 "6. (null)\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4114 "6. (null)\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4115 "6. (null)\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4116 "6. (null)\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4117 "7. java.lang.Integer is an instance of java.lang.Integer\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4118 "7. java.lang.Double is an instance of java.lang.Double\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4119 "7. java.lang.Boolean is an instance of java.lang.Boolean\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4120 "7. java.lang.String is an instance of java.lang.String\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4121 "7. java.lang.String is an instance of java.lang.String\n" + |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4122 "0. true true\n"); |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4123 } |
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4124 |
694
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4125 private void Test_RfetchManyColumnsInfo() { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4126 sb.setLength(0); // clear the output log buffer |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4127 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4128 Statement stmt = null; |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4129 ResultSet rs = null; |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4130 try { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4131 final int NR_COLUMNS = 180; |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4132 final StringBuilder sql = new StringBuilder(50 + (NR_COLUMNS * 12)); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4133 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4134 sql.append("CREATE TABLE Test_RfetchManyColumnsInfo ("); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4135 for (int col = 1; col <= NR_COLUMNS; col++) { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4136 sql.append("col").append(col).append(" int"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4137 sql.append((col < NR_COLUMNS) ? ", " : ")"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4138 } |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4139 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4140 stmt = con.createStatement(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4141 stmt.executeUpdate(sql.toString()); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4142 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4143 // add 1 row (all NULLs) |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4144 int inserted = stmt.executeUpdate("INSERT INTO Test_RfetchManyColumnsInfo (col1) VALUES (1)"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4145 if (inserted != 1) |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4146 sb.append("Expected 1 row inserted, but got: ").append(inserted).append("\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4147 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4148 rs = stmt.executeQuery("SELECT * FROM Test_RfetchManyColumnsInfo"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4149 rs.next(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4150 ResultSetMetaData rsmd = rs.getMetaData(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4151 sb.append(rsmd.getColumnCount()).append(" columns start at columnCount\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4152 // do pulling of the metadata info in reverse order to test optimizing logic |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4153 // in ResultSetMetaData.fetchManyColumnsInfo() to choose a lower start_col iteratively |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4154 for (int col = rsmd.getColumnCount(); col >= 1; col--) { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4155 // sb.append(col).append(","); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4156 rsmd.getColumnClassName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4157 rsmd.getColumnDisplaySize(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4158 rsmd.getColumnLabel(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4159 rsmd.getColumnName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4160 rsmd.getColumnType(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4161 rsmd.getColumnTypeName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4162 rsmd.getPrecision(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4163 rsmd.getScale(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4164 rsmd.getCatalogName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4165 rsmd.getSchemaName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4166 rsmd.getTableName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4167 rsmd.isAutoIncrement(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4168 rsmd.isCaseSensitive(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4169 rsmd.isCurrency(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4170 rsmd.isDefinitelyWritable(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4171 if (rsmd.isNullable(col) != ResultSetMetaData.columnNullable) |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4172 sb.append(col).append(" wrong isNullable()").append(rsmd.isNullable(col)).append("\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4173 rsmd.isReadOnly(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4174 rsmd.isSearchable(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4175 rsmd.isSigned(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4176 rsmd.isWritable(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4177 } |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4178 rs.close(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4179 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4180 rs = stmt.executeQuery("SELECT * FROM Test_RfetchManyColumnsInfo"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4181 rs.next(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4182 rsmd = rs.getMetaData(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4183 sb.append(rsmd.getColumnCount()).append(" columns start at 1\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4184 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4185 // sb.append(col).append(","); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4186 rsmd.getColumnClassName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4187 rsmd.getColumnDisplaySize(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4188 rsmd.getColumnLabel(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4189 rsmd.getColumnName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4190 rsmd.getColumnType(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4191 rsmd.getColumnTypeName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4192 rsmd.getPrecision(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4193 rsmd.getScale(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4194 rsmd.getCatalogName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4195 rsmd.getSchemaName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4196 rsmd.getTableName(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4197 rsmd.isAutoIncrement(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4198 rsmd.isCaseSensitive(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4199 rsmd.isCurrency(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4200 rsmd.isDefinitelyWritable(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4201 if (rsmd.isNullable(col) != ResultSetMetaData.columnNullable) |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4202 sb.append(col).append(" wrong isNullable()").append(rsmd.isNullable(col)).append("\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4203 rsmd.isReadOnly(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4204 rsmd.isSearchable(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4205 rsmd.isSigned(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4206 rsmd.isWritable(col); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4207 } |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4208 rs.close(); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4209 } catch (SQLException e) { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4210 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4211 } |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4212 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4213 // cleanup table |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4214 try { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4215 stmt.executeUpdate("DROP TABLE IF EXISTS Test_RfetchManyColumnsInfo;"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4216 } catch (SQLException e) { |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4217 sb.append("FAILED to drop: ").append(e.getMessage()).append("\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4218 } |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4219 closeStmtResSet(stmt, rs); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4220 |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4221 compareExpectedOutput("Test_RfetchManyColumnsInfo", |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4222 "180 columns start at columnCount\n" + |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4223 "180 columns start at 1\n"); |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4224 } |
97008566d6c5
Optimize number of SQL queries sent to server when ResultSetMetaData info is fetched from highest column number to first column 1.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
692
diff
changeset
|
4225 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4226 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
|
4227 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
|
4228 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4229 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4230 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
|
4231 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
|
4232 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4233 // get a one rowed resultset |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4234 rs = stmt.executeQuery("SELECT 1"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4235 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4236 // >> 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
|
4237 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
|
4238 // >> 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
|
4239 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
|
4240 // >> 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
|
4241 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
|
4242 // >> 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
|
4243 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
|
4244 // >> 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
|
4245 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
|
4246 // >> 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
|
4247 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
|
4248 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4249 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
|
4250 // >> 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
|
4251 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
|
4252 // >> 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
|
4253 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
|
4254 // >> 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
|
4255 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
|
4256 // >> 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
|
4257 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
|
4258 // >> 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
|
4259 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
|
4260 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4261 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4262 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4263 // 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
|
4264 DatabaseMetaData dbmd = con.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4265 rs = dbmd.getTableTypes(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4266 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4267 // >> 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
|
4268 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
|
4269 // >> 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
|
4270 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
|
4271 // >> 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
|
4272 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
|
4273 // >> 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
|
4274 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
|
4275 // >> 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
|
4276 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
|
4277 // move to last row |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4278 rs.last(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4279 // >> 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
|
4280 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
|
4281 // >> true: see above |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4282 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
|
4283 // >> 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
|
4284 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
|
4285 // >> 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
|
4286 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
|
4287 // >> 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
|
4288 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
|
4289 // >> 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
|
4290 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
|
4291 // >> 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
|
4292 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
|
4293 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4294 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
|
4295 } 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
|
4296 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
|
4297 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4298 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4299 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4300 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4301 compareExpectedOutput("Test_Rpositioning", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4302 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4303 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4304 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4305 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4306 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4307 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4308 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4309 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4310 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4311 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4312 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4313 "12.true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4314 "1. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4315 "2. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4316 "3. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4317 "4. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4318 "5. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4319 "6. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4320 "7. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4321 "8. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4322 "9. true true\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4323 "10. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4324 "11. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4325 "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
|
4326 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4327 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4328 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
|
4329 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
|
4330 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4331 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4332 ResultSet rs = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4333 ResultSetMetaData rsmd = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4334 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4335 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4336 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4337 // >> 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
|
4338 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
|
4339 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4340 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4341 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
|
4342 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4343 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
|
4344 // all NULLs |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4345 stmt.executeUpdate(InsertInto + "(NULL, NULL)"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4346 // all filled in |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4347 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
|
4348 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
|
4349 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
|
4350 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
|
4351 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4352 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
|
4353 rsmd = rs.getMetaData(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4354 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4355 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
|
4356 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
|
4357 sb.append(col).append("\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4358 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
|
4359 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
|
4360 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
|
4361 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
|
4362 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
|
4363 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4364 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4365 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
|
4366 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
|
4367 sb.append(i).append(".\t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4368 Object x = rs.getObject(col); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4369 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
|
4370 sb.append("<null>\n"); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4371 } else { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4372 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
|
4373 if (x instanceof INET) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4374 INET inet = (INET)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4375 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
|
4376 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
|
4377 } else if (x instanceof URL) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4378 URL url = (URL)x; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4379 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
|
4380 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4381 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4382 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4383 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4384 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4385 rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4386 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4387 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4388 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4389 // >> 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
|
4390 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
|
4391 } 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
|
4392 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
|
4393 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4394 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4395 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4396 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4397 compareExpectedOutput("Test_Rsqldata", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4398 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4399 "0. 2 columns:\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4400 "1\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4401 " 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
|
4402 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4403 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4404 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4405 " columnname myinet\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4406 "2\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4407 " 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
|
4408 " catalogname null\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4409 " schemaname sys\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4410 " tablename test_rsqldata\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4411 " columnname myurl\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4412 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4413 "1. <null>\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4414 "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
|
4415 " 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
|
4416 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4417 "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
|
4418 " http://www.monetdb.org/\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4419 "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
|
4420 " 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
|
4421 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4422 "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
|
4423 " 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
|
4424 "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
|
4425 " 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
|
4426 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4427 "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
|
4428 " 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
|
4429 "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
|
4430 " 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
|
4431 " /172.5.5.5\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4432 "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
|
4433 " 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
|
4434 "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
|
4435 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4436 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4437 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
|
4438 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
|
4439 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4440 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4441 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
|
4442 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4443 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4444 // >> 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
|
4445 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
|
4446 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4447 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4448 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
|
4449 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4450 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
|
4451 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
|
4452 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
|
4453 // 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
|
4454 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
|
4455 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
|
4456 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
|
4457 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4458 // 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
|
4459 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
|
4460 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
|
4461 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
|
4462 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
|
4463 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
|
4464 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
|
4465 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
|
4466 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
|
4467 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
|
4468 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4469 // 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
|
4470 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
|
4471 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
|
4472 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
|
4473 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
|
4474 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
|
4475 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
|
4476 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4477 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
|
4478 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4479 readNextRow(rs, 1, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4480 readNextRow(rs, 2, "t"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4481 readNextRow(rs, 3, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4482 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4483 readNextRow(rs, 4, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4484 readNextRow(rs, 5, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4485 readNextRow(rs, 6, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4486 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4487 readNextRow(rs, 11, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4488 readNextRow(rs, 12, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4489 readNextRow(rs, 13, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4490 readNextRow(rs, 14, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4491 readNextRow(rs, 15, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4492 readNextRow(rs, 16, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4493 readNextRow(rs, 17, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4494 readNextRow(rs, 18, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4495 readNextRow(rs, 19, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4496 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4497 readNextRow(rs, 21, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4498 readNextRow(rs, 22, "ts"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4499 readNextRow(rs, 23, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4500 readNextRow(rs, 24, "d"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4501 readNextRow(rs, 25, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4502 readNextRow(rs, 26, "vc"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4503 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4504 readWarnings(stmt.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4505 readWarnings(con.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4506 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4507 con.rollback(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4508 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4509 // >> 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
|
4510 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
|
4511 } 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
|
4512 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
|
4513 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4514 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4515 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4516 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4517 compareExpectedOutput("Test_Rtimedate", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4518 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4519 "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
|
4520 "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
|
4521 "1. ts 2004-04-24 11:43:53.123000 to dt: 2004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4522 "1. ts 2004-04-24 11:43:53.123000 to LocalDateTime: 2004-04-24T11:43:53.123\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4523 "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
|
4524 "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
|
4525 "2. t 11:43:53 to dt: 1970-01-01\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4526 "2. t 11:43:53 to LocalTime: 11:43:53\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4527 "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
|
4528 "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
|
4529 "3. d 2004-04-24 to dt: 2004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4530 "3. d 2004-04-24 to LocalDate: 2004-04-24\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4531 "4. vc 2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4532 "4. vc 2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 5 found: '-' in '2004-04-24 11:43:53.654321'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4533 "4. vc 2004-04-24 11:43:53.654321 to dt: 2004-04-24\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4534 "5. vc 11:43:53 to ts: rs.getTimestamp(colnm) failed with error: parsing failed at pos 3 found: ':' in '11:43:53'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4535 "5. vc 11:43:53 to tm: 11:43:53\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4536 "5. vc 11:43:53 to dt: rs.getDate(colnm) failed with error: parsing failed at pos 3 found: ':' in '11:43:53'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4537 "6. vc 2004-04-24 to ts: 2004-04-24 00:00:00.0\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4538 "6. vc 2004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 5 found: '-' in '2004-04-24'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4539 "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
|
4540 "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
|
4541 "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
|
4542 "11. ts 904-04-24 11:43:53.567000 to dt: 0904-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4543 "11. ts 904-04-24 11:43:53.567000 to LocalDateTime: rs.getObject(colnm, class<T>): Failed to convert to LocalDateTime: Text '904-04-24T11:43:53.567000' could not be parsed at index 0\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4544 "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
|
4545 "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
|
4546 "12. ts 74-04-24 11:43:53.567000 to dt: 0074-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4547 "12. ts 74-04-24 11:43:53.567000 to LocalDateTime: rs.getObject(colnm, class<T>): Failed to convert to LocalDateTime: Text '74-04-24T11:43:53.567000' could not be parsed at index 0\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4548 "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
|
4549 "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
|
4550 "13. ts 4-04-24 11:43:53.567000 to dt: 0004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4551 "13. ts 4-04-24 11:43:53.567000 to LocalDateTime: rs.getObject(colnm, class<T>): Failed to convert to LocalDateTime: Text '4-04-24T11:43:53.567000' could not be parsed at index 0\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4552 "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
|
4553 "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
|
4554 "14. d 904-04-24 to dt: 0904-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4555 "14. d 904-04-24 to LocalDate: rs.getObject(colnm, class<T>): Failed to convert to LocalDate: Text '904-04-24' could not be parsed at index 0\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4556 "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
|
4557 "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
|
4558 "15. d 74-04-24 to dt: 0074-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4559 "15. d 74-04-24 to LocalDate: rs.getObject(colnm, class<T>): Failed to convert to LocalDate: Text '74-04-24' could not be parsed at index 0\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4560 "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
|
4561 "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
|
4562 "16. d 4-04-24 to dt: 0004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4563 "16. d 4-04-24 to LocalDate: rs.getObject(colnm, class<T>): Failed to convert to LocalDate: Text '4-04-24' could not be parsed at index 0\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4564 "17. vc 904-04-24 11:43:53.567 to ts: 0904-04-24 11:43:53.567\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4565 "17. vc 904-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 4 found: '-' in '904-04-24 11:43:53.567'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4566 "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
|
4567 "18. vc 74-04-24 11:43:53.567 to ts: 0074-04-24 11:43:53.567\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4568 "18. vc 74-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 3 found: '-' in '74-04-24 11:43:53.567'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4569 "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
|
4570 "19. vc 4-04-24 11:43:53.567 to ts: 0004-04-24 11:43:53.567\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4571 "19. vc 4-04-24 11:43:53.567 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 2 found: '-' in '4-04-24 11:43:53.567'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4572 "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
|
4573 "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
|
4574 "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
|
4575 "21. ts -4-04-24 11:43:53.567000 to dt: 0004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4576 "21. ts -4-04-24 11:43:53.567000 to LocalDateTime: rs.getObject(colnm, class<T>): Failed to convert to LocalDateTime: Text '-4-04-24T11:43:53.567000' could not be parsed at index 1\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4577 "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
|
4578 "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
|
4579 "22. ts -2004-04-24 11:43:53.567000 to dt: 2004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4580 "22. ts -2004-04-24 11:43:53.567000 to LocalDateTime: -2004-04-24T11:43:53.567\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4581 "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
|
4582 "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
|
4583 "23. d -4-04-24 to dt: 0004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4584 "23. d -4-04-24 to LocalDate: rs.getObject(colnm, class<T>): Failed to convert to LocalDate: Text '-4-04-24' could not be parsed at index 1\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4585 "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
|
4586 "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
|
4587 "24. d -3004-04-24 to dt: 3004-04-24\n" + |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4588 "24. d -3004-04-24 to LocalDate: -3004-04-24\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4589 "25. vc -2004-04-24 11:43:53.654321 to ts: 2004-04-24 11:43:53.654321\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4590 "25. vc -2004-04-24 11:43:53.654321 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 6 found: '-' in '-2004-04-24 11:43:53.654321'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4591 "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
|
4592 "26. vc -3004-04-24 to ts: 3004-04-24 00:00:00.0\n" + |
481
076abe23e8a3
Approve changed output.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
478
diff
changeset
|
4593 "26. vc -3004-04-24 to tm: rs.getTime(colnm) failed with error: parsing failed at pos 6 found: '-' in '-3004-04-24'\n" + |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4594 "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
|
4595 "0. true true\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4596 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4597 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4598 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
|
4599 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4600 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4601 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4602 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4603 // 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
|
4604 // 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
|
4605 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
|
4606 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4607 // 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
|
4608 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
|
4609 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
|
4610 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4611 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
|
4612 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4613 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4614 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4615 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4616 // 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
|
4617 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
|
4618 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
|
4619 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4620 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
|
4621 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4622 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4623 rs.clearWarnings(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4624 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4625 // 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
|
4626 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
|
4627 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
|
4628 } catch (SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4629 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
|
4630 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4631 readWarnings(rs.getWarnings()); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4632 rs.clearWarnings(); |
832
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4633 |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4634 // getObject(colnm, class<T>) may raise a conversion error |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4635 try { |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4636 switch(colnm) { |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4637 case "d": |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4638 sb.append(data).append("LocalDate: ").append(rs.getObject(colnm, java.time.LocalDate.class)).append("\n"); |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4639 break; |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4640 case "ts": |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4641 sb.append(data).append("LocalDateTime: ").append(rs.getObject(colnm, java.time.LocalDateTime.class)).append("\n"); |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4642 break; |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4643 case "t": |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4644 sb.append(data).append("LocalTime: ").append(rs.getObject(colnm, java.time.LocalTime.class)).append("\n"); |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4645 break; |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4646 } |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4647 } catch (SQLException e) { |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4648 sb.append("rs.getObject(colnm, class<T>): ").append(e.getMessage()).append("\n"); |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4649 } |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4650 readWarnings(rs.getWarnings()); |
7eb05cbf67dc
In ResultSet.getObject(column, Class<T> type) and ResultSet.getObject(column, Map<String,Class<?>>) methods added support to return objects for classes: java.time.LocalDate, java.time.LocalDateTime.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
827
diff
changeset
|
4651 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
|
4652 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4653 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4654 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
|
4655 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
|
4656 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4657 Statement stmt = null; |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4658 PreparedStatement pstmt = null; |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4659 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
|
4660 try { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4661 con.setAutoCommit(false); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4662 // >> 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
|
4663 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
|
4664 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4665 stmt = con.createStatement(); |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4666 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4667 sb.append("1. create..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4668 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
|
4669 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
|
4670 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4671 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4672 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4673 // for large batches of DML always set sys.optimizer = 'minimal_pipe'. It makes a big difference in performance. |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4674 stmt.execute("SET sys.optimizer = 'minimal_pipe'"); |
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
4675 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4676 // 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
|
4677 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
|
4678 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
|
4679 if (i % 1500 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4680 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
|
4681 int[] cnts = stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4682 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4683 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
|
4684 if (cnts.length != 1500) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4685 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
|
4686 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
|
4687 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
|
4688 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
|
4689 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4690 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
|
4691 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4692 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4693 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4694 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4695 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4696 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
|
4697 stmt.executeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4698 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4699 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4700 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4701 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
|
4702 // 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
|
4703 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
|
4704 pstmt.setInt(1, i); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4705 pstmt.addBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4706 if (i % 3000 == 0) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4707 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
|
4708 long[] cnts = pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4709 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4710 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
|
4711 if (cnts.length != 3000) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4712 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
|
4713 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
|
4714 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
|
4715 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
|
4716 if (cnts[j] != 1) |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4717 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
|
4718 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4719 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4720 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4721 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4722 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4723 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
|
4724 pstmt.executeLargeBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4725 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4726 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4727 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4728 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
|
4729 stmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4730 pstmt.clearBatch(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4731 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4732 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4733 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
|
4734 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
|
4735 rs.next(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4736 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
|
4737 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4738 sb.append("8. drop table..."); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4739 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
|
4740 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
|
4741 else |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4742 sb.append("passed\n"); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4743 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4744 // rs.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4745 stmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4746 pstmt.close(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4747 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4748 con.commit(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4749 con.setAutoCommit(true); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4750 // >> 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
|
4751 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
|
4752 } 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
|
4753 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
|
4754 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4755 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4756 closeStmtResSet(stmt, rs); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4757 closeStmtResSet(pstmt, null); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4758 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4759 compareExpectedOutput("Test_Sbatching", |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4760 "0. false false\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4761 "1. create...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4762 "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
|
4763 "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
|
4764 "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
|
4765 "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
|
4766 "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
|
4767 "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
|
4768 "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
|
4769 "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
|
4770 "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
|
4771 "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
|
4772 "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
|
4773 "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
|
4774 "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
|
4775 "8. drop table...passed\n" + |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4776 "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
|
4777 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4778 |
725
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4779 private void Test_SgeneratedKeys() { |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4780 sb.setLength(0); // clear the output log buffer |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4781 |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4782 Statement stmt = null; |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4783 ResultSet rsk = null; |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4784 try { |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4785 stmt = con.createStatement(); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4786 // test getGeneratedKeys |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4787 rsk = stmt.getGeneratedKeys(); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4788 // test meta data retrieval of this MonetVirtualResultSet. |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4789 // It used to fail with: Exception in thread "main" java.lang.IllegalArgumentException: Header may not be null! |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4790 final ResultSetMetaData rsmd = rsk.getMetaData(); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4791 sb.append("rsmd has ").append(rsmd.getColumnCount()).append(" columns\n"); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4792 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4793 sb.append("ColumnName: ").append(rsmd.getColumnName(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4794 .append(" ColumnTypeName: ").append(rsmd.getColumnTypeName(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4795 .append(" Precision: ").append(rsmd.getPrecision(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4796 .append(" Scale: ").append(rsmd.getScale(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4797 .append(" ColumnDisplaySize: ").append(rsmd.getColumnDisplaySize(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4798 .append(" ColumnType: ").append(rsmd.getColumnType(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4799 .append(" ColumnClassName: ").append(rsmd.getColumnClassName(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4800 .append(" isNullable: ").append(rsmd.isNullable(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4801 .append(" isAutoIncrement: ").append(rsmd.isAutoIncrement(col)) |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4802 .append("\n"); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4803 } |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4804 rsk.close(); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4805 rsk = null; |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4806 stmt.close(); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4807 stmt = null; |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4808 } catch (SQLException e) { |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4809 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4810 } |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4811 |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4812 closeStmtResSet(stmt, rsk); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4813 |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4814 compareExpectedOutput("Test_SgeneratedKeys", |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4815 "rsmd has 1 columns\n" + |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4816 "ColumnName: GENERATED_KEY ColumnTypeName: bigint Precision: 19 Scale: 0 ColumnDisplaySize: 20 ColumnType: -5 ColumnClassName: java.lang.Long isNullable: 2 isAutoIncrement: false\n"); |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4817 } |
224d73363dc9
Fixed issue when you create a new Statement, call getGeneratedKeys().getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
724
diff
changeset
|
4818 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4819 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
|
4820 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
|
4821 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4822 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
|
4823 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
|
4824 // >> 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
|
4825 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
|
4826 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4827 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
|
4828 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
|
4829 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
|
4830 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
|
4831 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
|
4832 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4833 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
|
4834 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
|
4835 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
|
4836 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
|
4837 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4838 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
|
4839 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
|
4840 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
|
4841 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
|
4842 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4843 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
|
4844 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
|
4845 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
|
4846 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
|
4847 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4848 } 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
|
4849 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
|
4850 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4851 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4852 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
|
4853 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4854 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
|
4855 "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
|
4856 "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
|
4857 "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
|
4858 "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
|
4859 "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
|
4860 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4861 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4862 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
|
4863 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
|
4864 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4865 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
|
4866 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
|
4867 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
|
4868 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
4869 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
|
4870 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4871 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
|
4872 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
|
4873 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
|
4874 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
|
4875 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4876 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
|
4877 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
|
4878 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
|
4879 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
|
4880 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
|
4881 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4882 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
|
4883 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
|
4884 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
|
4885 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
|
4886 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
|
4887 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4888 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
|
4889 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
|
4890 checkIsWrapperFor("ResultSetMetaData", rsmd, monetdb_jdbc_pkg, "MonetResultSet"); |
713
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4891 checkIsWrapperFor("ResultSetMetaData", rsmd, monetdb_jdbc_pkg, "MonetResultSetMetaData"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4892 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
|
4893 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
|
4894 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4895 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
|
4896 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4897 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
|
4898 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
|
4899 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
|
4900 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
|
4901 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
|
4902 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4903 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
|
4904 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4905 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
|
4906 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
|
4907 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
|
4908 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
|
4909 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
|
4910 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
|
4911 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
|
4912 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4913 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
|
4914 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
|
4915 checkIsWrapperFor("ParameterMetaData", pmd, monetdb_jdbc_pkg, "MonetPreparedStatement"); |
719
2f42195e9c58
Improved implementation of PreparedStatement.getParameterMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
717
diff
changeset
|
4916 checkIsWrapperFor("ParameterMetaData", pmd, monetdb_jdbc_pkg, "MonetParameterMetaData"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4917 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
|
4918 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
|
4919 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4920 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
|
4921 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
|
4922 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, monetdb_jdbc_pkg, "MonetPreparedStatement"); |
717
7240d2dd369f
Improved implementation of PreparedStatement.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
716
diff
changeset
|
4923 checkIsWrapperFor("PrepStmt ResultSetMetaData", psrsmd, monetdb_jdbc_pkg, "MonetResultSetMetaData"); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4924 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
|
4925 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
|
4926 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4927 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
|
4928 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4929 } 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
|
4930 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
|
4931 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
|
4932 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4933 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4934 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
|
4935 "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
|
4936 "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
|
4937 "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
|
4938 "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
|
4939 "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
|
4940 "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
|
4941 "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
|
4942 "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
|
4943 "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
|
4944 "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
|
4945 "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
|
4946 "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
|
4947 "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
|
4948 "ResultSetMetaData. isWrapperFor(MonetResultSet) returns: false\n" + |
713
c3c424a90a42
Improve implementation of ResultSet.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
711
diff
changeset
|
4949 "ResultSetMetaData. isWrapperFor(MonetResultSetMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4950 "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
|
4951 "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
|
4952 "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
|
4953 "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
|
4954 "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
|
4955 "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
|
4956 "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
|
4957 "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
|
4958 "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
|
4959 "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
|
4960 "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
|
4961 "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
|
4962 "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
|
4963 "ParameterMetaData. isWrapperFor(MonetPreparedStatement) returns: false\n" + |
719
2f42195e9c58
Improved implementation of PreparedStatement.getParameterMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
717
diff
changeset
|
4964 "ParameterMetaData. isWrapperFor(MonetParameterMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4965 "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
|
4966 "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
|
4967 "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
|
4968 "PrepStmt ResultSetMetaData. isWrapperFor(MonetPreparedStatement) returns: false\n" + |
717
7240d2dd369f
Improved implementation of PreparedStatement.getMetaData().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
716
diff
changeset
|
4969 "PrepStmt ResultSetMetaData. isWrapperFor(MonetResultSetMetaData) returns: true Called unwrap(). Returned object is not null, so oke\n" + |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4970 "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
|
4971 "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
|
4972 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4973 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4974 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
|
4975 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
|
4976 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
|
4977 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
|
4978 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
|
4979 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
|
4980 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
|
4981 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
|
4982 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4983 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
|
4984 } 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
|
4985 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
|
4986 } 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
|
4987 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
|
4988 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4989 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
4990 |
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
|
4991 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
|
4992 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
|
4993 |
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
|
4994 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
|
4995 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
|
4996 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
|
4997 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
|
4998 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
|
4999 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
|
5000 // 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
|
5001 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
|
5002 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
|
5003 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
|
5004 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
|
5005 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
|
5006 |
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
|
5007 // 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
|
5008 // 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
|
5009 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
|
5010 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
|
5011 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
|
5012 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
|
5013 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
|
5014 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
|
5015 |
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
|
5016 // 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
|
5017 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
|
5018 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
|
5019 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
|
5020 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
|
5021 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
|
5022 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
|
5023 |
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
|
5024 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
|
5025 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
|
5026 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
|
5027 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
|
5028 } |
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
|
5029 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
|
5030 |
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
|
5031 // 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
|
5032 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
|
5033 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
|
5034 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
|
5035 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
|
5036 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
|
5037 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
|
5038 |
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
|
5039 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
|
5040 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
|
5041 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
|
5042 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
|
5043 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
|
5044 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
|
5045 } 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
|
5046 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
|
5047 } |
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
|
5048 |
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
|
5049 // 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
|
5050 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
|
5051 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
|
5052 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
|
5053 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
|
5054 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
|
5055 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
|
5056 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
|
5057 } 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
|
5058 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
|
5059 } |
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
|
5060 |
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
|
5061 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
|
5062 |
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
|
5063 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
|
5064 "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
|
5065 "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
|
5066 "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
|
5067 "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
|
5068 "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
|
5069 "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
|
5070 "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
|
5071 } |
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
|
5072 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5073 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
|
5074 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
|
5075 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5076 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
|
5077 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
|
5078 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
|
5079 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
|
5080 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
|
5081 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
|
5082 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
|
5083 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
|
5084 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
|
5085 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
|
5086 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5087 // >> 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
|
5088 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
|
5089 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
|
5090 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
|
5091 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5092 // 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
|
5093 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
|
5094 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
|
5095 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
|
5096 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5097 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
|
5098 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
|
5099 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
|
5100 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
|
5101 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
|
5102 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5103 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
|
5104 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
|
5105 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
|
5106 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
|
5107 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
|
5108 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5109 // 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
|
5110 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
|
5111 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
|
5112 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
|
5113 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
|
5114 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
|
5115 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
|
5116 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
|
5117 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5118 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
|
5119 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
|
5120 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
|
5121 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
|
5122 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
|
5123 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5124 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
|
5125 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
|
5126 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
|
5127 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
|
5128 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
|
5129 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5130 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
|
5131 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
|
5132 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
|
5133 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
|
5134 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
|
5135 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5136 // 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
|
5137 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
|
5138 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
|
5139 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
|
5140 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
|
5141 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
|
5142 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
|
5143 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
|
5144 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5145 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
|
5146 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
|
5147 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
|
5148 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
|
5149 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
|
5150 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5151 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
|
5152 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
|
5153 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
|
5154 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
|
5155 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
|
5156 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5157 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
|
5158 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
|
5159 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
|
5160 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
|
5161 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
|
5162 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5163 // 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
|
5164 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
|
5165 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
|
5166 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
|
5167 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
|
5168 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
|
5169 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
|
5170 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
|
5171 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5172 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
|
5173 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
|
5174 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
|
5175 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
|
5176 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
|
5177 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5178 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
|
5179 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
|
5180 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
|
5181 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
|
5182 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
|
5183 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5184 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
|
5185 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
|
5186 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
|
5187 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
|
5188 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
|
5189 } 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
|
5190 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
|
5191 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5192 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5193 // 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
|
5194 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
|
5195 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
|
5196 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
|
5197 } 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
|
5198 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
|
5199 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5200 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5201 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
|
5202 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
|
5203 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
|
5204 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5205 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
|
5206 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
|
5207 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
|
5208 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5209 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
|
5210 "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
|
5211 "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
|
5212 "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
|
5213 "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
|
5214 "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
|
5215 "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
|
5216 "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
|
5217 "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
|
5218 "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
|
5219 "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
|
5220 "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
|
5221 "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
|
5222 "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
|
5223 "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
|
5224 "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
|
5225 "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
|
5226 "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
|
5227 "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
|
5228 "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
|
5229 "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
|
5230 "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
|
5231 "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
|
5232 "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
|
5233 "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
|
5234 "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
|
5235 "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
|
5236 "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
|
5237 "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
|
5238 "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
|
5239 "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
|
5240 "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
|
5241 "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
|
5242 "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
|
5243 "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
|
5244 "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
|
5245 "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
|
5246 "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
|
5247 "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
|
5248 "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
|
5249 "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
|
5250 "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
|
5251 "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
|
5252 "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
|
5253 "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
|
5254 "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
|
5255 "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
|
5256 "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
|
5257 "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
|
5258 "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
|
5259 "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
|
5260 "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
|
5261 "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
|
5262 "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
|
5263 "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
|
5264 "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
|
5265 "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
|
5266 "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
|
5267 "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
|
5268 "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
|
5269 "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
|
5270 "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
|
5271 "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
|
5272 "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
|
5273 "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
|
5274 "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
|
5275 "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
|
5276 "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
|
5277 "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
|
5278 "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
|
5279 "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
|
5280 "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
|
5281 "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
|
5282 "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
|
5283 "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
|
5284 "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
|
5285 "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
|
5286 "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
|
5287 "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
|
5288 "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
|
5289 "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
|
5290 "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
|
5291 "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
|
5292 "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
|
5293 "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
|
5294 "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
|
5295 "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
|
5296 "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
|
5297 "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
|
5298 "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
|
5299 "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
|
5300 "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
|
5301 "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
|
5302 "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
|
5303 "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
|
5304 "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
|
5305 "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
|
5306 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5307 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5308 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
|
5309 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
|
5310 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5311 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
|
5312 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
|
5313 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
|
5314 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
|
5315 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
|
5316 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
|
5317 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
|
5318 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
|
5319 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5320 // >> 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
|
5321 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
|
5322 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
|
5323 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5324 // 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
|
5325 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
|
5326 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
|
5327 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
|
5328 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5329 // 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
|
5330 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
|
5331 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
|
5332 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
|
5333 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5334 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
|
5335 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
|
5336 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
|
5337 |
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
|
5338 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
|
5339 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
|
5340 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5341 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
|
5342 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
|
5343 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
|
5344 } 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
|
5345 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
|
5346 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5347 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
|
5348 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
|
5349 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
|
5350 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5351 sb.append("2.1. check table status with client 1...\n"); |
593
f4181beae53d
Restored test to outputs before Jul2021, after fixing bug #7200
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
591
diff
changeset
|
5352 rs1 = stmt1.executeQuery("SELECT * FROM tconc_seq ORDER BY id"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5353 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
|
5354 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
|
5355 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
|
5356 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5357 sb.append("2.2. check table status with client 2...\n"); |
593
f4181beae53d
Restored test to outputs before Jul2021, after fixing bug #7200
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
591
diff
changeset
|
5358 rs2 = stmt2.executeQuery("SELECT * FROM tconc_seq ORDER BY id"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5359 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
|
5360 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
|
5361 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
|
5362 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5363 // 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
|
5364 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
|
5365 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
|
5366 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
|
5367 |
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
|
5368 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
|
5369 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
|
5370 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
|
5371 } 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
|
5372 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
|
5373 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5374 |
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
|
5375 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
|
5376 "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
|
5377 "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
|
5378 "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
|
5379 "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
|
5380 "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
|
5381 "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
|
5382 "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
|
5383 "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
|
5384 "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
|
5385 "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
|
5386 "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
|
5387 "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
|
5388 "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
|
5389 "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
|
5390 "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
|
5391 "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
|
5392 "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
|
5393 "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
|
5394 "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
|
5395 "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
|
5396 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
|
5397 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5398 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
|
5399 // 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
|
5400 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
|
5401 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
|
5402 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
|
5403 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
|
5404 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
|
5405 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
|
5406 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
|
5407 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
|
5408 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5409 // 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
|
5410 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
|
5411 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
|
5412 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
|
5413 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
|
5414 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
|
5415 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
|
5416 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
|
5417 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
|
5418 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5419 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
|
5420 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
|
5421 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
|
5422 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
|
5423 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
|
5424 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
|
5425 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
|
5426 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5427 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
|
5428 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5429 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
|
5430 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
|
5431 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
|
5432 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
|
5433 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
|
5434 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
|
5435 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
|
5436 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5437 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
|
5438 } 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
|
5439 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
|
5440 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5441 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5442 // 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
|
5443 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
|
5444 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
|
5445 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
|
5446 } 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
|
5447 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
|
5448 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5449 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5450 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
|
5451 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
|
5452 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5453 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
|
5454 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
|
5455 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5456 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
|
5457 "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
|
5458 "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
|
5459 "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
|
5460 "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
|
5461 "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
|
5462 "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
|
5463 "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
|
5464 "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
|
5465 "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
|
5466 "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
|
5467 "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
|
5468 "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
|
5469 "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
|
5470 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5471 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5472 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
|
5473 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
|
5474 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5475 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
|
5476 // 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
|
5477 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
|
5478 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
|
5479 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
|
5480 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
|
5481 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
|
5482 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
|
5483 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
|
5484 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
|
5485 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
|
5486 } 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
|
5487 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
|
5488 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5489 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5490 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
|
5491 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
|
5492 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
|
5493 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
|
5494 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
|
5495 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
|
5496 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5497 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
|
5498 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5499 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
|
5500 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
|
5501 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5502 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
|
5503 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
|
5504 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5505 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
|
5506 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
|
5507 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
|
5508 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
|
5509 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5510 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
|
5511 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
|
5512 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5513 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
|
5514 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
|
5515 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
|
5516 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5517 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
|
5518 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
|
5519 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
|
5520 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
|
5521 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
|
5522 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
|
5523 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5524 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
|
5525 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5526 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
|
5527 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5528 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
|
5529 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
|
5530 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
|
5531 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
|
5532 while (rs2.next()) { |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
5533 String tt = rs2.getString(1); |
647
8d7c75cc01e3
Adapt test for getTableTypes(). Filter out UNLOGGED TABLE value for stable output on all future and past MonetDB versions.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
646
diff
changeset
|
5534 // the STREAM TABLE type is REMOVED in post Oct2020 releases, so filter it out for a stable output on all releases |
8d7c75cc01e3
Adapt test for getTableTypes(). Filter out UNLOGGED TABLE value for stable output on all future and past MonetDB versions.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
646
diff
changeset
|
5535 // the UNLOGGED TABLE type is ADDED in post Jan2022 releases, so filter it out for a stable output on all releases |
8d7c75cc01e3
Adapt test for getTableTypes(). Filter out UNLOGGED TABLE value for stable output on all future and past MonetDB versions.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
646
diff
changeset
|
5536 if (! ("STREAM TABLE".equals(tt) || "UNLOGGED TABLE".equals(tt)) ) |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
5537 sb.append(tt).append("\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5538 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5539 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
|
5540 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5541 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
|
5542 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5543 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
|
5544 } 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
|
5545 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
|
5546 } 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
|
5547 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
|
5548 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
|
5549 } 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
|
5550 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
|
5551 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5552 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5553 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5554 // 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
|
5555 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
|
5556 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
|
5557 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
|
5558 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
|
5559 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
|
5560 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
|
5561 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
|
5562 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
|
5563 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
|
5564 } 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
|
5565 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
|
5566 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5567 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5568 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
|
5569 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
|
5570 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5571 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
|
5572 "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
|
5573 "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
|
5574 "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
|
5575 "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
|
5576 "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
|
5577 "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
|
5578 "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
|
5579 "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
|
5580 "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
|
5581 "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
|
5582 "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
|
5583 "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
|
5584 "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
|
5585 "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
|
5586 "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
|
5587 "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
|
5588 "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
|
5589 "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
|
5590 "_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
|
5591 "_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
|
5592 "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
|
5593 "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
|
5594 "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
|
5595 "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
|
5596 "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
|
5597 "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
|
5598 "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
|
5599 "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
|
5600 "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
|
5601 "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
|
5602 "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
|
5603 "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
|
5604 "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
|
5605 "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
|
5606 "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
|
5607 "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
|
5608 "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
|
5609 "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
|
5610 "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
|
5611 "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
|
5612 "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
|
5613 "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
|
5614 "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
|
5615 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5616 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5617 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
|
5618 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
|
5619 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5620 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
|
5621 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
|
5622 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
|
5623 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
|
5624 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
|
5625 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
|
5626 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
|
5627 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
|
5628 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
|
5629 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
|
5630 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
|
5631 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
|
5632 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
|
5633 } 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
|
5634 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
|
5635 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5636 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5637 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
|
5638 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5639 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
|
5640 "_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
|
5641 "_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
|
5642 "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
|
5643 "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
|
5644 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5645 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5646 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
|
5647 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
|
5648 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5649 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
|
5650 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
|
5651 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
|
5652 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
|
5653 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
|
5654 stmt1 = con.createStatement(); |
894
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5655 stmt1.executeUpdate("CREATE TABLE bug3561 (d decimal(7,4))"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5656 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5657 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
|
5658 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
|
5659 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
|
5660 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
|
5661 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
|
5662 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
|
5663 pst.executeUpdate(); |
894
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5664 pst.setBigDecimal(1, new BigDecimal(0.0/10000000)); // 0.0000 |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5665 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5666 pst.setBigDecimal(1, new BigDecimal(2.0/3)); // 0.666666667 |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5667 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5668 pst.setBigDecimal(1, new BigDecimal(11.0/7)); // 1.571428571 |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5669 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5670 // repeat for negative values |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5671 pst.setBigDecimal(1, new BigDecimal("-0112.125")); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5672 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5673 pst.setBigDecimal(1, new BigDecimal("-0212.12345")); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5674 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5675 pst.setBigDecimal(1, new BigDecimal("-0.012345")); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5676 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5677 pst.setBigDecimal(1, new BigDecimal(0.0/-10000000)); // 0.0000 |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5678 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5679 pst.setBigDecimal(1, new BigDecimal(-2.0/3)); // -0.666666667 |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5680 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5681 pst.setBigDecimal(1, new BigDecimal(-11.0/7)); // -1.571428571 |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5682 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5683 // check what happens if null is used |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5684 pst.setBigDecimal(1, null); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5685 pst.executeUpdate(); |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5686 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5687 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
|
5688 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5689 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
|
5690 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
|
5691 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
|
5692 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
|
5693 } 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
|
5694 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
|
5695 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5696 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
|
5697 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
|
5698 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5699 // 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
|
5700 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
|
5701 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
|
5702 } 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
|
5703 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
|
5704 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5705 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
|
5706 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5707 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
|
5708 "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
|
5709 "212.1235\n" + |
894
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5710 "0.0123\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5711 "0.0000\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5712 "0.6667\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5713 "1.5714\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5714 "-112.1250\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5715 "-212.1235\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5716 "-0.0123\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5717 "0.0000\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5718 "-0.6667\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5719 "-1.5714\n" + |
07a4998898a8
Improve and optimize PreparedStatement.setBigDecimal() implementation. It now checks on null input parameter to prevent NPE. Also removed code to trim leading zero's.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
888
diff
changeset
|
5720 "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
|
5721 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5722 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5723 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
|
5724 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
|
5725 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5726 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
|
5727 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
|
5728 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
|
5729 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
|
5730 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
|
5731 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
|
5732 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5733 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
|
5734 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
|
5735 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
|
5736 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5737 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
|
5738 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
|
5739 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
|
5740 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
|
5741 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
|
5742 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
|
5743 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
|
5744 } 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
|
5745 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
|
5746 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5747 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
|
5748 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5749 // 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
|
5750 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
|
5751 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
|
5752 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
|
5753 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
|
5754 } 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
|
5755 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
|
5756 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5757 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5758 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
|
5759 "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
|
5760 "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
|
5761 "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
|
5762 "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
|
5763 "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
|
5764 "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
|
5765 "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
|
5766 "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
|
5767 "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
|
5768 "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
|
5769 "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
|
5770 "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
|
5771 "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
|
5772 "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
|
5773 "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
|
5774 "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
|
5775 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5776 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5777 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
|
5778 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
|
5779 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
|
5780 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
|
5781 } 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
|
5782 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
|
5783 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5784 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5785 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
|
5786 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
|
5787 } 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
|
5788 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
|
5789 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5790 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5791 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5792 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
|
5793 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
|
5794 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5795 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
|
5796 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
|
5797 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
|
5798 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
|
5799 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
|
5800 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5801 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
|
5802 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
|
5803 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
|
5804 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
|
5805 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5806 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
|
5807 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5808 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
|
5809 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
|
5810 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5811 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
|
5812 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
|
5813 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
|
5814 |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
5815 st.setQueryTimeout(7); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5816 con.isValid(3); |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
5817 sb.append("getQueryTimeout must give 7: ").append(st.getQueryTimeout()).append("\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5818 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
|
5819 } 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
|
5820 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
|
5821 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5822 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
|
5823 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
|
5824 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5825 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
|
5826 "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
|
5827 "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
|
5828 "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
|
5829 "getQueryTimeout must give 0: 0\n" + |
488
59309e3e6daa
Speed up Test_Sbatching() by including: SET sys.optimizer = 'minimal_pipe'
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
481
diff
changeset
|
5830 "getQueryTimeout must give 7: 7\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5831 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5832 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5833 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
|
5834 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
|
5835 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5836 // 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
|
5837 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
|
5838 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
|
5839 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
|
5840 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
|
5841 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
|
5842 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
|
5843 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
|
5844 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
|
5845 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5846 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
|
5847 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
|
5848 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
|
5849 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
|
5850 // 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
|
5851 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
|
5852 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
|
5853 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
|
5854 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
|
5855 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
|
5856 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
|
5857 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
|
5858 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
|
5859 } 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
|
5860 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
|
5861 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5862 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
|
5863 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5864 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
|
5865 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
|
5866 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
|
5867 } 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
|
5868 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
|
5869 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5870 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5871 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
|
5872 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
|
5873 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
|
5874 } 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
|
5875 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
|
5876 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5877 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5878 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
|
5879 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5880 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
|
5881 "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
|
5882 "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
|
5883 "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
|
5884 "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
|
5885 "Completed first test\n" + |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
5886 "Second test repeat 10 times. Iteration: 1 2 3 4 5 6 7 8 9 10 \n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5887 "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
|
5888 "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
|
5889 "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
|
5890 "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
|
5891 "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
|
5892 "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
|
5893 "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
|
5894 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5895 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5896 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
|
5897 String script = |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
5898 "delete from " + tbl_nm + " where attribute='activeset_default_fiets';\n" + |
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
5899 "insert into " + tbl_nm + " values ('activeset_default_fiets', '" + largedata + "');\n" + |
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
5900 "insert into " + tbl_nm + " values ('activeset_default_fiets', '" + largedata + "');\n" + |
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
5901 "insert into " + tbl_nm + " values ('activeset_default_fiets', '" + largedata + "');\n" + |
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
5902 "select value from " + tbl_nm + " where attribute='activeset_default_fiets';\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
|
5903 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
|
5904 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5905 // 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
|
5906 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
|
5907 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
|
5908 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
|
5909 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
|
5910 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
|
5911 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
|
5912 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
|
5913 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5914 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5915 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
|
5916 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5917 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
|
5918 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5919 // 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
|
5920 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
|
5921 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
|
5922 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
|
5923 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
|
5924 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
|
5925 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
|
5926 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
|
5927 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
|
5928 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
|
5929 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
|
5930 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5931 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5932 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5933 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
|
5934 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
|
5935 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5936 // 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
|
5937 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
|
5938 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
|
5939 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
|
5940 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
|
5941 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
|
5942 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
|
5943 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
|
5944 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
|
5945 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
|
5946 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
|
5947 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
|
5948 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
|
5949 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
|
5950 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
|
5951 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5952 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5953 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
|
5954 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
5955 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
|
5956 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5957 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5958 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
|
5959 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
|
5960 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
|
5961 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
|
5962 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
|
5963 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
|
5964 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
|
5965 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
|
5966 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
|
5967 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
|
5968 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
|
5969 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
|
5970 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
|
5971 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5972 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
|
5973 } 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
|
5974 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
|
5975 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
|
5976 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
|
5977 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5978 } 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
|
5979 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5980 /* 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
|
5981 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
|
5982 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
|
5983 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
|
5984 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
|
5985 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
|
5986 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
|
5987 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5988 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5989 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
|
5990 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
|
5991 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
5992 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
|
5993 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
|
5994 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
|
5995 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
|
5996 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
|
5997 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
|
5998 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
|
5999 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
|
6000 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
|
6001 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6002 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
|
6003 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
|
6004 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
|
6005 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
|
6006 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
|
6007 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6008 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
|
6009 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
|
6010 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
|
6011 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
|
6012 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6013 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
|
6014 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
|
6015 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
|
6016 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
|
6017 } 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
|
6018 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
|
6019 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6020 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6021 // 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
|
6022 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
|
6023 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
|
6024 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
|
6025 } 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
|
6026 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
|
6027 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6028 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
|
6029 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
|
6030 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6031 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
|
6032 "0. true true\n" + |
871
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
6033 "Prepared Query has 1 parameters. Type of first is: " + (isPostDec2023 ? "varchar" : "clob") + "\n" + |
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
6034 "Prepared Query has 3 columns. Type of first is: " + (isPostDec2023 ? "varchar" : "clob") + "\n" + |
16aea99c987f
Adjust JDBC_API_Tester to accept new behavior of returning a varchar instead of clob or char as metadata. This new behavior applies to MonetDB servers 11.50 or higher.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
870
diff
changeset
|
6035 "Query ResultSet has 3 columns. Type of first is: " + (isPostDec2023 ? "varchar" : "clob") + "\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
|
6036 "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
|
6037 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6038 |
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
|
6039 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
|
6040 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
|
6041 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6042 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
|
6043 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
|
6044 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
|
6045 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
|
6046 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
|
6047 // >> 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
|
6048 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
|
6049 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6050 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
|
6051 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
|
6052 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
|
6053 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
|
6054 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6055 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
|
6056 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
|
6057 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
|
6058 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
|
6059 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
|
6060 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
|
6061 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
|
6062 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
|
6063 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
|
6064 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
|
6065 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6066 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
|
6067 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
|
6068 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
|
6069 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
|
6070 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
|
6071 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
|
6072 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
|
6073 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6074 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6075 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
|
6076 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
|
6077 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
|
6078 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
|
6079 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
|
6080 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
|
6081 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
|
6082 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
|
6083 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
|
6084 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
|
6085 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6086 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
|
6087 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
|
6088 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
|
6089 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
|
6090 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
|
6091 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
|
6092 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
|
6093 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
|
6094 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6095 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
|
6096 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
|
6097 pstmt.setString(2, "row " + row); |
494
56f24eb8ca43
Use valid json
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
488
diff
changeset
|
6098 pstmt.setObject(3, "[3.1415E-06]"); |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6099 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
|
6100 try { |
769
b6d113ee35ae
Fixed javac version 20 compiler warnings.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
764
diff
changeset
|
6101 pstmt.setURL(5, new java.net.URI("https://www.cwi.nl/").toURL()); |
b6d113ee35ae
Fixed javac version 20 compiler warnings.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
764
diff
changeset
|
6102 } catch (java.net.URISyntaxException | java.net.MalformedURLException mfe) { |
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
|
6103 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
|
6104 } |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6105 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
|
6106 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
|
6107 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
|
6108 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6109 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
|
6110 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
|
6111 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
|
6112 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
|
6113 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
|
6114 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
|
6115 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
|
6116 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
|
6117 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6118 /* 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
|
6119 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
|
6120 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
|
6121 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
|
6122 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
|
6123 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
|
6124 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
|
6125 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
|
6126 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
|
6127 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
|
6128 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
|
6129 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6130 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
|
6131 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
|
6132 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
|
6133 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
|
6134 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
|
6135 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
|
6136 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
|
6137 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
|
6138 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
|
6139 } 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
|
6140 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
|
6141 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6142 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
|
6143 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
|
6144 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
|
6145 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
|
6146 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
|
6147 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
|
6148 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6149 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
|
6150 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
|
6151 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
|
6152 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
|
6153 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
|
6154 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
|
6155 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
|
6156 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
|
6157 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
|
6158 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
|
6159 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6160 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
|
6161 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6162 } 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
|
6163 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
|
6164 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6165 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6166 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
|
6167 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
|
6168 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
|
6169 } 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
|
6170 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
|
6171 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6172 |
437
1333c19b0c1b
include missing )
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
436
diff
changeset
|
6173 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
|
6174 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
|
6175 |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6176 compareExpectedOutput("Bug_PrepStmtSetString_6382", |
782
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6177 /* servers Jun2023 (11.47) and older stored JSON string values as provided */ |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6178 (dbmsMajorVersion == 11 && dbmsMinorVersion <= 47) ? |
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
|
6179 "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
|
6180 "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
|
6181 "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
|
6182 "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
|
6183 "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
|
6184 " 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
|
6185 " 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
|
6186 " 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
|
6187 " 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
|
6188 " 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
|
6189 " 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
|
6190 "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
|
6191 "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
|
6192 "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
|
6193 "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
|
6194 "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
|
6195 "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
|
6196 "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
|
6197 "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
|
6198 "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
|
6199 "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
|
6200 "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
|
6201 "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
|
6202 "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
|
6203 "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
|
6204 "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
|
6205 "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
|
6206 "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
|
6207 "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
|
6208 "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
|
6209 "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
|
6210 " \"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
|
6211 " \"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
|
6212 " \"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
|
6213 " \"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
|
6214 " {\"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
|
6215 " {\"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
|
6216 " {\"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
|
6217 " ]\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
|
6218 " }\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
|
6219 "}} 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
|
6220 "row 7 7 row 7 null 4a148b7d-8d47-4e1e-a21e-09a71abf2215 null null\n" + |
494
56f24eb8ca43
Use valid json
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
488
diff
changeset
|
6221 "row 8 8 row 8 [3.1415E-06] null https://www.cwi.nl/ null\n" + |
56f24eb8ca43
Use valid json
Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
parents:
488
diff
changeset
|
6222 "row 9 9 row 9 [3.1415E-06] null null 127.255.255.255\n" + |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6223 "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
|
6224 " \"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
|
6225 " \"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
|
6226 " {\"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
|
6227 " {\"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
|
6228 " 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
|
6229 " {\"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
|
6230 " {\"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
|
6231 " {\"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
|
6232 " 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
|
6233 " {\"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
|
6234 " {\"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
|
6235 " {\"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
|
6236 " 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
|
6237 " {\"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
|
6238 " {\"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
|
6239 " ]\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
|
6240 "}}] 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
|
6241 "row 11 11 row 11 null ff125769-b63c-4c3c-859f-5b84a9349e24 https://en.wikipedia.org/wiki/IP_address 223.234.245.255\n" + |
782
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6242 "Cleanup TABLE PrepStmtSetString_6382\n" |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6243 : /* for servers 11.48 and higher, JSON string values are stored in optimized form (without whitespace characters) */ |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6244 "0. true true\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6245 "1. Creating table PrepStmtSetString_6382\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6246 "2. Insert row 1, 2, 3, 4, 5\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6247 "Creating a prepared statement with 6 parameters and inserting rows using setInt(), setString(), setNull(), setNString(), setURL(), setObject().\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6248 "Prepared Statement has 6 parameters:\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6249 " Parameter 1 type is: int. JDBC SQL type: 4\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6250 " Parameter 2 type is: varchar. JDBC SQL type: 12\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6251 " Parameter 3 type is: json. JDBC SQL type: 12\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6252 " Parameter 4 type is: uuid. JDBC SQL type: 12\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6253 " Parameter 5 type is: url. JDBC SQL type: 12\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6254 " Parameter 6 type is: inet. JDBC SQL type: 12\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6255 "Inserting row 6\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6256 "Inserted 1 row\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6257 "Inserting row 7\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6258 "Inserted 1 row\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6259 "Inserting row 8\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6260 "Inserted 1 row\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6261 "Inserting row 9\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6262 "Inserted 1 row\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6263 "Inserting row 10\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6264 "Inserted 1 row\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6265 "Inserting row 11\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6266 "Inserted 1 row\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6267 "List contents of TABLE PrepStmtSetString_6382 after 11 rows inserted\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6268 "Query has 6 output columns.\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6269 "row 1 1 row 1 {} 34c8deb5-e608-406b-beda-6a951f73d455 https://www.monetdb.org/ 128.0.0.1\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6270 "row 2 2 row 2 [] null null null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6271 "row 3 3 row 3 \"abc\" null null null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6272 "row 4 4 row 4 true null null null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6273 "row 5 5 row 5 -0.123 null null null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6274 "row 6 6 row 6 {\"menu\":{\"id\":\"file\",\"value\":\"File\",\"popup\":{\"menuitem\":[{\"value\":\"New\",\"onclick\":\"CreateNewDoc()\"},{\"value\":\"Open\",\"onclick\":\"OpenDoc()\"},{\"value\":\"Close\",\"onclick\":\"CloseDoc()\"}]}}} null null null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6275 "row 7 7 row 7 null 4a148b7d-8d47-4e1e-a21e-09a71abf2215 null null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6276 "row 8 8 row 8 [3.1415E-06] null https://www.cwi.nl/ null\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6277 "row 9 9 row 9 [3.1415E-06] null null 127.255.255.255\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6278 "row 10 10 row 10 [{\"menu\":{\"header\":\"SVG Viewer\",\"items\":[{\"id\":\"Open\"},{\"id\":\"OpenNew\",\"label\":\"Open New\"},null,{\"id\":\"ZoomIn\",\"label\":\"Zoom In\"},{\"id\":\"ZoomOut\",\"label\":\"Zoom Out\"},{\"id\":\"OriginalView\",\"label\":\"Original View\"},null,{\"id\":\"Quality\"},{\"id\":\"Pause\"},{\"id\":\"Mute\"},null,{\"id\":\"Help\"},{\"id\":\"About\",\"label\":\"About Adobe CVG Viewer...\"}]}}] b39dc76e-4faf-4fd9-bc1e-17df48acf764 https://en.wikipedia.org/wiki/IP_address 223.255.255.255\n" + |
e234659cfd61
Adapt expected output of Bug_PrepStmtSetString_6382() for servers 11.48 and higher which store JSON string values in optimized form (without whitespace characters).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
769
diff
changeset
|
6279 "row 11 11 row 11 null ff125769-b63c-4c3c-859f-5b84a9349e24 https://en.wikipedia.org/wiki/IP_address 223.234.245.255\n" + |
436
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6280 "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
|
6281 } |
b32946647c77
Extended PreparedStatement.setString() json string validity test for json parameters to now also accept: numbers (with optional fractions and exponent), string literals between double quotes, and keywords: true, false and null.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
427
diff
changeset
|
6282 |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6283 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
|
6284 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
|
6285 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6286 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
|
6287 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
|
6288 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
|
6289 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
|
6290 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
|
6291 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
|
6292 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6293 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
|
6294 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
|
6295 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
|
6296 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
|
6297 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6298 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
|
6299 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6300 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
|
6301 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
|
6302 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
|
6303 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
|
6304 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
|
6305 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
|
6306 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
|
6307 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
|
6308 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6309 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
|
6310 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
|
6311 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
|
6312 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6313 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
|
6314 } 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
|
6315 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
|
6316 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
|
6317 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
|
6318 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6319 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6320 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
|
6321 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
|
6322 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
|
6323 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
|
6324 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6325 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
|
6326 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
|
6327 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
|
6328 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
|
6329 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6330 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
|
6331 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
|
6332 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
|
6333 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
|
6334 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
|
6335 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
|
6336 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6337 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
|
6338 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
|
6339 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6340 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
|
6341 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
|
6342 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
|
6343 } |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6344 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
|
6345 } 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
|
6346 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
|
6347 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
|
6348 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
|
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
|
6350 } 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
|
6351 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
|
6352 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6353 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6354 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
|
6355 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
|
6356 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
|
6357 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
|
6358 } 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
|
6359 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
|
6360 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6361 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6362 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
|
6363 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
|
6364 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6365 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
|
6366 "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
|
6367 "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
|
6368 "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
|
6369 "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
|
6370 "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
|
6371 "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
|
6372 "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
|
6373 "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
|
6374 "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
|
6375 "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
|
6376 "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
|
6377 "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
|
6378 "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
|
6379 "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
|
6380 "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
|
6381 "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
|
6382 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6383 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6384 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
|
6385 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
|
6386 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6387 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
|
6388 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
|
6389 , "\"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
|
6390 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
|
6391 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
|
6392 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
|
6393 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
|
6394 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
|
6395 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
|
6396 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
|
6397 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
|
6398 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
|
6399 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
|
6400 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6401 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
|
6402 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6403 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
|
6404 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
|
6405 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
|
6406 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
|
6407 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
|
6408 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6409 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
|
6410 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
|
6411 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
|
6412 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
|
6413 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6414 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
|
6415 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
|
6416 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
|
6417 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
|
6418 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
|
6419 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
|
6420 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
|
6421 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
|
6422 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
|
6423 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6424 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
|
6425 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
|
6426 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
|
6427 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
|
6428 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6429 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
|
6430 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
|
6431 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
|
6432 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
|
6433 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
|
6434 // 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
|
6435 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
|
6436 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
|
6437 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
|
6438 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
|
6439 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6440 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
|
6441 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
|
6442 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
|
6443 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
|
6444 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6445 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
|
6446 "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
|
6447 "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
|
6448 "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
|
6449 " 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
|
6450 "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
|
6451 "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
|
6452 "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
|
6453 "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
|
6454 "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
|
6455 "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
|
6456 "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
|
6457 "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
|
6458 "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
|
6459 "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
|
6460 "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
|
6461 "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
|
6462 "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
|
6463 "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
|
6464 "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
|
6465 "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
|
6466 "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
|
6467 "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
|
6468 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
|
6469 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6470 // 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
|
6471 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
|
6472 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
|
6473 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
|
6474 "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
|
6475 "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
|
6476 " 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
|
6477 "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
|
6478 "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
|
6479 "\"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
|
6480 "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
|
6481 "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
|
6482 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
|
6483 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6484 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
|
6485 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
|
6486 "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
|
6487 "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
|
6488 " 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
|
6489 "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
|
6490 "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
|
6491 "\"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
|
6492 "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
|
6493 "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
|
6494 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
|
6495 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6496 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
|
6497 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
|
6498 "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
|
6499 "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
|
6500 " 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
|
6501 "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
|
6502 "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
|
6503 "\"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
|
6504 "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
|
6505 "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
|
6506 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
|
6507 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6508 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
|
6509 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
|
6510 "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
|
6511 "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
|
6512 " 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
|
6513 "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
|
6514 "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
|
6515 "\"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
|
6516 "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
|
6517 "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
|
6518 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
|
6519 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6520 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
|
6521 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
|
6522 "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
|
6523 "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
|
6524 " 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
|
6525 "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
|
6526 "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
|
6527 "\"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
|
6528 "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
|
6529 "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
|
6530 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
|
6531 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6532 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
|
6533 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
|
6534 "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
|
6535 "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
|
6536 " 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
|
6537 "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
|
6538 "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
|
6539 "\"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
|
6540 "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
|
6541 "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
|
6542 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
|
6543 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6544 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
|
6545 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
|
6546 "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
|
6547 "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
|
6548 " 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
|
6549 "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
|
6550 "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
|
6551 "\"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
|
6552 "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
|
6553 "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
|
6554 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
|
6555 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6556 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
|
6557 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
|
6558 "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
|
6559 "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
|
6560 " 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
|
6561 "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
|
6562 "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
|
6563 "\"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
|
6564 "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
|
6565 "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
|
6566 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
|
6567 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6568 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
|
6569 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
|
6570 "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
|
6571 "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
|
6572 " 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
|
6573 "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
|
6574 "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
|
6575 "\"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
|
6576 "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
|
6577 "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
|
6578 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
|
6579 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6580 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
|
6581 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
|
6582 "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
|
6583 "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
|
6584 " 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
|
6585 "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
|
6586 "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
|
6587 "\" \"\n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6588 " \n" + |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6589 "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
|
6590 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
|
6591 n++; |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6592 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
|
6593 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
|
6594 "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
|
6595 "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
|
6596 " 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
|
6597 "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
|
6598 "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
|
6599 "\"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
|
6600 "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
|
6601 "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
|
6602 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
|
6603 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6604 // 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
|
6605 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
|
6606 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
|
6607 "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
|
6608 "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
|
6609 " 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
|
6610 "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
|
6611 "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
|
6612 "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
|
6613 "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
|
6614 "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
|
6615 "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
|
6616 "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
|
6617 "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
|
6618 "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
|
6619 "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
|
6620 "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
|
6621 "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
|
6622 "\"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
|
6623 "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
|
6624 "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
|
6625 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
|
6626 } 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
|
6627 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
|
6628 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6629 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6630 // 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
|
6631 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
|
6632 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
|
6633 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
|
6634 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
|
6635 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
|
6636 } 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
|
6637 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
|
6638 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6639 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6640 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
|
6641 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6642 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
|
6643 "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
|
6644 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6645 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6646 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
|
6647 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
|
6648 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
|
6649 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
|
6650 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6651 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6652 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
|
6653 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
|
6654 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
|
6655 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
|
6656 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
|
6657 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
|
6658 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
|
6659 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6660 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6661 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
|
6662 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
|
6663 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
|
6664 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
|
6665 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
|
6666 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
|
6667 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
|
6668 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
|
6669 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6670 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
|
6671 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6672 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
|
6673 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
|
6674 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6675 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6676 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
|
6677 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
|
6678 |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6679 int originalQueryTimeout = 0; |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6680 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
|
6681 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
|
6682 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
|
6683 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
|
6684 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
|
6685 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6686 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
|
6687 testTimeout_3357(st, 123456); |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6688 testTimeout_3357(st, 2147483); |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6689 testTimeout_3357(st, 2147484); |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6690 testTimeout_3357(st, Integer.MAX_VALUE); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6691 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
|
6692 testTimeout_3357(st, 10); |
752
9cceb0d73a66
Enlarge timeout test from 1 to 4 seconds to prevent potential differences reported on testweb for slow (MS windows) platforms.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
749
diff
changeset
|
6693 testTimeout_3357(st, 4); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6694 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
|
6695 } catch (SQLException se) { |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6696 sb.append("SQLException: setQueryTimeout(timeout_value) throws: ").append(se).append("\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6697 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6698 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6699 // 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
|
6700 try { |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6701 sb.append("Restore original QueryTimeout = ").append(originalQueryTimeout).append("\n"); |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6702 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
|
6703 } 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
|
6704 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
|
6705 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6706 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
|
6707 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6708 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
|
6709 "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
|
6710 "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
|
6711 "setQueryTimeout = 123456. getQueryTimeout = 123456\n" + |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6712 "setQueryTimeout = 2147483. getQueryTimeout = 2147483\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6713 "setQueryTimeout = 2147484. getQueryTimeout = 2147484\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6714 "setQueryTimeout = 2147483647. getQueryTimeout = 2147483647\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6715 "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
|
6716 "setQueryTimeout = 10. getQueryTimeout = 10\n" + |
752
9cceb0d73a66
Enlarge timeout test from 1 to 4 seconds to prevent potential differences reported on testweb for slow (MS windows) platforms.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
749
diff
changeset
|
6717 "setQueryTimeout = 4. getQueryTimeout = 4\n" + |
650
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6718 "setQueryTimeout = -1. SQLException: setQueryTimeout(timeout_value) throws: java.sql.SQLException: Illegal timeout value: -1\n" + |
849f99124e32
Correcting implementation of Statement.setQueryTimeout(int seconds).
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
649
diff
changeset
|
6719 "Restore original QueryTimeout = 0\n" + |
446
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6720 "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
|
6721 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6722 |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6723 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
|
6724 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
|
6725 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
|
6726 // 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
|
6727 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
|
6728 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
|
6729 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
|
6730 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
|
6731 } |
1ae0dc05bce5
Converted 12 more JDBC tests from Bug*.java into "output on exception only" tests and included them into JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
437
diff
changeset
|
6732 |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6733 private void Bug_PrepStmtManyParams_7337(int nrParams) { |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6734 sb.setLength(0); // clear the output log buffer |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6735 |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6736 final int NR_COLUMNS = nrParams; |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6737 final StringBuilder sql = new StringBuilder(100 + (NR_COLUMNS * 25)); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6738 |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6739 int col; |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6740 Statement stmt = null; |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6741 try { |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6742 stmt = con.createStatement(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6743 sb.append("0. fetch size of new statement: ").append(stmt.getFetchSize()).append("\n"); |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6744 |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6745 // construct the Create Table SQL text |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6746 sql.append("CREATE TABLE t7337 (ID BIGINT AUTO_INCREMENT PRIMARY KEY, "); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6747 for (col = 1; col <= NR_COLUMNS; col++) { |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6748 sql.append("column").append(col).append(" VARCHAR(256),"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6749 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6750 sql.append("column").append(col).append(" TIMESTAMP);"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6751 |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6752 sb.append("1. create table with ").append(NR_COLUMNS+2).append(" columns, sql has length: ").append(sql.length()).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6753 int ret = stmt.executeUpdate(sql.toString()); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6754 sb.append("2. table created. ret = ").append(ret).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6755 stmt.close(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6756 stmt = null; |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6757 } catch (SQLException e) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6758 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6759 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6760 closeStmtResSet(stmt, null); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6761 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6762 // test: PREPARE INSERT INTO with many parameters |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6763 PreparedStatement pstmt = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6764 try { |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6765 // construct the Insert Into Table SQL text, first without any parameter makers |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6766 sql.setLength(0); // clear the sql buffer |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6767 sql.append("INSERT INTO t7337 \n("); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6768 for (col = 1; col <= NR_COLUMNS; col++) { |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6769 sql.append("column").append(col).append(","); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6770 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6771 sql.append("column").append(col).append(" ) VALUES \n("); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6772 int posFirstPart = sql.length(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6773 for (col = 1; col <= NR_COLUMNS; col++) { |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6774 sql.append("'someTextHere',"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6775 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6776 sql.append("'2022-11-11');"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6777 |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6778 sb.append("3. prepare insert statement (no params), sql has length: ").append(sql.length()).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6779 pstmt = con.prepareStatement(sql.toString()); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6780 if (pstmt != null) { |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6781 sb.append(" fetch size after prepare 1: ").append(pstmt.getFetchSize()).append("\n"); |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6782 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6783 sb.append(" pmd. ").append(pmd.getParameterCount()).append(" parameters\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6784 sb.append("4. execute prepared insert\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6785 int inserted = pstmt.executeUpdate(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6786 sb.append("5. first execute returned: ").append(inserted).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6787 // do it one more time |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6788 inserted = pstmt.executeUpdate(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6789 sb.append("5. second execute returned: ").append(inserted).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6790 sb.append("6. inserted data committed\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6791 pstmt.close(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6792 pstmt = null; |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6793 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6794 |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6795 // construct the Insert Into Table SQL text, now with parameter makers |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6796 sql.setLength(posFirstPart); // clear the sql part after the: VALUES ( |
695
a5b840eebf77
Use nrParams when working with Parameters.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
694
diff
changeset
|
6797 for (col = 1; col <= nrParams; col++) { |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6798 sql.append("?,"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6799 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6800 sql.append("'2022-11-16');"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6801 |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6802 sb.append("7. prepare insert statement (with params), sql has length: ").append(sql.length()).append("\n"); |
691
fb55e62c50f3
Fixed an invalid error issue when a PreparedStatement had more than 250 parameters.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
689
diff
changeset
|
6803 pstmt = con.prepareStatement(sql.toString()); |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6804 if (pstmt != null) { |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6805 sb.append(" fetch size after prepare 2: ").append(pstmt.getFetchSize()).append("\n"); |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6806 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6807 sb.append(" pmd. ").append(pmd.getParameterCount()).append(" parameters\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6808 sb.append("8. bind parameters\n"); |
695
a5b840eebf77
Use nrParams when working with Parameters.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
694
diff
changeset
|
6809 for (col = 1; col <= nrParams; col++) { |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6810 pstmt.setString(col, "someMoreText"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6811 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6812 sb.append("9. execute prepared insert with parameters\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6813 int inserted = pstmt.executeUpdate(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6814 sb.append("10. first execute returned: ").append(inserted).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6815 // do it one more time |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6816 inserted = pstmt.executeUpdate(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6817 sb.append("10. second execute returned: ").append(inserted).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6818 sb.append("11. inserted data committed\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6819 pstmt.close(); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6820 pstmt = null; |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6821 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6822 } catch (SQLException e) { |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6823 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6824 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6825 closeStmtResSet(pstmt, null); |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6826 |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6827 compareExpectedOutput("Bug_PrepStmtManyParams_7337(" + nrParams + ")", |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6828 "0. fetch size of new statement: 250\n" + |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6829 "1. create table with " + (NR_COLUMNS+2) + " columns, sql has length: " + ((NR_COLUMNS * 23) -29) + "\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6830 "2. table created. ret = -2\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6831 "3. prepare insert statement (no params), sql has length: " + ((NR_COLUMNS * 25) -53) + "\n" + |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6832 " fetch size after prepare 1: 250\n" + |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6833 " pmd. 0 parameters\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6834 "4. execute prepared insert\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6835 "5. first execute returned: 1\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6836 "5. second execute returned: 1\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6837 "6. inserted data committed\n" + |
695
a5b840eebf77
Use nrParams when working with Parameters.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
694
diff
changeset
|
6838 "7. prepare insert statement (with params), sql has length: " + ((nrParams * 12) -53) + "\n" + |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6839 " fetch size after prepare 2: 250\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6840 " pmd. " + nrParams + " parameters\n" + |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6841 "8. bind parameters\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6842 "9. execute prepared insert with parameters\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6843 "10. first execute returned: 1\n" + |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6844 "10. second execute returned: 1\n" + |
691
fb55e62c50f3
Fixed an invalid error issue when a PreparedStatement had more than 250 parameters.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
689
diff
changeset
|
6845 "11. inserted data committed\n"); |
711
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6846 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6847 // test also: PREPARE SELECT * FROM .. without and with many parameters |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6848 sb.setLength(0); // clear the output log buffer |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6849 ResultSet rs = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6850 try { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6851 // construct the Select SQL text, first without any parameter makers |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6852 sql.setLength(0); // clear the sql buffer |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6853 sql.append("SELECT * FROM t7337"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6854 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6855 sb.append("12. prepare select statement (no params), sql has length: ").append(sql.length()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6856 pstmt = con.prepareStatement(sql.toString()); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6857 if (pstmt != null) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6858 sb.append(" fetch size after prepare 3: ").append(pstmt.getFetchSize()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6859 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6860 sb.append(" pmd. ").append(pmd.getParameterCount()).append(" parameters\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6861 ResultSetMetaData rsmd = pstmt.getMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6862 sb.append(" rsmd. ").append(rsmd.getColumnCount()).append(" result columns\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6863 sb.append("13. execute prepared select\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6864 rs = pstmt.executeQuery(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6865 if (rs != null) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6866 rsmd = rs.getMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6867 sb.append("14. first query execute succeeded. it has ").append(rsmd.getColumnCount()).append(" result columns\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6868 rs.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6869 rs = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6870 } else { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6871 sb.append("14. first query execute failed to return a result\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6872 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6873 // do it one more time |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6874 rs = pstmt.executeQuery(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6875 if (rs != null) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6876 rsmd = rs.getMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6877 sb.append("15. second query execute succeeded. it has ").append(rsmd.getColumnCount()).append(" result columns\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6878 rs.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6879 rs = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6880 } else { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6881 sb.append("15. second query execute failed to return a result\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6882 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6883 pstmt.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6884 pstmt = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6885 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6886 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6887 // add the WHERE part with many parameter makers |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6888 sql.append(" WHERE "); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6889 for (col = 1; col <= NR_COLUMNS; col++) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6890 sql.append("column").append(col).append(" = ? AND "); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6891 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6892 sql.append("column").append(col).append(" = '2022-11-16'"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6893 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6894 sb.append("16. prepare select statement (with params), sql has length: ").append(sql.length()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6895 pstmt = con.prepareStatement(sql.toString()); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6896 if (pstmt != null) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6897 sb.append(" fetch size after prepare 4: ").append(pstmt.getFetchSize()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6898 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6899 sb.append(" pmd. ").append(pmd.getParameterCount()).append(" parameters\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6900 ResultSetMetaData rsmd = pstmt.getMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6901 sb.append(" rsmd. ").append(rsmd.getColumnCount()).append(" result columns\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6902 sb.append("17. bind parameters\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6903 for (col = 1; col <= nrParams; col++) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6904 pstmt.setString(col, "someMoreText"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6905 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6906 sb.append("18. execute prepared select\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6907 rs = pstmt.executeQuery(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6908 if (rs != null) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6909 rsmd = rs.getMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6910 sb.append("19. first query execute succeeded. it has ") |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6911 .append(rsmd.getColumnCount()).append(" result columns and "); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6912 int rows = 0; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6913 while (rs.next()) |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6914 rows++; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6915 sb.append(rows).append(" rows\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6916 rs.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6917 rs = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6918 } else { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6919 sb.append("19. first query execute failed to return a result\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6920 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6921 // do it one more time |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6922 sb.append("20. bind parameters\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6923 for (col = 1; col <= nrParams; col++) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6924 pstmt.setString(col, "someMoreText"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6925 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6926 sb.append("21. execute prepared select again\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6927 rs = pstmt.executeQuery(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6928 if (rs != null) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6929 rsmd = rs.getMetaData(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6930 sb.append("22. second query execute succeeded. it has ") |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6931 .append(rsmd.getColumnCount()).append(" result columns and "); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6932 int rows = 0; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6933 while (rs.next()) |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6934 rows++; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6935 sb.append(rows).append(" rows\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6936 rs.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6937 rs = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6938 } else { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6939 sb.append("22. second query execute failed to return a result\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6940 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6941 pstmt.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6942 pstmt = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6943 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6944 } catch (SQLException e) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6945 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6946 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6947 closeStmtResSet(pstmt, rs); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6948 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6949 // cleanup table |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6950 try { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6951 stmt = con.createStatement(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6952 stmt.executeUpdate("DROP TABLE IF EXISTS t7337;"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6953 stmt.close(); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6954 stmt = null; |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6955 } catch (SQLException e) { |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6956 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6957 } |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6958 closeStmtResSet(stmt, null); |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6959 |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6960 compareExpectedOutput("Bug_PrepStmtManyParams_7337(" + nrParams + ")", |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6961 "12. prepare select statement (no params), sql has length: 19\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6962 " fetch size after prepare 3: 250\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6963 " pmd. 0 parameters\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6964 " rsmd. " + (NR_COLUMNS+2) + " result columns\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6965 "13. execute prepared select\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6966 "14. first query execute succeeded. it has " + (NR_COLUMNS+2) + " result columns\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6967 "15. second query execute succeeded. it has " + (NR_COLUMNS+2) + " result columns\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6968 "16. prepare select statement (with params), sql has length: " + ((NR_COLUMNS * 18) -58) + "\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6969 " fetch size after prepare 4: 250\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6970 " pmd. " + nrParams + " parameters\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6971 " rsmd. " + (NR_COLUMNS+2) + " result columns\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6972 "17. bind parameters\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6973 "18. execute prepared select\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6974 "19. first query execute succeeded. it has " + (NR_COLUMNS+2) + " result columns and 2 rows\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6975 "20. bind parameters\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6976 "21. execute prepared select again\n" + |
5244af37a8e2
Counting only parameter markers to determine the fetchSize is not sufficiant for all Prepared statements.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
700
diff
changeset
|
6977 "22. second query execute succeeded. it has " + (NR_COLUMNS+2) + " result columns and 2 rows\n"); |
688
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6978 } |
761f406f4713
Add test for reproducing issue #7337
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
687
diff
changeset
|
6979 |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6980 /** |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6981 * 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
|
6982 * 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
|
6983 * 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
|
6984 * |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6985 * @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
|
6986 */ |
764
052c23fbfab2
Corrected implementation of Connection methods getClientInfo() and setClientInfo().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
757
diff
changeset
|
6987 private void SQLcopyinto(final String conn_URL) { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6988 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
|
6989 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6990 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
|
6991 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
|
6992 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
|
6993 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
|
6994 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
|
6995 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
|
6996 |
764
052c23fbfab2
Corrected implementation of Connection methods getClientInfo() and setClientInfo().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
757
diff
changeset
|
6997 fillTableUsingCopyIntoSTDIN(conn_URL, tablenm); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6998 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
6999 // 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
|
7000 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
|
7001 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
|
7002 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
|
7003 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
|
7004 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
|
7005 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
|
7006 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
|
7007 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
|
7008 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7009 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
|
7010 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
|
7011 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7012 } 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
|
7013 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
|
7014 } 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
|
7015 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
|
7016 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7017 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7018 // 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
|
7019 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
|
7020 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
|
7021 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
|
7022 } 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
|
7023 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
|
7024 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7025 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
|
7026 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7027 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
|
7028 "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
|
7029 "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
|
7030 "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
|
7031 "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
|
7032 "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
|
7033 "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
|
7034 "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
|
7035 "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
|
7036 "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
|
7037 "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
|
7038 "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
|
7039 "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
|
7040 "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
|
7041 "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
|
7042 "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
|
7043 "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
|
7044 "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
|
7045 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7046 |
764
052c23fbfab2
Corrected implementation of Connection methods getClientInfo() and setClientInfo().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
757
diff
changeset
|
7047 private void fillTableUsingCopyIntoSTDIN(final String conn_URL, final String tablenm) throws Exception { |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7048 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
|
7049 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7050 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
|
7051 try { |
813
a71afa48f269
Use new MapiSocket.connect() method In CopyIntoSTDIN test
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
812
diff
changeset
|
7052 MonetConnection mcon = (MonetConnection) con; |
a71afa48f269
Use new MapiSocket.connect() method In CopyIntoSTDIN test
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
812
diff
changeset
|
7053 Properties props = mcon.getConnectionProperties(); |
764
052c23fbfab2
Corrected implementation of Connection methods getClientInfo() and setClientInfo().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
757
diff
changeset
|
7054 |
052c23fbfab2
Corrected implementation of Connection methods getClientInfo() and setClientInfo().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
757
diff
changeset
|
7055 sb.append("Before connecting to MonetDB server via MapiSocket\n"); |
813
a71afa48f269
Use new MapiSocket.connect() method In CopyIntoSTDIN test
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
812
diff
changeset
|
7056 List<String> warning = server.connect("jdbc:monetdb:", props); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7057 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
|
7058 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
|
7059 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
|
7060 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7061 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7062 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
|
7063 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7064 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
|
7065 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
|
7066 |
700
940e266eeccd
Refactor BufferedMCLReader
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
699
diff
changeset
|
7067 String error = mclIn.discardRemainder(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7068 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
|
7069 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
|
7070 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7071 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
|
7072 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7073 // 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
|
7074 // 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
|
7075 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
|
7076 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
|
7077 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
|
7078 // 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
|
7079 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
|
7080 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
|
7081 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
|
7082 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7083 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
|
7084 |
700
940e266eeccd
Refactor BufferedMCLReader
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
699
diff
changeset
|
7085 error = mclIn.discardRemainder(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7086 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
|
7087 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
|
7088 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7089 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
|
7090 |
700
940e266eeccd
Refactor BufferedMCLReader
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
699
diff
changeset
|
7091 error = mclIn.discardRemainder(); |
448
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7092 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
|
7093 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
|
7094 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7095 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
|
7096 } 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
|
7097 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
|
7098 } 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
|
7099 // 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
|
7100 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
|
7101 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7102 |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7103 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
|
7104 } |
d7bac8d0fb93
Converted and added example program SQLcopyinto() to JDBC_API_Tester.java
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
447
diff
changeset
|
7105 |
664
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7106 private void DecimalPrecisionAndScale() { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7107 sb.setLength(0); // clear the output log buffer |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7108 |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7109 Statement stmt = null; |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7110 ResultSet rs = null; |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7111 try { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7112 stmt = con.createStatement(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7113 rs = stmt.executeQuery( |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7114 "select" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7115 " cast(123456789 as DECIMAL(18,0)) as dec1800" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7116 ", cast(123456789.0 as DECIMAL(18,1)) as dec1801" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7117 ", cast(123456789.0 as DECIMAL(18,2)) as dec1802" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7118 ", cast(123456789.0 as DECIMAL(18,3)) as dec1803" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7119 ", cast(123456789.0 as DECIMAL(18,4)) as dec1804" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7120 ", cast(123456789.0 as DECIMAL(18,5)) as dec1805" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7121 ", cast(123456789.0 as DECIMAL(18,6)) as dec1806" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7122 ", cast(123456789.0 as DECIMAL(18,7)) as dec1807" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7123 ", cast(123456789.0 as DECIMAL(18,8)) as dec1808" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7124 ", cast(123456789.0 as DECIMAL(18,9)) as dec1809" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7125 ", cast(12345678.9 as DECIMAL(18,10)) as dec1810" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7126 ", cast(1234567.89 as DECIMAL(18,11)) as dec1811" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7127 ", cast(123456.789 as DECIMAL(18,12)) as dec1812;"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7128 if (rs != null) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7129 ResultSetMetaData rsmd = rs.getMetaData(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7130 final int rscolcnt = rsmd.getColumnCount(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7131 sb.append("Query has ").append(rscolcnt).append(" columns:\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7132 sb.append("colnr\tlabel\ttypenm\tdisplaylength\tprecision\tscale\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7133 for (int col = 1; col <= rscolcnt; col++) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7134 sb.append("col ").append(col); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7135 sb.append("\t").append(rsmd.getColumnLabel(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7136 sb.append("\t").append(rsmd.getColumnTypeName(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7137 sb.append("\t").append(rsmd.getColumnDisplaySize(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7138 sb.append("\t").append(rsmd.getPrecision(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7139 sb.append("\t").append(rsmd.getScale(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7140 sb.append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7141 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7142 sb.append("Values\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7143 while (rs.next()) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7144 sb.append("colnr\tasString\tasBigDecimal\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7145 for (int col = 1; col <= rscolcnt; col++) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7146 sb.append("col ").append(col); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7147 sb.append("\t").append(rs.getString(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7148 sb.append("\t").append(rs.getBigDecimal(col)); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7149 sb.append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7150 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7151 sb.append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7152 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7153 rs.close(); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7154 rs = null; |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7155 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7156 } catch (SQLException se) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7157 sb.append("SQLException: ").append(se.getMessage()).append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7158 } catch (Exception e) { |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7159 sb.append("Exception: ").append(e.getMessage()).append("\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7160 } |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7161 closeStmtResSet(stmt, rs); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7162 |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7163 // The precision should be 18 and the scale should be from 0 to 12. |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7164 compareExpectedOutput("DecimalPrecisionAndScale()", |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7165 "Query has 13 columns:\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7166 "colnr label typenm displaylength precision scale\n" + |
929
ea15f10eaa61
Backed out changeset 5c4ac1dad79a
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
928
diff
changeset
|
7167 "col 1 dec1800 decimal 19 18 0\n" + |
665
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7168 "col 2 dec1801 decimal 20 18 1\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7169 "col 3 dec1802 decimal 20 18 2\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7170 "col 4 dec1803 decimal 20 18 3\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7171 "col 5 dec1804 decimal 20 18 4\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7172 "col 6 dec1805 decimal 20 18 5\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7173 "col 7 dec1806 decimal 20 18 6\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7174 "col 8 dec1807 decimal 20 18 7\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7175 "col 9 dec1808 decimal 20 18 8\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7176 "col 10 dec1809 decimal 20 18 9\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7177 "col 11 dec1810 decimal 20 18 10\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7178 "col 12 dec1811 decimal 20 18 11\n" + |
8f7d51c478df
Improved implementation of methods ResultSetMetaData.getPrecision() and ResultSetMetaData.getScale().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
664
diff
changeset
|
7179 "col 13 dec1812 decimal 20 18 12\n" + |
664
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7180 "Values\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7181 "colnr asString asBigDecimal\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7182 "col 1 123456789 123456789\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7183 "col 2 123456789.0 123456789.0\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7184 "col 3 123456789.00 123456789.00\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7185 "col 4 123456789.000 123456789.000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7186 "col 5 123456789.0000 123456789.0000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7187 "col 6 123456789.00000 123456789.00000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7188 "col 7 123456789.000000 123456789.000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7189 "col 8 123456789.0000000 123456789.0000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7190 "col 9 123456789.00000000 123456789.00000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7191 "col 10 123456789.000000000 123456789.000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7192 "col 11 12345678.9000000000 12345678.9000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7193 "col 12 1234567.89000000000 1234567.89000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7194 "col 13 123456.789000000000 123456.789000000000\n" + |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7195 "\n"); |
a6592430c8fc
Adding test DecimalPrecisionAndScale for showing incorrect precision and scale values.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
653
diff
changeset
|
7196 } |
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
|
7197 |
909
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7198 private void Test_ClientInfo(String con_URL) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7199 if (!isPostDec2023) |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7200 return; |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7201 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7202 sb.setLength(0); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7203 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7204 final String[] known = { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7205 "ApplicationName", "ClientHostname", "ClientLibrary", "ClientPid", "ClientRemark" |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7206 }; |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7207 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7208 try { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7209 sb.append("Connecting\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7210 try (Connection conn = DriverManager.getConnection(con_URL)) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7211 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7212 // Server metadata includes list of supported clientinfo properties |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7213 sb.append("Fetching supported clientinfo properties\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7214 DatabaseMetaData md = conn.getMetaData(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7215 try (ResultSet rs = md.getClientInfoProperties()) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7216 HashSet<String> seen = new HashSet<>(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7217 while (rs.next()) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7218 String name = rs.getString(1); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7219 if (name == null || name.isEmpty()) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7220 sb.append("NAME column contains empty string\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7221 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7222 seen.add(name); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7223 int width = rs.getInt(2); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7224 if (width <= 0) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7225 sb.append("MAX_LEN for " + name + " is " + width + "\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7226 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7227 String description = rs.getString(4); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7228 if (description == null || description.isEmpty()) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7229 sb.append("DESCRIPTION for " + name + " is empty\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7230 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7231 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7232 for (String name: known) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7233 boolean found = seen.contains(name); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7234 sb.append("- " + name + (found ? " was " : " was not ") + "found\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7235 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7236 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7237 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7238 // I cannot think of a way to check the default values that doesn't |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7239 // essentially duplicate the code that came up with the default values. |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7240 // The best we can do is verify they're not empty. |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7241 sb.append("Check initial values.\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7242 Properties initialValues = conn.getClientInfo(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7243 for (String name: known) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7244 String value = (String) initialValues.getOrDefault(name, ""); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7245 sb.append("- " + name + (value.isEmpty() ? " is empty" : " is not empty") + "\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7246 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7247 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7248 // We should get a fresh copy every time |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7249 if (conn.getClientInfo() != initialValues) |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7250 sb.append("Calls to con.getClientInfo do not return references to the same Properties object\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7251 else |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7252 sb.append("Calls to con.getClientInfo DO return references to the same Properties object!\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7253 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7254 // Assign new values in various ways. |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7255 // Also include some unknown properties |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7256 sb.append("Set ApplicationName=1\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7257 conn.setClientInfo("ApplicationName", "1"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7258 readWarnings(conn.getWarnings()); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7259 conn.clearWarnings(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7260 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7261 sb.append("Set BananaNameXYZ=99\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7262 conn.setClientInfo("BananaNameXYZ", "99"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7263 readWarnings(conn.getWarnings()); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7264 conn.clearWarnings(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7265 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7266 sb.append("Set { ClientHostname=2, ClientLibrary=3, ClientPid=4, ClientRemark=5, ClientBananaPQR=999 }\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7267 Properties toBeInserted = new Properties(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7268 toBeInserted.put("ClientHostname", "2"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7269 toBeInserted.put("ClientLibrary", "3"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7270 toBeInserted.put("ClientPid", "4"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7271 toBeInserted.put("ClientRemark", "5"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7272 toBeInserted.put("ClientBananaPQR", "999"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7273 conn.setClientInfo(toBeInserted); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7274 readWarnings(conn.getWarnings()); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7275 conn.clearWarnings(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7276 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7277 sb.append("Checking the results\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7278 Properties foundValues = conn.getClientInfo(); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7279 for (String name: known) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7280 sb.append("- " + name + ": prop=" ); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7281 String propValue = (String) foundValues.getOrDefault(name, ""); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7282 sb.append("" + propValue); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7283 sb.append(", single="); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7284 String singleValue = conn.getClientInfo(name); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7285 sb.append("" + singleValue); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7286 if (propValue != null && !propValue.equals(singleValue)) |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7287 sb.append(" !!! DIFFERENT !!!"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7288 sb.append("\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7289 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7290 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7291 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7292 } catch (SQLException e) { |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7293 sb.append("FAILED: ").append(e.getMessage()).append("\n"); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7294 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7295 |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7296 compareExpectedOutput("Test_ClientInfo", |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7297 "Connecting\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7298 "Fetching supported clientinfo properties\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7299 "- ApplicationName was found\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7300 "- ClientHostname was found\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7301 "- ClientLibrary was found\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7302 "- ClientPid was found\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7303 "- ClientRemark was found\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7304 "Check initial values.\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7305 "- ApplicationName is not empty\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7306 "- ClientHostname is not empty\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7307 "- ClientLibrary is not empty\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7308 "- ClientPid is not empty\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7309 "- ClientRemark is empty\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7310 "Calls to con.getClientInfo do not return references to the same Properties object\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7311 "Set ApplicationName=1\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7312 "Set BananaNameXYZ=99\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7313 "Warning: java.sql.SQLWarning: unknown client info property: BananaNameXYZ\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7314 "Set { ClientHostname=2, ClientLibrary=3, ClientPid=4, ClientRemark=5, ClientBananaPQR=999 }\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7315 "Warning: java.sql.SQLWarning: unknown client info property: ClientBananaPQR\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7316 "Checking the results\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7317 "- ApplicationName: prop=1, single=1\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7318 "- ClientHostname: prop=2, single=2\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7319 "- ClientLibrary: prop=3, single=3\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7320 "- ClientPid: prop=4, single=4\n" + |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7321 "- ClientRemark: prop=5, single=5\n" |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7322 ); |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7323 } |
4a5fb9ddee45
Add ClientInfo tests
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
908
diff
changeset
|
7324 |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7325 // 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
|
7326 private void showTblContents(String tblnm) { |
923
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7327 final String query = "SELECT * FROM \"" + tblnm + "\""; |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7328 Statement stmt = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7329 ResultSet rs = null; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7330 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7331 stmt = con.createStatement(); |
923
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7332 rs = stmt.executeQuery(query); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7333 if (rs != null) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7334 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
|
7335 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
|
7336 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
|
7337 sb.append("\t").append(rsmd.getColumnLabel(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7338 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7339 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7340 while (rs.next()) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7341 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
|
7342 sb.append("\t").append(rs.getString(col)); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7343 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7344 sb.append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7345 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7346 } else |
923
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7347 sb.append("failed to execute query: ").append(query).append("\n"); |
401
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7348 } catch (SQLException e) { |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7349 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
|
7350 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7351 closeStmtResSet(stmt, rs); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7352 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7353 |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7354 private void showParams(PreparedStatement pstmt) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7355 try { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7356 // testing and showing parameter meta data |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7357 ParameterMetaData pmd = pstmt.getParameterMetaData(); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7358 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
|
7359 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
|
7360 sb.append("Param ").append(parm).append("\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7361 int nullable = pmd.isNullable(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7362 sb.append(" nullable ").append(nullable).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7363 switch (nullable) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7364 case ParameterMetaData.parameterNoNulls: sb.append("NO"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7365 case ParameterMetaData.parameterNullable: sb.append("YA"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7366 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
|
7367 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
|
7368 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7369 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7370 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
|
7371 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
|
7372 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
|
7373 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
|
7374 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
|
7375 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
|
7376 int mode = pmd.getParameterMode(parm); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7377 sb.append(" mode ").append(mode).append(" ("); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7378 switch (mode) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7379 case ParameterMetaData.parameterModeIn: sb.append("IN"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7380 case ParameterMetaData.parameterModeInOut: sb.append("INOUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7381 case ParameterMetaData.parameterModeOut: sb.append("OUT"); break; |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7382 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
|
7383 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
|
7384 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7385 sb.append(")\n"); |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7386 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7387 } catch (SQLException e) { |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7388 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
|
7389 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7390 } |
1850e0dfb5f7
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
400
diff
changeset
|
7391 |
404
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7392 private void readExceptions(SQLException e) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7393 while (e != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7394 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
|
7395 e = e.getNextException(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7396 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7397 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7398 |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7399 private void readWarnings(SQLWarning w) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7400 while (w != null) { |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7401 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
|
7402 w = w.getNextWarning(); |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7403 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7404 } |
559aa626b550
Improved code and implemented all tests.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
401
diff
changeset
|
7405 |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7406 private void compareExpectedOutput(String testname, String expected) { |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7407 final String produced = sb.toString(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7408 if (!expected.equals(produced)) { |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7409 foundDifferences = true; |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7410 System.err.print("Test '"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7411 System.err.print(testname); |
651
3b6139d35057
Extend tests by also calling ResultSetMetaData methods getColumnTypeName(), getColumnType(), getPrecision() and getScale() from compareResultSet().
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
650
diff
changeset
|
7412 if (!testname.endsWith(")") && !testname.endsWith(";")) |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7413 System.err.print("()"); |
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7414 System.err.println("' produced different output!"); |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7415 int expLen = expected.length(); |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7416 int prodLen = produced.length(); |
689
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7417 if (expLen > 0 && prodLen > 0) { |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7418 int max_pos = expLen; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7419 if (prodLen > max_pos) |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7420 max_pos = prodLen; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7421 int line = 1; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7422 int rowpos = 0; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7423 for (int pos = 0; pos < max_pos; pos++) { |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7424 char a = (pos < expLen ? expected.charAt(pos) : '~'); |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7425 char b = (pos < prodLen ? produced.charAt(pos) : '~'); |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7426 if (a == '\n') { |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7427 line++; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7428 rowpos = 0; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7429 } else { |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7430 rowpos++; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7431 } |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7432 if (a != b) { |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7433 if (pos + 40 < expLen) |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7434 expLen = pos + 40; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7435 if (pos + 40 < prodLen) |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7436 prodLen = pos + 40; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7437 System.err.println("Difference found at line " + line + " position " + rowpos |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7438 + ". Expected:\n\"" + expected.substring(pos < expLen ? pos : expLen-1, expLen-1) |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
7439 + "\"\nFound:\n\"" + produced.substring(pos < prodLen ? pos : prodLen-1, prodLen-1) + "\""); |
689
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7440 pos = max_pos; |
4d3b2cf24b30
Store retrieved rdbms version info in JDBC_API_Tester object, so it can be used by all tests, when they need it.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
688
diff
changeset
|
7441 } |
682
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7442 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7443 } |
78253fdb3c3f
Corrected returned SQL TypeName values for the MonetDB interval types: 'day_interval', 'month_interval' and 'sec_interval'.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
680
diff
changeset
|
7444 System.err.println(); |
923
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7445 System.err.println("---- Full Output: ------------"); |
908
9c9a6c0a85f6
Minor changes to JDBC_API_Tester
Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
parents:
898
diff
changeset
|
7446 System.err.println(sb); |
923
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7447 System.err.println("---- END ---------------------"); |
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7448 System.err.println("---- Expected Output: --------"); |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7449 System.err.println(expected); |
923
3b29fb3f537a
Improve construction of SQL query in showTblContents()
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
922
diff
changeset
|
7450 System.err.println("---- END ---------------------"); |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7451 System.err.println(); |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7452 } |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
7453 if (sb.length() > sbInitLen) { |
469
53911f29093c
Change output to stderr when differences are found.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
464
diff
changeset
|
7454 System.err.println("Test '" + testname |
400
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
7455 + "' produced output > " + sbInitLen |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
7456 + " chars! Enlarge sbInitLen to: " + sb.length()); |
20bdae942f99
Implemented some more tests
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
399
diff
changeset
|
7457 } |
395
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7458 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7459 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7460 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
|
7461 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
|
7462 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
|
7463 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
|
7464 } 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
|
7465 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7466 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7467 |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7468 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
|
7469 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
|
7470 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
|
7471 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
|
7472 } 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
|
7473 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7474 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
|
7475 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
|
7476 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
|
7477 } 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
|
7478 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7479 } |
0eef53e06007
Add JDBC_API_Tester program to test JDBC Driver API methods and behavior of MonetDB server.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
diff
changeset
|
7480 } |