 ps = connection.prepareStatement("SELECT TRAYID, COUNT(PlaceNo) AS OCCUPIED " +                                             "FROM PLACE " +                                             "GROUP BY TRAYID " +                                             "HAVING TRAYID = ?");  