【发布时间】:2018-07-01 12:18:51
【问题描述】:
"SELECT * FROM products WHERE product_name = ?";
This is the error message i am getting
String sql = "SELECT * FROM posdb.products WHERE products.product_name = ?";
PreparedStatement ps = myCon.CreateConnection().prepareStatement(sql);
这是我收到的错误消息:
You have an error in your sql statement, check the manual that
corresponds to your MariaDB server version for the right
syntax to use near '?' at line 1
【问题讨论】:
-
请将您的错误消息和代码以代码格式的文本形式发布。否则我们很难复制、粘贴和尝试运行它。此外,由于防火墙限制,这里有些看不到图像。还请在您的问题中提供更多详细信息,包括解释性文本和背景信息——任何有助于我们更好地理解您的代码、问题和问题的内容。请通过How to Ask。
-
这是错误消息“您的 sql 语句有错误,请查看与您的 MariaDB 服务器版本相对应的手册,以了解在 '?' 附近使用的正确语法。在第 1 行