问题描述

问题描述/异常栈

java.sql.SQLException: Zero date value prohibited

java.sql.SQLException: Value '0000-00-00 00:00:00 ' can not be represented as java.sql.Timestamp

User class threw exception: java.sql.SQLException: The connection property 'zeroDateTimeBehavior' acceptable values are: 'CONVERT_TO_NULL', 'EXCEPTION' or 'ROUND'. The value 'convertToNull' is not acceptable.

解决方案

数据源连接串添加属性, 
mysql5添加:zeroDateTimeBehavior=convertToNull 
mysql8添加:zeroDateTimeBehavior=CONVERT_TO_NULL

如:jdbc:mysql://entmail_mysql_rw3.dba.163.org:4333/fair_prd_hz?zeroDateTimeBehavior=convertToNull

或者在数据传输任务里面添加相关参数:如图所示

FAQ-timestamp字段的列为空值 数据为0000-00-00 00:00:00 - 图1 FAQ-timestamp字段的列为空值 数据为0000-00-00 00:00:00 - 图2

问题原因

未添加时间属性

作者:常惠渊