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

clientInfoProperties never populated in org.mariadb.jdbc.MySQLConnection

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.7
    • 1.1.8
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.