@Override
    public void create(Book book) throws IllegalArgumentException, DAOException {
        Object[] values = {
            book.getReference(),
            book.getType(),
            book.getTitle(),
            book.getAuthor(),
            book.getStatus().getId()
        };

        Connection connection= null;
        PreparedStatement preparedStatement = null;
        ResultSet generatedKeys = null;

        try {
            connection = daoFactory.getConnection();
            preparedStatement = prepareStatement(connection, SQL_INSERT, true, values);
            int affectedRows = preparedStatement.executeUpdate();
            if (affectedRows == 0) {
                throw new DAOException("Creating book failed, no rows affected.");
            }
            generatedKeys = preparedStatement.getGeneratedKeys();
            if (!generatedKeys.next()) {
                throw new DAOException("Creating Book failed.");
            }
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            close(connection, preparedStatement, generatedKeys);
        }
    }