Preparing: insert into user(uuid,username,gender,age,phone,address) values(?,?,?,?,?,?,?)

报错内容:
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@764a554f] was not registered for synchronization because synchronization is not active
JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@11c9cf49] will not be managed by Spring
==> Preparing: insert into user(uuid,username,gender,age,phone,address,email,salary) values(?,?,?,?,?,?,?)
==> Parameters: 李四(String), 男(String), 25(Integer), 15567878787(String), null, null, 0.0(Float)
==> Parameters: 57f79f55-617b-4680-9e5e-6091d738d14d(String), 李四(String), 男(String), 25(Integer), 15567878787(String), null, null, 0.0(Float)
2022-08-25 20:42:09.053 ERROR 14916 — [nio-8080-exec-1] druid.sql.Statement : {conn-10050, pstmt-20000} execute error. insert into user(uuid,username,gender,age,phone,address,email,salary) values(?,?,?,?,?,?,?,?)
在这里插入图片描述
解决办法:
引起该错误的原因不止一个,目前我遇到的情况是由于uuid字段的长度设置的过低,而经过postman传送的长度超额了,所以导致数据整体无法传送,因而报送500。
例如:我传送的uuid是e47e9329-8b6b-4c4f-8612-2139920425b4,而我在数据库中设置的该字段是varchar 4,将其改为varchar 50后,即可完成传送,报送200。
相关界面如下所示:
(1)postman传送失败和数据库字段配置的截图。
在这里插入图片描述
在这里插入图片描述
(2)postman传送成功和数据库字段配置更改后的截图。
在这里插入图片描述
在这里插入图片描述
注意:遇到这类错误的时候,在postman中往往发现不到任何有用的消息,此时就需要我们在程序运行的结果中寻找有用的错误报告,然后对症下药。

相关链接:
IntelliJ IDEA中构建Spring Boot的项目
Spring Boot中的配置文件(application.properties、application.yml与pom.xml)
ORM、JPA、Spring Data JPA和常用的五种访问数据库方式

SpringBoot–页面显示列表功能
SpringBoot–列表添加详情功能
SpringBoot–列表添加新增功能
SpringBoot–列表更新功能
SpringBoot–列表删除功能

SpringBoot的控制层注解(@Controller与@RestController)
SpringBoot的业务层注解(@Resource、@Autowired与@Qualifier)
SpringBoot的映射(@RequestMapping、@GetMapping与@PostMapping)
SpringBoot的函数参数(JavaBean对象、@RequestParam与@RequestBody)
SpringBoot的返回数据(@ResponseBody、返回templates下的网页 与 返回公共网页)

利用postman完成JSON串的发送功能(springboot)
利用postman完成数据的分页查询功能(springboot)
利用postman完成向数据库中添加数据的功能(springboot)

Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Preparing: insert into user(uuid,username,gender,age,phone,address) values(?,?,?,?,?,?,?)
Could not autowire. No beans of ‘UserMapper‘ type found.
Error starting ApplicationContext. To display the conditions report re-run your application with
Loading class com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is com.mysql.cj.jdb
Plugin ‘org.springframework.boot:spring-boot-maven-plugin:‘ not found
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
This application has no explicit mapping for /error, so you are seeing this as a fallback.
BootStrap-SpringBoot的使用过程中前端table表格无法加载出数据。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

慕斯-ing

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值