Contents ...
udn網路城邦
some of java
2011/08/24 11:02
瀏覽119
迴響0
推薦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("")
全站分類:休閒生活 其他
自訂分類:天天
上一則: some of Fileupload
下一則: some of MySQL
你可能會有興趣的文章:

限會員,要發表迴響,請先登入