欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

“,”附近有语法错误,dbutils关键字错误

程序员文章站 2022-03-01 17:00:56
...
String sql = "SELECT username, password FROM customer " + "WHERE (username = ?) AND (password = ?)";

用dbutils时遇到很无语的报错

java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: “,”附近有语法错误。 Query: SELECT username, password FROM customer WHERE (username = ?) AND (password = ?) Parameters: [admin, admin]

解决方法:在(username = ?) AND (password = ?)在username和password前面加一个空格

转载于:https://my.oschina.net/u/2268567/blog/828522