mysql语句输入错误

String sql = "SELECT id,name,password,age,sex,hobby"+
"FROM newbook WHERE name LIKE ? OR password LIKE ? OR sex LIKE ? OR age LIKE ?";

出现错误You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

原因为hobby"这里少了一个空格,改为hobby " 之后正常。

posted @ 2012-05-07 19:52  myhloli  阅读(160)  评论(0编辑  收藏  举报