code: private List<Metric> checkAlive(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
  
          List<Metric> metricList = new ArrayList<Metric>();
          Statement stmt = null;
          ResultSet rs = null;
          
          long lStart = System.currentTimeMillis();
  
          try {
              stmt = c.createStatement();
              rs = stmt.executeQuery(QRY_CHECK_ALIVE);
  
              if (!rs.next()) {
                  // Should never happen...
                  throw new SQLException("Unable to execute a 'SELECT SYSDATE FROM DUAL' query");
              }
  
              long elapsed = (System.currentTimeMillis() - lStart) / 1000L;
  
              metricList.add(new Metric("conn", "Connection time : " + elapsed + "s", new BigDecimal(elapsed), new BigDecimal(0), null));
  
              return metricList;
  
          } finally {
              DBUtils.closeQuietly(rs);
              DBUtils.closeQuietly(stmt);
          }
      }
docs: Checks if the database is reacheble.
  
  @param c
  The connection to the database
  @param cl
  The command line as received from JNRPE
  @return The plugin result
  @throws BadThresholdException
  -
  @throws SQLException