@Override
    public boolean isBookExisted(final Book book) {
        Connection conn = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        boolean existed = false;

        try {
            conn = dataSource.getConnection();
            stmt = conn.prepareStatement("SELECT COUNT(1) FROM BOOK WHERE BOOK_NAME=?");
            stmt.setString(1, book.getBook_Name());
            rs = stmt.executeQuery();
            while (rs.next()) {//必須要有游標next才取的到值
                existed = (rs.getInt(1) >= 1);
            }
        } catch (SQLException ex1) {
            Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
        } finally {
            if (rs != null) {
                try {
                    rs.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
            if (stmt != null) {
                try {
                    stmt.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
        }
        return existed;
    }