網路城邦
上一篇 回創作列表 下一篇   字體:
some of java
2011/08/24 11:02:37瀏覽96|回應0|推薦0
#
Runtime :

#
java.sql.SQLException:Value '0000-00-00' can not be represented as java.sql.Date
問題:
 数据表中有记录的time字段(属性为timestamp)其值为:“0000-00-00 00:00:00”,會發生以上錯誤
姐絕:
 给jdbc url加上 zeroDateTimeBehavior参数: 

 datasource.url=jdbc:mysql://localhost:3306/pe?useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNull


#
程式執行時,取得當前路徑:
Thread.currentThread().getContextClassLoader().getResource("")
( 休閒生活其他 )
回應 推薦文章 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=Tyue&aid=5574800