Datetime 无法转换值';0000-00-00:00:00';从第3列到glassfish中的时间戳

Datetime 无法转换值';0000-00-00:00:00';从第3列到glassfish中的时间戳,datetime,jdbc,glassfish,Datetime,Jdbc,Glassfish,获取错误无法将第3列中的值“0000-00-00 00:00:00”转换为glassfish中的时间戳 我已经设置好jdbc:mysql://192.168.100.23:3307/training?zeroDateTimeBehavior=convertToNull 在我的JDBC连接池属性上 怎么了?可能的原因和解决方案- 您的列3的类型为DATETIME&您正试图对其操作时间戳 在hibernate.cfg.xml中: 敞篷车 在hibernate.properties中: hiberna

获取错误无法将第3列中的值“0000-00-00 00:00:00”转换为glassfish中的时间戳

我已经设置好jdbc:mysql://192.168.100.23:3307/training?zeroDateTimeBehavior=convertToNull 在我的JDBC连接池属性上


怎么了?

可能的原因和解决方案-

  • 您的列3的类型为
    DATETIME
    &您正试图对其操作
    时间戳

  • 在hibernate.cfg.xml中: 敞篷车

  • 在hibernate.properties中:

    hibernate.connection.zeroDateTimeBehavior=convertToNull
    
    JBOSS的mysql-ds.xml文件为:

    <connection-property name="zeroDateTimeBehavior">convertToNull</connection-property>
    
    convertToNull
    
    有些代码可能有用……我使用的是glassfish而不是JBOSS。