code: public Connection getConnection(String username,
                                      String password) throws SQLException {
  
          Properties props = new Properties();
  
          if (username != null) {
              props.put("user", username);
          }
  
          if (password != null) {
              props.put("password", password);
          }
  
          return JDBCDriver.getConnection(database, props);
      }
docs: <p>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
  @exception SQLException if a database access error occurs