记录一下工作的问题

博客围绕Java和MyBatis开发展开,提及嵌入式数据库配置、@ConfigurationProperties用法,还列举了多个开发中常见问题,如MyBatis查询无Result Maps、时间转换错误、参数找不到、找不到xml中sql以及SQL的IO错误等,并给出部分问题的解决办法。

 

1、Action:
Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
1、If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

解决 : @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

2、@ConfigurationProperties 的基本用法非常简单:我们为每个要捕获的外部属性提供一个带有字段的类。请注意以下几点:

前缀定义了哪些外部属性将绑定到类的字段上
根据 Spring Boot 宽松的绑定规则,类的属性名称必须与外部属性的名称匹配
我们可以简单地用一个值初始化一个字段来定义一个默认值
类本身可以是包私有的
类的字段必须有公共 setter 方法

3、org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.petrochina.e7.pcep.data.mapper.mysqlMapper.DateMapper.selectDate'.  It's likely that neither a Result Type nor a Result Map was specified.
 解决 : xml查询语句无返回类型

4、Cannot format given Object as a Date
时间转换错误

5、Parameter 'List' not found. Available parameters are [list, param1]
@param("  ?")与xml中循环的collection是否一致

6、org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): *****.oracleMapper.SaveInstMapper.selectAll
找不到xml中的sql

7、 java.sql.SQLRecoverableException: IO 错误: Socket read interrupted

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值