mysql datetime查詢異常問題處理。本站提示廣大學習愛好者:(mysql datetime查詢異常問題處理)文章只能為提供參考,不一定能成為您想要的結果。以下是mysql datetime查詢異常問題處理正文
mysql datetime查詢異常
異常:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp (2011-05-25 11:38:40)
描繪:非空無默許值的Datetime類型字段,查詢時順序報以下錯誤: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
處理辦法:數據庫銜接串添加zeroDateTimeBehavior參數或許noDatetimeStringSync參數jdbc:mysql://host:port/xxx?...
zeroDateTimeBehavior:取值exception、converToNull、round
exception---拋出異常:後果java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp。
converToNull:前往null值
round:前往0001-01-01 00:00:00.0
noDatetimeStringSync:設置為true,前往0000-00-00 00:00:00
感激閱讀,希望能協助到大家,謝謝大家對本站的支持!