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

Older servers don't have clientinfo_properties yet


diffs (22 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
@@ -1348,11 +1348,13 @@ public class MonetConnection
        private HashMap<String,String> getClientInfoAttributeNames() throws 
SQLException {
                if (clientInfoAttributeNames == null) {
                        HashMap<String, String> map = new HashMap<>();
-                       try (Statement st = createStatement(); ResultSet rs = 
st.executeQuery("SELECT prop, session_attr FROM sys.clientinfo_properties")) {
-                               while (rs.next()) {
-                                       String jdbcName = rs.getString(1);
-                                       String attrName = rs.getString(2);
-                                       map.put(jdbcName, attrName);
+                       if (server.canClientInfo()) {
+                               try (Statement st = createStatement(); 
ResultSet rs = st.executeQuery("SELECT prop, session_attr FROM 
sys.clientinfo_properties")) {
+                                       while (rs.next()) {
+                                               String jdbcName = 
rs.getString(1);
+                                               String attrName = 
rs.getString(2);
+                                               map.put(jdbcName, attrName);
+                                       }
                                }
                        }
                        clientInfoAttributeNames = map;
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to