public CheckOut getCorrespondingCheckOut(long isbn, int patronNum) throws Exception {
	
		Connection connect = null;
		ResultSet resultSet = null;
		Statement statement = null;
		CheckOut co = new CheckOut();
		ReportHelper rHelper = new ReportHelper();
		
		try {
			
			connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456");
			statement = connect.createStatement();
			
			rHelper.createCheckOutView();
			
			resultSet = statement.executeQuery("SELECT * FROM NoReturnCheckOut NRC WHERE NRC.isbn = " + isbn + " AND NRC.cardNumber = " + patronNum
					+ " AND NRC.end <= ALL (SELECT end FROM NoReturnCheckOut WHERE isbn = " + isbn + " AND cardNumber = " + patronNum + ")");
			
			if(resultSet.next()){
				co.setIsbn(resultSet.getLong(1));
				co.setStart(resultSet.getTimestamp(2));
				co.setEnd(resultSet.getTimestamp(3));
				co.setCardNumber(resultSet.getInt(4));
				co.setIdNumber(resultSet.getInt(5));
			} else {
				return null;
			}
			
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
			throw e;
		}
		
			finally
			{
				try {

					statement.executeUpdate("DROP VIEW NoReturnCheckOut");
					
					if(connect != null){
						connect.close();
					}
					
					if(resultSet != null){
						resultSet.close();
					}
					
					
				} catch (Exception e) {	
					if(connect != null){
						connect.close();
					}
					
					if(resultSet != null){
						resultSet.close();
					}
					
				}
			}
		
		return co;
	}