code: public Connection getConnection(final String username, final String password)
        throws SQLException {
      try {
        if (pool == null) {
          this.user = username;
          this.password = password;
  
          initialize();
          return pool.getConnection();
        }
  
        if ((urlParser.getUsername() != null ? urlParser.getUsername().equals(username)
            : username == null)
            && (urlParser.getPassword() != null ? urlParser.getPassword().equals(password)
            : (password == null || password.isEmpty()))) {
          return pool.getConnection();
        }
  
        //username / password are different from the one already used to initialize pool
        //-> return a real new connection.
  
        UrlParser urlParser = (UrlParser) this.urlParser.clone();
        urlParser.setUsername(username);
        urlParser.setPassword(password);
        return MariaDbConnection.newConnection(urlParser, pool.getGlobalInfo());
  
      } catch (SQLException e) {
        throw ExceptionMapper.getException(e, null, null, false);
      } catch (CloneNotSupportedException cloneException) {
        throw new SQLException("Error in configuration");
      }
    }
docs: Attempts to establish a connection with the data source that this <code>DataSource</code>
  object represents.
  
  @param username the database user on whose behalf the connection is being made
  @param password the user's password
  @return a connection to the data source
  @throws SQLException if a database access error occurs