1.如果mysql中使用了date類型,並且默認值為'0000-00-00',
那么數據庫中的'0000-00-00 00:00:00', '0000-00-00', '00:00:00'這三個值是相等的,都為空
2.在java中使用ResultSet的getString()返回結果時,如果出現如下異常:
java.sql.SQLException:Value '0000-00-00' can not be represented as java.sql.Date
那么在mysql連接的url后面加上 zeroDateTimeBehavior=convertToNull即可,如:
jdbc:mysql://localhost/driver_center?zeroDateTimeBehavior=convertToNull
3.以上數值,通過ResultSet的getString()返回的結果為null