Changeset: 9d58e78ed8f0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9d58e78ed8f0
Modified Files:
        java/ChangeLog
        java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
Branch: default
Log Message:

Implemented method DatabaseMetaData.getClientProperties().
It used to always return a resultset with 4 completely empty rows.
It now returns a resultset with the possible connection properties.


diffs (92 lines):

diff --git a/java/ChangeLog b/java/ChangeLog
--- a/java/ChangeLog
+++ b/java/ChangeLog
@@ -2,14 +2,17 @@
 # This file is updated with Maddlog
 
 * Thu Mar  3 2016 Martin van Dinther <[email protected]>
+- Implemented method DatabaseMetaData.getClientProperties(). It used to always
+  return a resultset with 4 completely empty rows.  It now returns a
+  resultset with the possible connection properties.
 - Implemented method DatabaseMetaData.getUDTs(). It used to return an empty
   resultset. Now it returns the User Defined Types such as inet, json, url and 
uuid.
 
 * Thu Feb 18 2016 Martin van Dinther <[email protected]>
 - Corrected the returned table types in DatabaseMetaData.getTableTypes().
-  It now returns all 14 table types (as stored in sys.table_types) instead
+  It now returns all 10 table types (as stored in sys.table_types) instead
   of the previously 8 hardcoded table types.
-  For old MonetDB servers which do not contain the sys.table_types table,
+  For old MonetDB servers which do not have the sys.table_types table,
   the old behavior is retained.
 
 * Thu Feb 11 2016 Martin van Dinther <[email protected]>
@@ -27,8 +30,8 @@
 
 * Thu Jan 28 2016 Martin van Dinther <[email protected]>
 - Method getFunctions() in DatabaseMetadata used to throw an SQLException:
-  SELECT: no such column 'functions.sql' This has been corrected. It
-  now returns a resultset as requested.
+  SELECT: no such column 'functions.sql' This has been corrected.
+  It now returns a resultset as requested.
 - The resultsets of DatabaseMetadata methods now no longer return a
   value for the *_CAT columns as MonetDB does not support Catalogs.
 
diff --git a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java 
b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
--- a/java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -3083,10 +3083,10 @@ public class MonetDatabaseMetaData exten
                        query.append(" AND \"TYPE_CAT\" 
").append(composeMatchPart(catalog));
                }
                if (schemaPattern != null) {
-                       query.append(" AND \"TYPE_SCHEM\" 
").append(composeMatchPart(schemaPattern));
+                       query.append(" AND \"schemas\".\"name\" 
").append(composeMatchPart(schemaPattern));
                }
                if (typeNamePattern != null) {
-                       query.append(" AND \"TYPE_NAME\" 
").append(composeMatchPart(typeNamePattern));
+                       query.append(" AND \"types\".\"sqlname\" 
").append(composeMatchPart(typeNamePattern));
                }
                if (types != null && types.length > 0) {
                        query.append(" AND \"DATA_TYPE\" IN (");
@@ -3580,27 +3580,20 @@ public class MonetDatabaseMetaData exten
         */
        @Override
        public ResultSet getClientInfoProperties() throws SQLException {
-               String[] columns, types;
-               String[][] results;
-
-               columns = new String[4];
-               types = new String[4];
-               results = new String[4][0];
-
-               columns[0] = "NAME";
-               types[0] = "varchar";
-               columns[1] = "MAX_LEN";
-               types[1] = "integer";
-               columns[2] = "DEFAULT_VALUE";
-               types[2] = "varchar";
-               columns[3] = "DESCRIPTION";
-               types[3] = "varchar";
-
-               try {
-                       return new MonetVirtualResultSet(columns, types, 
results);
-               } catch (IllegalArgumentException e) {
-                       throw new SQLException("Internal driver error: " + 
e.getMessage(), "M0M03");
-               }
+               // for a list of connection properties see also 
MonetConnection.java constructor MonetConnection(Properties props)
+               String query =
+               "SELECT 'host' AS \"NAME\", CAST(1024 as int) AS \"MAX_LEN\", 
'localhost' AS \"DEFAULT_VALUE\", 'DSN or IP-address of machine running 
MonetDB' AS \"DESCRIPTION\" UNION ALL " +
+               "SELECT 'port', 5, '50000', 'communication port number of 
MonetDB server process' UNION ALL " +
+               "SELECT 'user', 128, '', 'user name to login to MonetDB server' 
UNION ALL " +
+               "SELECT 'password', 128, '', 'password for user name to login 
to MonetDB server' UNION ALL " +
+               "SELECT 'langauge', 16, 'sql', 'language (sql or mal) used to 
parse commands in MonetDB server' UNION ALL " +
+               "SELECT 'debug', 5, 'false', 'boolean flag true or false' UNION 
ALL " +
+               "SELECT 'hash', 128, '', 'hash string' UNION ALL " +
+               "SELECT 'treat_blob_as_binary', 5, 'false', 'boolean flag true 
or false' UNION ALL " +
+               "SELECT 'so_timeout', 10, '0', 'timeout of communication 
socket. 0 means no timeout is set' " +
+               "ORDER BY \"NAME\"";
+
+               return executeMetaDataQuery(query);
        }
 
        /**
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to