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

regression : Pool connection may fail to connect with good user

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.0-RC, 1.5.1-RC
    • Fix Version/s: 1.5.2
    • Component/s: Other
    • Labels:
      None

      Description

      Using MySQLDataSource or MariaDbDataSource to connect from pool has a regression :

      MariaDbDataSource datasource = new MariaDbDataSource();
      datasource.setUser("USER");
      datasource.setPassword("PWD");
      datasource.setUrl("jdbc:mariadb://localhost:3306/db");

      Connection will use current current windows user (if using windows), not user "USER1"

      MariaDbDataSource datasource = new MariaDbDataSource();
      datasource.setUser("USER");
      datasource.setPassword("PWD");
      datasource.setUrl("jdbc:mariadb://localhost:3306/db?user=USER1");

      Connection will use user "USER1"


      recommended way to connect a pool is using Driver implementation, not DataSource
      example :
      final HikariDataSource ds = new HikariDataSource();
      ds.setMaximumPoolSize(20);
      ds.setDriverClassName("org.mariadb.jdbc.Driver");
      ds.setJdbcUrl("jdbc:mariadb://localhost:3306/db");
      ds.addDataSourceProperty("user", "root");
      ds.addDataSourceProperty("password", "myPassword");
      ds.setAutoCommit(false);

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration