public int getUnreadMessage(){
        int remaining = 0;
        try {
            PreparedStatement checkCount = connection.prepareStatement(
                "select min(msg_seq) from hl7_q where read_flag is null");
        
            ResultSet rs = checkCount.executeQuery();
            while (rs.next()){
                remaining = rs.getInt(1);
                System.out.println("DBLoader.getUnreadMessage: " + remaining);
            }
            checkCount.close();
        } catch (SQLException se) {
            System.out.println("Error in DBLoader.getUnreadMessage: " + se);
        }
        
        return remaining;
    }