Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-89

clientInfoProperties never populated in org.mariadb.jdbc.MySQLConnection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.7
    • Fix Version/s: 1.1.8
    • Component/s: None
    • Labels:
      None

      Description

      I want to be able to determine whether or not a connection has been established with a certain optional property (useFractionalSeconds). I should be able to use connection.getClientInfo("useFractionalSeconds") to do this, but it looks like the properties are never populated.

      org.mariadb.jdbc.MySQLConnection

      private MySQLConnection( MySQLProtocol protocol) {
          this.protocol = protocol;
          clientInfoProperties = new Properties();
      }

      I suggest populating the properties from the protocol:

      org.mariadb.jdbc.MySQLConnection

      private MySQLConnection( MySQLProtocol protocol) {
          this.protocol = protocol;
          clientInfoProperties = new Properties();
          clientInfoProperties.putAll(protocol.getInfo());
      }

      and probably a good idea to not include user and password:

      org.mariadb.jdbc.Driver

      public Connection connect(final String url, final Properties info) throws SQLException {
      // snip
              String userName = info.getProperty("user",jdbcUrl.getUsername());
              String password = info.getProperty("password",jdbcUrl.getPassword());
              
              info.remove("user");
              info.remove("password");
       
              MySQLProtocol protocol = new MySQLProtocol(jdbcUrl, userName,  password,  info);
      // snip
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              massimo.siani Massimo Siani (Inactive)
              Reporter:
              emattheis Erik Mattheis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: