idea连接数据库报错java.sql.SQLException: You have an error in your SQL syntax;
报错:java.sql.SQLException: 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 ''username',password,email) values('ww',
·
报错:
java.sql.SQLException: 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 ''username',password,email) values('ww','admin','admin@atguigu.com')' at line 1 Query: insert into t_user('username',password,email) values(?,?,?) Parameters: [ww, admin, admin@atguigu.com]
我的错误是在UserDaoImpl包下的实现类saveUser
别在属性名前加引号!!!!!!!!!!!!!!
错误写法:
String sql = "insert into t_user('username','password','email') values(?,?,?)";
正确写法:
String sql = "insert into t_user(username,password,email) values(?,?,?)";
更多推荐
已为社区贡献1条内容
所有评论(0)