code: public static QueryExecutor openConnection(HostSpec[] hostSpecs, String user,
        String database, Properties info) throws SQLException {
      String protoName = PGProperty.PROTOCOL_VERSION.get(info);
  
      if (protoName == null || protoName.isEmpty() || "3".equals(protoName)) {
        ConnectionFactory connectionFactory = new ConnectionFactoryImpl();
        QueryExecutor queryExecutor = connectionFactory.openConnectionImpl(
            hostSpecs, user, database, info);
        if (queryExecutor != null) {
          return queryExecutor;
        }
      }
  
      throw new PSQLException(
          GT.tr("A connection could not be made using the requested protocol {0}.", protoName),
          PSQLState.CONNECTION_UNABLE_TO_CONNECT);
    }
docs: <p>Establishes and initializes a new connection.</p>
  
  <p>If the "protocolVersion" property is specified, only that protocol version is tried. Otherwise,
  all protocols are tried in order, falling back to older protocols as necessary.</p>
  
  <p>Currently, protocol versions 3 (7.4+) is supported.</p>
  
  @param hostSpecs at least one host and port to connect to; multiple elements for round-robin
  failover
  @param user the username to authenticate with; may not be null.
  @param database the database on the server to connect to; may not be null.
  @param info extra properties controlling the connection; notably, "password" if present
  supplies the password to authenticate with.
  @return the new, initialized, connection
  @throws SQLException if the connection could not be established.