public static  void saveRentTransaction(RentTransaction rentTransaction){
		
		try {
			   if(conn == null || conn.isClosed()){
			    conn = DatabaseConnection.getConnection();
			   }
			  } catch (SQLException e1) {
			   // TODO Auto-generated catch block
			   e1.printStackTrace();
			  }
		
		try {
			conn.setAutoCommit(false);
			PreparedStatement stmnt = conn.prepareStatement("INSERT INTO RentTransactions(member_id, date_out, date_in, closed, staff_id)"
					+  " VALUES (?, ?, ?, ?, ?)");
			
			
			stmnt.setInt(1, rentTransaction.getMemberId());
			stmnt.setString(2, rentTransaction.getDateOut());
			stmnt.setString(3, rentTransaction.getDateIn());
			stmnt.setBoolean(4, rentTransaction.getClosed());
			stmnt.setString(5, rentTransaction.getStaffId());
			
			stmnt.execute();
			conn.commit();
			conn.setAutoCommit(true);
			
		}
		catch(SQLException e){
			System.out.println("SaveRent to DB fail!! - " + e);
		}
		

		try {
			Statement stmnt = conn.createStatement();
			String sql = "SELECT rent_trans_id FROM RentTransactions WHERE rent_trans_id = (SELECT MAX(rent_trans_id) FROM RentTransactions)";
			ResultSet res = stmnt.executeQuery(sql);
			if(res.next()){
				rentTransaction.setRentTransId(res.getInt("rent_trans_id"));
			}
		}
		catch(SQLException e){
			System.out.println("fail getting rent_trans_id: " + e);
		}
		 
		
			bookList = rentTransaction.getBookList();
			mediaList =  rentTransaction.getMediaList();
			meetingRoomList = rentTransaction.getMeetingRoomList();
			
			for (BookCopy b : bookList) {
				
				RentalDAO.saveRentalBook(rentTransaction.getRentTransId(), b.getCopyId());
				
			}
			
			for (MediaCopy m : mediaList) {
				
				RentalDAO.saveRentalMedia(rentTransaction.getRentTransId(), m.getMediaCopyID(), m.getType());
			}
			
			for(MeetingRoom mr : meetingRoomList) {
				
				RentalDAO.saveRentalMeetingRoom(rentTransaction.getRentTransId(), mr.getRoomID(), "room");
			}
			
			bookList = null;
			mediaList = null;
			meetingRoomList = null;
		
	
			
	}