String strSQL = "select UserId form USER where Name='showjan'"; //------1
//String strSQL = "select UserID from USER"; //------2
try{
ResultSet sqlRst = db.executeQuery(strSQL); if (sqlRst.next()){ .....
我用2时没任何问题问题,但用1时报“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 'USER where Name='showjan'' at line 1”的异常。我数据库为MySql5.1.
调度在MyEclipse
前提,数据库中有Name为showjan的纪录。
我对MySql不熟,是否有什么没配对?
//String strSQL = "select UserID from USER"; //------2
try{
ResultSet sqlRst = db.executeQuery(strSQL); if (sqlRst.next()){ .....
我用2时没任何问题问题,但用1时报“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 'USER where Name='showjan'' at line 1”的异常。我数据库为MySql5.1.
调度在MyEclipse
前提,数据库中有Name为showjan的纪录。
我对MySql不熟,是否有什么没配对?
你直接用的单引号还是全角的吧,转义一下
注意,关键字要用反引号括起来,这个符号在键盘上的 TAB键上面,感叹号旁边。