Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of zeppelin mysql empty time field error in can not be represented as java.sql.Timestamp

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report