1.oracle数据库连接问题
正常的oracle数据库连接信息
datasource.url=jdbc:oracle:thin:@localhost:1521:orcl
可以使用图形化界面连接,但是在springboot2.0代码中就是连不上;
报这个错:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
解决办法:
datasource.url=jdbc:oracle:thin:@(description=(address=(protocol=tcp)(port=1521)(host=127.0.0.1))(connect_data=(service_name=orcl)))
2.Mybatis不能批量操作
在数据库配置信息后加上(意思就是允许批量操作)
jdbc.url &allowMultiQueries=true
3.使用Navicat连接sqlServer2012
//别人可以连接,自己连不上,连接信息没问题,就是连不上;
08001 -TCP Provider:Timeout error
[258] HYT00 -Login timeout expired
08001 -Unable to complete login process due to delay in prelogin response
不要勾选IPv6,更新网络配置,重新连接,就可以了。
4.mysql数据库中有’0000-00-00 00:00:00’时间类型的值,代码取值时报错
//在url后加上后,出现'0000-00-00 00:00:00'时间值为null
&zeroDateTimeBehavior=convertToNull
5.org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface
poi导入异常,加上@RequestParam(“excel”)注解即可,这里的 “excel” 根据前台来写
//poi导入异常:
原来的参数:( MultipartFile excel)
修改后:(@RequestParam("excel") MultipartFile excel)
6.IDEA不编译resources下的文件
错误信息就不写了,意思就是找不到resources下的配置文件
在pom文件中加上这个就行了
<build>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
7.导入sql到数据库的问题
错误信息提示 ‘0000-00-00 00:00:00’ 这样的值有问题;
SHOW SESSION VARIABLES LIKE '%sql_mode%';
SET sql_mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";