public void run() {
      boolean running = true;

      log.debug("SQLMonitor running");

      while(running) {
        log.debug("Calling Mysql");

        ResultSet rs = null;
        Connection conn = null;

        try {
          conn = getConnection();
          Statement s = conn.createStatement();
          rs = s.executeQuery(config.getDbQuery());

          while (rs.next()) {
            String term = rs.getString(1).intern();

            //Only send the term to the queue if it hasn't appeared in the last set of terms sent
            if(!last10terms.contains(term)) {
              log.debug("Found New Term: " + term);
              if(last10terms.size() == config.getDbQueryLimit()) {
                last10terms.remove(0);
              }
              last10terms.add(term);
              queue.put(term);
            }
          }

          conn.close();
        } catch(SQLException e) {
          log.error("Error: " + e.getMessage());
        }

        try {
          log.debug("Sleeping for 30 seconds.");
          Thread.sleep(30000);
        } catch(InterruptedException ex) {
          running = false;
        }
      }
    }