Changeset: 6e8ff2818fa7 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/6e8ff2818fa7
Modified Files:
        src/main/java/org/monetdb/jdbc/MonetConnection.java
Branch: default
Log Message:

Implement the new schema= option of the jdbc URL


diffs (26 lines):

diff --git a/src/main/java/org/monetdb/jdbc/MonetConnection.java 
b/src/main/java/org/monetdb/jdbc/MonetConnection.java
--- a/src/main/java/org/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/org/monetdb/jdbc/MonetConnection.java
@@ -224,7 +224,7 @@ public class MonetConnection
                        throw sqle;
                }
 
-               // Now take care of any handshake options not handled during 
the handshake
+               // Now take care of any options not handled during the handshake
                curReplySize = defaultFetchSize;
                if (lang == LANG_SQL) {
                        if (autoCommit != target.isAutocommit()) {
@@ -240,6 +240,13 @@ public class MonetConnection
 
                // we're absolutely not closed, since we're brand new
                closed = false;
+
+               if (!target.getSchema().isEmpty()) {
+                       try (Statement stmt = this.createStatement()) {
+                               String escaped = 
target.getSchema().replaceAll("\"", "\"\"");
+                               stmt.execute("SET SCHEMA \"" + escaped + "\"");
+                       }
+               }
        }
 
        //== methods of interface Connection
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to