Mercurial > hg > monetdb-java
annotate tests/Test_PSmetadata.java @ 391:f523727db392
Moved Java classes from packages starting with nl.cwi.monetdb.* to package org.monetdb.*
This naming complies to the Java Package Naming convention as MonetDB's main website is www.monetdb.org.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 12 Nov 2020 22:02:01 +0100 (2020-11-12) |
parents | 11c30e3b7966 |
children | bf9f6b6ecf40 |
rev | line source |
---|---|
0
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
1 /* |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
2 * This Source Code Form is subject to the terms of the Mozilla Public |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
5 * |
350
54137aeb1f92
Update Copyright year.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
270
diff
changeset
|
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. |
0
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
7 */ |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
8 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
9 import java.sql.*; |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
10 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
11 public class Test_PSmetadata { |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
12 public static void main(String[] args) throws Exception { |
381
11c30e3b7966
Set the connection properties treat_clob_as_varchar and treat_blob_as_binary to true by default for faster processing (less objects created, less memory needed) when querying CLOB or BLOB column data.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
350
diff
changeset
|
13 Connection con = DriverManager.getConnection(args[0] + "&treat_clob_as_varchar=false"); |
0
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
14 Statement stmt = con.createStatement(); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
15 PreparedStatement pstmt; |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
16 ResultSet rs = null; |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
17 ResultSetMetaData rsmd = null; |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
18 ParameterMetaData pmd = null; |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
19 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
20 con.setAutoCommit(false); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
21 // >> false: auto commit should be off now |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
22 System.out.println("0. false\t" + con.getAutoCommit()); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
23 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
24 try { |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
25 stmt.executeUpdate("CREATE TABLE table_Test_PSmetadata ( myint int, mydouble double, mybool boolean, myvarchar varchar(15), myclob clob )"); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
26 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
27 // all NULLs |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
28 stmt.executeUpdate("INSERT INTO table_Test_PSmetadata VALUES (NULL, NULL, NULL, NULL, NULL)"); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
29 // all filled in |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
30 stmt.executeUpdate("INSERT INTO table_Test_PSmetadata VALUES (2 , 3.0, true, 'A string', 'bla bla bla')"); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
31 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
32 pstmt = con.prepareStatement("SELECT CASE WHEN myint IS NULL THEN 0 ELSE 1 END AS intnull, * FROM table_Test_PSmetadata WHERE myint = ?"); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
33 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
34 rsmd = pstmt.getMetaData(); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
35 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
36 System.out.println("0. 6 columns:\t" + rsmd.getColumnCount()); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
37 for (int col = 1; col <= rsmd.getColumnCount(); col++) { |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
38 System.out.println("" + col + ".\t" + rsmd.getCatalogName(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
39 System.out.println("\tclassname " + rsmd.getColumnClassName(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
40 System.out.println("\tdisplaysize " + rsmd.getColumnDisplaySize(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
41 System.out.println("\tlabel " + rsmd.getColumnLabel(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
42 System.out.println("\tname " + rsmd.getColumnName(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
43 System.out.println("\ttype " + rsmd.getColumnType(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
44 System.out.println("\ttypename " + rsmd.getColumnTypeName(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
45 System.out.println("\tprecision " + rsmd.getPrecision(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
46 System.out.println("\tscale " + rsmd.getScale(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
47 System.out.println("\tschemaname " + rsmd.getSchemaName(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
48 System.out.println("\ttablename " + rsmd.getTableName(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
49 System.out.println("\tautoincrement " + rsmd.isAutoIncrement(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
50 System.out.println("\tcasesensitive " + rsmd.isCaseSensitive(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
51 System.out.println("\tcurrency " + rsmd.isCurrency(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
52 System.out.println("\tdefwritable " + rsmd.isDefinitelyWritable(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
53 System.out.println("\tnullable " + rsmd.isNullable(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
54 System.out.println("\treadonly " + rsmd.isReadOnly(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
55 System.out.println("\tsearchable " + rsmd.isSearchable(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
56 System.out.println("\tsigned " + rsmd.isSigned(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
57 System.out.println("\twritable " + rsmd.isWritable(col)); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
58 } |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
59 |
270
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
60 showParams(pstmt); |
0
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
61 } catch (SQLException e) { |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
62 System.out.println("failed :( "+ e.getMessage()); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
63 System.out.println("ABORTING TEST!!!"); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
64 } |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
65 |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
66 con.rollback(); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
67 con.close(); |
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
68 } |
270
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
69 |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
70 // some utility methods for showing table content and params meta data |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
71 static void showParams(PreparedStatement stmt) { |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
72 try { |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
73 ParameterMetaData pmd = stmt.getParameterMetaData(); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
74 System.out.println(pmd.getParameterCount() + " parameters reported:"); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
75 for (int parm = 1; parm <= pmd.getParameterCount(); parm++) { |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
76 System.out.print(parm + "."); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
77 int nullable = pmd.isNullable(parm); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
78 System.out.println("\tnullable " + nullable + " (" + paramNullableName(nullable) + ")"); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
79 System.out.println("\tsigned " + pmd.isSigned(parm)); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
80 System.out.println("\tprecision " + pmd.getPrecision(parm)); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
81 System.out.println("\tscale " + pmd.getScale(parm)); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
82 System.out.println("\ttype " + pmd.getParameterType(parm)); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
83 System.out.println("\ttypename " + pmd.getParameterTypeName(parm)); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
84 System.out.println("\tclassname " + pmd.getParameterClassName(parm)); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
85 int mode = pmd.getParameterMode(parm); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
86 System.out.println("\tmode " + mode + " (" + paramModeName(mode) + ")"); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
87 } |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
88 } catch (SQLException e) { |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
89 System.out.println("showParams failed: " + e.getMessage()); |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
90 } |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
91 } |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
92 |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
93 static String paramNullableName(int nullable) { |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
94 if (nullable == ParameterMetaData.parameterNoNulls) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
95 return "NO"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
96 if (nullable == ParameterMetaData.parameterNullable) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
97 return "YA"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
98 if (nullable == ParameterMetaData.parameterNullableUnknown) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
99 return "UNKNOWN"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
100 return "INVALID" + nullable; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
101 } |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
102 |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
103 static String paramModeName(int mode) { |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
104 if (mode == ParameterMetaData.parameterModeIn) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
105 return "IN"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
106 if (mode == ParameterMetaData.parameterModeInOut) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
107 return "INOUT"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
108 if (mode == ParameterMetaData.parameterModeOut) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
109 return "OUT"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
110 if (mode == ParameterMetaData.parameterModeUnknown) |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
111 return "UNKNOWN"; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
112 return "INVALID" + mode; |
926afbe567f5
Enhanced the reporting of the parameters. It now shows the name for the nullable and mode integer codes.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents:
261
diff
changeset
|
113 } |
0
a5a898f6886c
Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff
changeset
|
114 } |