为了账号安全,请及时绑定邮箱和手机立即绑定

跨域成功之后,debug已经从session得到值了,但是注册失败,信息如下

### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.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

### The error may involve com.miaoshaproject.dao.UserPasswordDOMapper.insertSelective-Inline

### The error occurred while setting parameters

### SQL: insert into user_password

### Cause: com.mysql.jdbc.exceptions.jdbc4.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

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.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] with root cause


com.mysql.jdbc.exceptions.jdbc4.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


正在回答

2 回答

UserDOMapper.xml

id="insertSelective" 中添加
keyProperty="id" useGeneratedKeys="true"
UserServiceImpl中
//实现model转成do(dataobject)方法
UserDO userDO=convertFormModel(userModel);
userDOMapper.insertSelective(userDO);
后添加
userModel.setId(userDO.getId());


1 回复 有任何疑惑可以回复我~
#1

慕容3596821

棒!!
2021-07-04 回复 有任何疑惑可以回复我~
#2

qq_慕尼黑3458450

改了之后还是报错Invalid bound statement (not found): com.secondkill1project.dao.UserInfoDOMapper.insertSelective]
2021-08-10 回复 有任何疑惑可以回复我~

insertByPrimaryKey中加这个没:

keyProperty="id" useGeneratedKeys="true"


0 回复 有任何疑惑可以回复我~
#1

dpq592 提问者

谢谢,看到后面发现了,很感谢
2021-03-07 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

跨域成功之后,debug已经从session得到值了,但是注册失败,信息如下

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信