郁闷ying,哪位知道这句update语句错在哪呀?
数据库表结构:
表名:book
字段:bookId(文本型),categoryId(文本型),name(文本型),author(文本型),publisher(文本型),
price(数字 注:双精度),pic(文本型),desc(备注)
更新语句如下:
PreparedStatement psmt=con.prepareStatement("update book set categoryId=?,name=?,author=?,publisher=?,price=?,pic=?,desc=? where bookId=?");
psmt.setString(1,"computer");
psmt.setString(2,"计算机组成原理");
psmt.setString(3,"张和");
psmt.setString(4,"清华出版社");
psmt.setFloat(5,50.5);
psmt.setString(6,"image1");
psmt.setString(7,"经典教材");
psmt.setString(8,"ISN-001");
psmt.executeUpdate();
总是出现错误:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误。
怎么看也不知道看不出什么错误,郁闷死了!
小弟在此谢过。
问题点数:30、回复次数:1Top
1 楼changechange(http://access911.net 是我的个人网站,欢迎光临)回复于 2005-06-05 10:51:52 得分 30
desc 是保留字,你的SQL 语句肯定错误了
update [book] set [categoryId]=?,[name]=?,[author]=?,[publisher]=?,[price]=?,[pic]=?,[desc]=? where [bookId]=?");
关于此主题请参考:
新手来看:找不到帮助的来看:jet sql保留字《查询》
http://access911.net/index.asp?u1=a&u2=74FAB61E16DC
Top




