-
Notifications
You must be signed in to change notification settings - Fork 0
Development diary
playersun edited this page Dec 4, 2015
·
5 revisions
Welcome to the jee-basic-function wiki!
JUnit 测试的时候使用AbstractTransactionalJUnit4SpringContextTests会导致事务自动回滚。
tomcat 在server.xml 中 <Connector 中添加 URIEncoding="UTF-8" 解决Jqurey getJSON乱码问题
参考spring data jpa中CrudRepository
新增CrudDao,抽象出findById,insert,update,delete等方法
读取用户表的信息出现
java.sql.SQLException:Value '0000-00-00' can not be represented as java.sql.Date
的错误
解决方法是: 给jdbc url加上 zeroDateTimeBehavior参数: datasource.url=jdbc:mysql://localhost:3306/pe?useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNull
zeroDateTimeBehavior=round是为了指定MySql中的DateTime字段默认值查询时的处理方式;默认是抛出异常, 对于值为0000-00-00 00:00:00(默认值)的纪录,如下两种配置,会返回不同的结果:
- zeroDateTimeBehavior=round 0001-01-01 00:00:00.0
- zeroDateTimeBehavior=convertToNull null