public boolean ensureConnection() {
    if (conn == null) {
      try {
        if (databaseUrl != null) {
          conn = DriverManager.getConnection(databaseUrl);
        }
      } catch (Exception e) {
        logger.warn("Error during getConnection: " + e.toString());
      }
    }
    return conn != null;
  }
This class stores published metrics to the SQL Server database.
contrib/ambari-scom/metrics-sink/src/main/java/org/apache/hadoop/metrics2/sink/SqlSink.java