public Book isAvailable(Book book, Connection con) {
		boolean hasToCreate = false;
		if (con == null) {
			try {
				con = DBConnection.getConnection();
				hasToCreate = true;
			}

			catch (Exception e) {
				e.printStackTrace();
			}
		}

		try {
			MasterBook masterbook = MasterBookDAL.findMasterBook(
					book.getMasterbook(), con);
			book.setMasterbook(masterbook);
			if (masterbook != null) {
				pstmt = con.prepareStatement(BOOKS_CHECK_STATUS);
				pstmt.setInt(1, book.getMasterbook().getIsbn());
				ResultSet rs = pstmt.executeQuery();

				if (rs.next()) {
					book.setBookID(rs.getInt(1));
					book.setStatus(rs.getBoolean(2));

				}

				pstmt = con.prepareStatement(BOOKS_GET_DATES);
				pstmt.setInt(1, book.getBookID());
				pstmt.executeQuery();
				if (rs.next()) {
					book.setIssuedate(rs.getTimestamp(1));
					book.setDuedate(rs.getTimestamp(2));

				}
				return book;
			}

		}

		catch (Exception e) {
			e.printStackTrace();
		}

		finally {
			if (hasToCreate)
				DBConnection.closeObjects(null, con, pstmt);
		}
		return (null);

	}