zoukankan      html  css  js  c++  java
  • 扫移动护理系统mysql数据库视图的Database通讯点报错Caused by: java.sql.SQLException: Value '00000000 00:00:00' can not be represented as java.sql.Timestamp

    116集成平台上扫移动护理系统输血情况数据,通讯点Database不出消息,报错

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

     百度解决:

    在使用MySql 时, 数据库中的字段类型是timestamp的,默认为0000-00-00, 会发生异常:java.sql.SQLException:   Value   '0000-00-00 '   can   not   be   represented   as   java.sql.Timestamp


    解决办法:

    给jdbc   url加上   zeroDateTimeBehavior参数:

    datasource.url=jdbc:mysql://localhost:3306/testdb?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true


    zeroDateTimeBehavior=round是为了指定MySql中的DateTime字段默认值查询时的处理方式;默认是抛出异常,

    对于值为0000-00-00   00:00:00(默认值)的纪录,如下两种配置,会返回不同的结果:

    zeroDateTimeBehavior=round   0001-01-01   00:00:00.0

    zeroDateTimeBehavior=convertToNull   null  

    集成平台中进行配置:

    参考:

  • 相关阅读:
    内核模块的一些问题
    [转]change the linux startup logo
    raspbian 静态IP
    [转]centos7 配置yum源(本地+光盘)
    [转]source inslght使用指导
    T420修改wifi灯闪动模式
    root运行chrome
    [转]理解阻塞非阻塞与同步异步
    [转] 计算机体系架构分类
    Win7下安装 Oracle Virtual Box
  • 原文地址:https://www.cnblogs.com/yr1126/p/15791196.html
Copyright © 2011-2022 走看看