`

Cannot convert value '0000-00-00 00:00:00' from column 19 to TIMESTAMP.

阅读更多

### Error querying database.  Cause: java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 19 to TIMESTAMP.
### The error may involve com.dajie.core.user.dao.UserDao.getByUid-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 19 to TIMESTAMP.

 

解决方法:修改数据库链接的参数

jdbc:mysql://192.168.1.10:3336/DB_XXX?zeroDateTimeBehavior=convertToNull&autoCommit=true&autoReconnect=true&useUnicode=true&tinyInt1isBit=false&characterEncoding=UTF-8&yearIsDateType=false

 

注意:

zeroDateTimeBehavior=convertToNull 参数最好放到第一位,放在后面可能会失效。

分享到:
评论

相关推荐

    mysql的timestamp类型字段为'0000-00-00 00:00:00'导致mybatis映射时报错解决方法

    在MySQL中,`TIMESTAMP`字段允许最小值'1970-01-01 00:00:01'和最大值'2038-01-19 03:14:07',但'0000-00-00 00:00:00'是作为一个特殊的无效日期值存在。当你试图插入一个非有效日期或者不指定日期时,某些情况下,...

    MySQL 8.0.13设置日期为0000-00-00 00:00:00时出现的问题解决

    刚开始学习数据库操作,今天存数据时发现,保存的时候报错(Error 1292: Incorrect datetime value: '0000-00-00' for column 'deleted_at' at row 1) ,之后就搜索了下原因,是因为MySQL存日期时不允许出现这种格式...

    maven-timestamp-plugin-1.0.jar

    maven-timestamp-plugin-1.0.jar

    java中日期格式的转换

    在Java中,`java.util.Date`类用于表示一个特定的瞬间,即从格林尼治时间1970年1月1日00:00:00开始计算的毫秒数。为了将日期转换为人类可读的格式,我们需要使用`java.text.SimpleDateFormat`类,它可以按照我们定义...

    北京时间日期转时间戳、时间戳转北京时间日期

    time: 2012-01-01 00:00:00 timeStamp: 1538409599; time: 2018-10-01 23:59:59 timeStamp: 888645574; time: 1998-02-28 13:59:34 timeStamp: 1582991999; time: 2020-02-29 23:59:59 timeStamp: 1204300800; time...

    探讨:sql插入空,默认1900-01-01 00:00:00.000的解决方法详解

    在SQL Server中,当我们在一个定义为`datetime`类型的字段中尝试插入空值或空白字符串时,系统通常会默认填充1900-01-01 00:00:00.000作为日期时间值。这是因为`datetime`类型不接受空值(NULL),如果未提供有效值...

    mysql5.7.19安装包64位rpm格式

    2017-06-05T14:30:52.709474Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-06-05...

    hbase-2.4.11-bin.tar.gz

    在HBase中,数据存储在表中,每个表由行键(Row Key)、列族(Column Family)、列限定符(Column Qualifier)和时间戳(Timestamp)四部分组成。这种结构使得HBase非常适合处理大规模稀疏数据集。 HBase的2.4.11...

    最新版linux logstash-7.15.2-linux-x86_64.tar.gz

    match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{WORD:level}: %{GREEDYDATA:message}" } } date { match => [ "timestamp", "ISO8601" ] } } output { elasticsearch { hosts => ["localhost:...

    最新版linux logstash-7.16.1-linux-x86_64.tar.gz

    2. 数据过滤:通过grok过滤器解析日志格式,提取关键信息,如`filter { grok { match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{WORD:level}: %{GREEDYDATA:message}" } } }`。 3. 数据转发:利用...

    Python库 | drf-timestamp-pagination-0.1.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:drf-timestamp-pagination-0.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    PHP 时间戳和日期时间转换

    $dateString = '2022-01-01 12:00:00'; $timestamp = strtotime($dateString); ``` 对于更复杂的日期时间操作,`DateTime`类是更好的选择。创建一个`DateTime`对象,你可以使用日期时间字符串或时间戳: ```php $...

    TDengine-server-2.0.9.0-Linux-x64.tar.gz

    - **插入数据**:使用`INSERT INTO tb_name VALUES (timestamp, value);`将数据写入表。 - **查询数据**:利用优化的SQL引擎执行快速查询,例如`SELECT * FROM tb_name WHERE ts BETWEEN t1 AND t2;`。 - **备份...

    maven-timestamp-plugin-1.2.jar

    maven-timestamp-plugin-1.2.jar

    maven-timestamp-plugin-0.1.jar

    maven-timestamp-plugin-0.1.jar

    maven-timestamp-plugin-1.2-sources.jar

    maven-timestamp-plugin-1.2-sources.jar

    maven-timestamp-plugin-1.0-sources.jar

    maven-timestamp-plugin-1.0-sources.jar

    php.ini-development

    To disable this feature set this option to empty value ;user_ini.filename = ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) ;user_ini.cache_ttl = ...

    hbase-1.3.2.1-bin.tar.gz

    此外,每个记录还有列族(Column Family)、列限定符(Column Qualifier)和时间戳(Timestamp)等组成部分,这构成了完整的键值对。 4. 实时读写:HBase支持实时读写操作,即使面对海量数据,也能提供亚秒级的响应...

    【源码阅读】 protobuf 中的 timestamp 包

    文章目录Timestamptimestamp.go如何使用 Timestamp path: google/protobuf/timestamp.proto 在 timestamppb 中 Timestamp 包含两个字段 seconds 表示秒 nanos 表示纳秒 message Timestamp { int64 seconds = 1; ...

Global site tag (gtag.js) - Google Analytics