报错:

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(?,?,?)";
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐