annotate src/main/java/org/monetdb/util/Exporter.java @ 406:bf9f6b6ecf40

Update Copyright year.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Wed, 06 Jan 2021 22:09:32 +0100 (2021-01-06)
parents f523727db392
children 95d15f1d750d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 *
406
bf9f6b6ecf40 Update Copyright year.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 391
diff changeset
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2021 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
391
f523727db392 Moved Java classes from packages starting with nl.cwi.monetdb.* to package org.monetdb.*
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 350
diff changeset
9 package org.monetdb.util;
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
10
70
17fbaf2635bb Expand import java.*.* statements
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 0
diff changeset
11 import java.io.PrintWriter;
17fbaf2635bb Expand import java.*.* statements
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 0
diff changeset
12 import java.sql.ResultSet;
17fbaf2635bb Expand import java.*.* statements
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 0
diff changeset
13 import java.sql.SQLException;
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
14
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
15 public abstract class Exporter {
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
16 protected PrintWriter out;
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
17 protected boolean useSchema;
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
18
307
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
19 protected Exporter(final PrintWriter out) {
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
20 this.out = out;
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
21 }
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
22
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
23 public abstract void dumpSchema(
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
24 final java.sql.DatabaseMetaData dbmd,
307
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
25 final String type,
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
26 final String schema,
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
27 final String name) throws SQLException;
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
28
307
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
29 public abstract void dumpResultSet(final ResultSet rs) throws SQLException;
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
30
307
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
31 public abstract void setProperty(final int type, final int value) throws Exception;
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
32 public abstract int getProperty(final int type) throws Exception;
70
17fbaf2635bb Expand import java.*.* statements
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 0
diff changeset
33
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
34
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
35 //=== shared utilities
70
17fbaf2635bb Expand import java.*.* statements
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 0
diff changeset
36
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
37 public final void useSchemas(final boolean use) {
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
38 useSchema = use;
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
39 }
70
17fbaf2635bb Expand import java.*.* statements
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 0
diff changeset
40
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
41 /**
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
42 * returns the given string between two double quotes for usage as
309
8a96a4a13528 Add additional "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 307
diff changeset
43 * identifier such as column or table or schema name in SQL queries.
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
44 *
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
45 * @param in the string to quote
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
46 * @return the quoted string
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
47 */
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
48 protected static final String dq(final String in) {
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
49 return "\"" + in.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\"") + "\"";
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
50 }
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
51
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
52 /**
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
53 * returns the given string between two single quotes for usage as
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
54 * string literal in SQL queries.
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
55 *
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
56 * @param in the string to quote
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
57 * @return the quoted string
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
58 */
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
59 protected static final String q(final String in) {
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
60 return "'" + in.replaceAll("\\\\", "\\\\\\\\").replaceAll("'", "\\\\'") + "'";
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
61 }
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
62
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
63 /**
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
64 * Simple helper function to repeat a given character a number of times.
0
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 * @param chr the character to repeat
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
67 * @param cnt the number of times to repeat chr
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
68 * @return a String holding cnt times chr
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
69 */
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
70 protected static final String repeat(final char chr, final int cnt) {
307
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
71 final char[] buf = new char[cnt];
05549bc7ed26 Add "final" keyword to classes, method arguments and local variables where possible.
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 261
diff changeset
72 java.util.Arrays.fill(buf, chr);
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
73 return new String(buf);
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
74 }
318
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
75
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
76 /**
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
77 * Utility method to fetch the "query" value from sys.tables for a specific view or table in a specific schema
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
78 * The "query" value contains the original SQL view creation text or the ON clause text when it is a REMOTE TABLE
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
79 *
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
80 * @param con the JDBC connection, may not be null
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
81 * @param schema the schem name, may not be null or empty
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
82 * @param name the view or table name, may not be null or empty
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
83 * @return the value of the "query" field for the specified view/table name and schema. It can return null.
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
84 */
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
85 protected static final String fetchSysTablesQueryValue(
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
86 final java.sql.Connection con,
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
87 final String schema,
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
88 final String name)
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
89 {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
90 java.sql.Statement stmt = null;
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
91 ResultSet rs = null;
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
92 String val = null;
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
93 try {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
94 stmt = con.createStatement();
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
95 final String cmd = "SELECT query FROM sys.tables WHERE name = '" + name
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
96 + "' and schema_id IN (SELECT id FROM sys.schemas WHERE name = '" + schema + "')";
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
97 rs = stmt.executeQuery(cmd);
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
98 if (rs != null) {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
99 if (rs.next()) {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
100 val = rs.getString(1);
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
101 }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
102 }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
103 } catch (SQLException se) {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
104 /* ignore */
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
105 } finally {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
106 // free resources
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
107 if (rs != null) {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
108 try { rs.close(); } catch (SQLException se) { /* ignore */ }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
109 }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
110 if (stmt != null) {
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
111 try { stmt.close(); } catch (SQLException se) { /* ignore */ }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
112 }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
113 }
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
114 return val;
13a9d5316e37 Corrected JdbcClient program: the dumping of a view DDL was incorrect when the view creation statement was not starting with "create view ", such as when it was created using "CREATE VIEW" or "create or replace view".
Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
parents: 315
diff changeset
115 }
0
a5a898f6886c Copy of MonetDB java directory changeset e6e32756ad31.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
116 }