code: public static Connection connect(final Driver driver, final String url,
                                       final String user, final String pass) 
          throws SQLException {
          
          final Properties props = new Properties();
  
          props.put("user", user);
          props.put("password", pass);
  
          return driver.connect(url, props);
      }
docs: Returns connection using given |driver|.
  
  @param driver JDBC driver
  @param url JDBC url
  @param user DB user name
  @param pass Password for DB user