How to solve the problem of zeppelin mysql empty time field error in can not be represented as java.sql.Timestamp
This article mainly explains the "zeppelin mysql empty time field error can not be represented as java.sql.Timestamp how to solve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "zeppelin mysql empty time field error can not be represented as java.sql.Timestamp how to solve" it!
When using zeppelin to connect to mysql through jdbc, I encountered an error in the empty time field
Can not be represented as java.sql.Timestamp
Solution:
Solution:
Add the zeroDateTimeBehavior parameter to jdbc url:
Datasource.url=jdbc:mysql://localhost:3306/dbName?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
ZeroDateTimeBehavior=round is used to specify how the default value of the DateTime field in MySql should be handled when querying; the default is to throw an exception
For records with a value of 0000-00-0000: 00:00 (the default), different results will be returned in the following two configurations:
ZeroDateTimeBehavior=round 0001-01-01 0014 00.0
ZeroDateTimeBehavior=convertToNull null
As shown below:
Thank you for your reading, the above is the "zeppelin mysql empty time field error can not be represented as java.sql.Timestamp how to solve" content, after the study of this article, I believe you on the zeppelin mysql empty time field error can not be represented as java.sql.Timestamp how to solve this problem has a more profound experience, the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!