`
ruilin521314
  • 浏览: 881335 次
文章分类
社区版块
存档分类
最新评论

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

 
阅读更多

今下午一连遇到了俩错误, 都是比较低级的

只能说是基础不到家, 唉。。。。。。。。。。

ResultSet rs = pstmt.executeQuery(psql); 运行【完】这的时候 会抛出一个异常:

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:

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 '?' at line 1

============================================

在解决问题的时候 一直围绕着 “参数”-- ? --求解,但是。。。。

没有留意executeQuery () 的用法

executeQuery 一个是不带参数的, 另一个是带参数的:

二者之间的区别

executeQuery()是 pstmt 中的方法

executeQuery(sql) 是继承自stmt中的方法

=============================================

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics