try { String query = "Select ngayDatPhong as ngaydat from phieuthue where maKH = " + maKH + ""; PreparedStatement pstmt = this.conn.prepareStatement(query); ResultSet rs = pstmt.executeQuery(); System.out.println(rs); if (rs.next()) { thoigian = rs.getString("ngaydat"); } query_next = "SELECT FLOOR(HOUR(TIMEDIFF(now(), '" + thoigian + "')) / 24) As ngay, MOD(HOUR(TIMEDIFF(now(), '" + thoigian + "')), 24) as gio, MINUTE(TIMEDIFF(now(), '" + thoigian + "')) as phut"; PreparedStatement pstmt_next = this.conn.prepareStatement(query_next); ResultSet rs_next = pstmt_next.executeQuery(); System.out.println(rs); if (rs_next.next()) { arl.add(rs.getString("ngay")); arl.add(rs.getString("gio")); arl.add(rs.getString("phut")); } } catch (SQLException ex) { Logger.getLogger(HotelManger.class.getName()).log(Level.SEVERE, null, ex); } return arl;