// Retrieve data from database
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");