java.sql.SQLSyntaxErrorException: 不支持“INTEGER”与“CHAR (UCS_BASIC)”之间的比较。类型必须可比较。此外,字符串类型必须具有匹配的对照顺序。如果对照顺序不匹配,一种可能的解决方案是:强制转换操作数以强制使其使用缺省对照顺序(例如 SELECT tablename FROM sys.systables WHERE CAST(tablename AS VARCHAR(128)) = 'T1')
这个错误按照自己的水平实在改不了了(忙活了半天了),请各位大虾指教指教
String sql = "UPDATE app.BOOK SET BOOK_NAME='" + book.getBOOK_NAME()
+ "',BOOK_INTRO='" + book.getBOOK_INTRO() + "',BOOK_PRICE='"
+ book.getBOOK_PRICE() + "', TYPE_ID_FK='" + book.getTYPE_ID_FK()
+ "',PUB_ID_FK='" + book.getPUB_ID_FK() + "',IMAGE_URL='"
+ book.getIMAGE_URL() + "',reperiory_size = '" + book.getREPERTORY_SIZE()
+ "', AUTHOR='" + book.getAUTHOR()
+ "' WHERE ID='" + book.getID()
+ "'";
BOOK表中ID的类型为Integer
------解决方案--------------------------------------------------------
+ "' WHERE ID='" + book.getID() + "'";
// 这里就不用加引号了呀
+ "' WHERE ID=" + book.getID() + "";
------解决方案--------------------------------------------------------
看表, 有哪些地方是唯一的,
还有, 你那表有外键, 把两表一起删了再重新建下试试,