Package juNetMonitor.dataStructures

Examples of juNetMonitor.dataStructures.monitorItem


    public void retrieveData() {
        Statement   sql = null;
        ResultSet   rs = null;
        String      stmt;
        hostItem    host;
        monitorItem monitor;
       
        dbConnection();
        hostList.clear();
        monitorList.clear();
       
        try {
            // Retrieve hosts
            sql = DBconn.createStatement();
            stmt  = "SELECT h.id, h.name hostname, h.address, h.status, h.maxstatus, g.name groupname ";
            stmt += "FROM hosts h, groups g ";
            stmt += "WHERE h.group = g.id";
           
            rs = sql.executeQuery(stmt);
            while (rs.next()) {
                host = new hostItem();
               
                host.id = rs.getInt("id");
                host.status = rs.getInt("status");
                host.maxStatus = rs.getInt("maxstatus");
                host.name = rs.getString("hostname");
                host.address  = rs.getString("address");
                host.group = rs.getString("groupname");
               
                hostList.add(host);
            }
           
            // Close query
            rs.close();
           
            // Retrieve monitor threads
            stmt  = "SELECT id, type, param, lastcheck, laststatus ";
            stmt += "FROM monitor m ";
           
            rs = sql.executeQuery(stmt);
            while (rs.next()) {
                monitor = new monitorItem();
               
                monitor.id = rs.getInt("id");
                monitor.param = rs.getString("param");
                monitor.type = rs.getString("type");
                monitor.checkStatus = rs.getBoolean("laststatus");
View Full Code Here

TOP

Related Classes of juNetMonitor.dataStructures.monitorItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.