public static MasterBook findMasterBook(MasterBook masterbook, Connection con) {

		List<Author> authors = new ArrayList<Author>();
		List<Category> categories = new ArrayList<Category>();

		if (con == null) {
			try {
				con = DBConnection.getConnection();
				hasToCreate = true;
			} catch (Exception e) {

				e.printStackTrace();
			}
		}

		try {
			pstmt = con.prepareStatement(MASTER_BOOK_SELECT);
			pstmt.setInt(1, masterbook.getIsbn());
			ResultSet rs_select = pstmt.executeQuery();

			if (rs_select.next()) {
				masterbook.setTitle(rs_select.getString(1));
				masterbook.setPublisher(rs_select.getString(2));

				pstmt = con.prepareStatement(MASTER_BOOK_AUTHOR);
				pstmt.setInt(1, masterbook.getIsbn());
				ResultSet rs = pstmt.executeQuery();
				logger.info("The result set is in the following format: AuthorName,AuthorID");
				int i = 0;
				while (rs.next()) {
					authors.add(new Author());
					authors.get(i).setAuthorName(rs.getString(1));
					authors.get(i).setAuthorID(rs.getInt(2));
					i++;
				}
				masterbook.setAuthors(authors);
				pstmt = con.prepareStatement(MASTER_BOOK_CATEGORY);
				pstmt.setInt(1, masterbook.getIsbn());
				rs = pstmt.executeQuery();
				logger.info("The result set is in the following format: CategoryName,CategoryID");
				i = 0;
				while (rs.next()) {

					categories.add(new Category());
					categories.get(i).setCategoryName(rs.getString(1));
					categories.get(i).setCategoryID(rs.getInt(2));
					i++;
				}
				masterbook.setCategories(categories);
				logger.info("The masterbook object has been made and is being sent to process");
				return masterbook;
			}

		}

		catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (hasToCreate)
				DBConnection.closeObjects(null, con, pstmt);
		}
		logger.info("The isbn-query returned false. Null reference is being returned");
		return null;

	}