/**
   * Creates a new physical connection for the given host:port and updates required internal
   * mappings and statistics for that connection.
   *
   * @param hostPortSpec
   * @return
   * @throws SQLException
   */
  private synchronized Connection createConnectionForHost(String hostPortSpec) throws SQLException {
    Properties connProps = (Properties) this.localProps.clone();

    String[] hostPortPair = NonRegisteringDriver.parseHostPortPair(hostPortSpec);

    if (hostPortPair[1] == null) {
      hostPortPair[1] = "3306";
    }

    connProps.setProperty(NonRegisteringDriver.HOST_PROPERTY_KEY, hostPortSpec);
    connProps.setProperty(NonRegisteringDriver.PORT_PROPERTY_KEY, hostPortPair[1]);

    Connection conn =
        new Connection(
            hostPortSpec,
            Integer.parseInt(hostPortPair[1]),
            connProps,
            connProps.getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY),
            "jdbc:mysql://" + hostPortPair[0] + ":" + hostPortPair[1] + "/");

    this.liveConnections.put(hostPortSpec, conn);
    this.connectionsToHostsMap.put(conn, hostPortSpec);

    return conn;
  }