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

来源:3-11 用户模型管理--用户注册功能实现02

dpq592

2021-03-06 16:54

### 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回答

  • qq_慕仙6520305
    2021-07-04 16:59:26

    UserDOMapper.xml

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


    qq_慕尼黑...

    改了之后还是报错Invalid bound statement (not found): com.secondkill1project.dao.UserInfoDOMapper.insertSelective]

    2021-08-10 22:23:55

    共 2 条回复 >

  • 慕姐6185899
    2021-03-07 02:57:10

    insertByPrimaryKey中加这个没:

    keyProperty="id" useGeneratedKeys="true"


    dpq592

    谢谢,看到后面发现了,很感谢

    2021-03-07 22:05:17

    共 1 条回复 >

SpringBoot构建电商基础秒杀项目

应用SpringBoot快速搭建拥有用户、商品、交易及秒杀活动的电商秒杀应用。

49543 学习 · 978 问题

查看课程

相似问题