mysql中datetime类型字段为默认值0000-00-00 00:00:00怎么取出来
答案:1 悬赏:40 手机版
解决时间 2021-02-20 16:53
- 提问者网友:星軌
- 2021-02-20 01:42
mysql中datetime类型字段为默认值0000-00-00 00:00:00怎么取出来
最佳答案
- 五星知识达人网友:青灯有味
- 2021-02-20 02:31
然后网上搜素了一下解决方案如下:原来是jdbc连接的问题
改成这样jdbc:mysql://localhost:3306/brilliant?user=conglin&password=conglin&useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNullDatetimes with all-zero components (0000-00-00 ...) — These values can not be represented 关于所有Datetime类型由0组成的数据,这些值不能在java中被可靠的表示
reliably in Java.
Connector/J 3.0.x always converted them to NULL when being read from a ResultSet.
当这些值正在从ResultSet容器中读取时候,Connector/J 3.0.x 一直把他们转换为NULL值。
改成这样jdbc:mysql://localhost:3306/brilliant?user=conglin&password=conglin&useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNullDatetimes with all-zero components (0000-00-00 ...) — These values can not be represented 关于所有Datetime类型由0组成的数据,这些值不能在java中被可靠的表示
reliably in Java.
Connector/J 3.0.x always converted them to NULL when being read from a ResultSet.
当这些值正在从ResultSet容器中读取时候,Connector/J 3.0.x 一直把他们转换为NULL值。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯