{"id":3018,"date":"2018-08-29T14:48:42","date_gmt":"2018-08-29T06:48:42","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3018"},"modified":"2018-08-29T14:48:42","modified_gmt":"2018-08-29T06:48:42","slug":"cause-java-sql-sqlexception-value-0000-00-00-000000-can-not-be-represented-as-java-sql-timestamp","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3018","title":{"rendered":"Cause: java.sql.SQLException: Value &#8216;0000-00-00 00:00:00&#8217; can not be represented as java.sql.Timestamp"},"content":{"rendered":"<p>\n\t\u4eca\u5929\u5728\u4f7f\u7528 Mysql \u4e2d\u7684\u4e00\u4e2a datetime \u5b57\u6bb5\u65f6\u78b0\u5230\u4e86\u4e00\u4e2a Cause: java.sql.SQLException: Value &#039;0000-00-00 00:00:00&#039; can not be represented as java.sql.Timestamp \u5f02\u5e38\uff0c\u4e4b\u524d\u4f7f\u7528\u90fd\u6ca1\u6709\u95ee\u9898\uff0c\u4eca\u5929\u7a81\u7136\u51fa\u73b0\u6545\u969c\u3002\u6240\u4ee5\u6211\u5c31\u4ed4\u7ec6\u67e5\u770b\u4e86\u4e00\u4e0b\u4ee3\u7801\uff0c\u770b\u770b\u6700\u8fd1\u662f\u5426\u6709\u4eba\u6539\u52a8\u3002\u901a\u8fc7\u6700\u7ec8\u7684\u641c\u7d22\u6392\u67e5\uff0c\u6211\u628a\u6574\u4e2a\u8fc7\u7a0b\u5206\u4eab\u7ed9\u5927\u5bb6\uff01\n<\/p>\n<p>\n\t\u6839\u636e\u5f02\u5e38\u4fe1\u606f\uff0c\u6211\u7ffb\u8bd1\u4e86\u4e00\u4e0b\uff0c\u5927\u6982\u610f\u601d\u662f\u8bf4\uff0c&#039;0000-00-00 00:00:00&#039; \u8fd9\u4e2a\u65f6\u95f4\u4e0d\u80fd\u7528 Java \u6765\u8868\u793a\u3002\u867d\u7136\u6570\u636e\u5e93\u4e2d\u53ef\u4ee5\u5b58\u653e\u8fd9\u4e2a\u503c\uff0c\u4f46\u662f Java \u4e2d\u7684\u65f6\u95f4\u90fd\u662f\u4ece 1970 \u5e74\u5f00\u59cb\u7684\u3002\u683c\u6797\u5a01\u6cbb\u65f6\u95f4 1970\u5e7401\u670801\u65e500\u65f600\u520600\u79d2\uff08UTC+8\u5317\u4eac\u65f6\u95f41970\u5e7401\u670801\u65e508\u65f600\u520600\u79d2\uff09\uff0c\u6240\u4ee5\u4f60\u8fd9\u4e2a &#039;0000-00-00 00:00:00&#039; \u7684\u65f6\u95f4\uff0cJava \u8868\u793a\u4e0d\u4e86\uff0c\u6240\u4ee5\u5c31\u629b\u51fa\u4e86\u8fd9\u4e2a\u5f02\u5e38\u3002\n<\/p>\n<p>\n\t\u5b8c\u6574\u7684\u5f02\u5e38\u4fe1\u606f\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\torg.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column &#039;audit_time&#039; from result set. &nbsp;Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column &#039;audit_time&#039; from result set. &nbsp;Cause: java.sql.SQLException: Value &#039;0000-00-00 00:00:00&#039; can not be represented as java.sql.Timestamp<br \/>\n\t&nbsp;&nbsp; &nbsp;at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)<br \/>\n\t&nbsp;&nbsp; &nbsp;at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)<br \/>\n\t&nbsp;&nbsp; &nbsp;at com.sun.proxy.$Proxy127.selectOne(Unknown Source)<br \/>\n\t&nbsp;&nbsp; &nbsp;at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166)<br \/>\n\t&nbsp;&nbsp; &nbsp;at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)<br \/>\n\t&nbsp;&nbsp; &nbsp;at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)<br \/>\n\t&nbsp;&nbsp; &nbsp;at com.sun.proxy.$Proxy134.findOrderInfo(Unknown Source)\n<\/p>\n<p>\n\t\u90a3\u4e48\u77e5\u9053\u8fd9\u4e2a\u5f02\u5e38\u4ea7\u751f\u7684\u539f\u56e0\u540e\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\u5462\uff1f\n<\/p>\n<p>\n\t\u6839\u636e stackoverflow \u4e0a\u4e00\u90e8\u5206\u4eba\u7684\u56de\u7b54\uff0c\u6211\u5f97\u51fa\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u65b9\u5f0f\u8fde\u63a5\u6570\u636e\u5e93\u6765\u89e3\u51b3\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\njdbc:mysql:\/\/www.xttblog.com:3306\/xttblog?zeroDateTimeBehavior=convertToNull<\/pre>\n<p>\n\tMySQL \u7684\u5b98\u65b9\u8d44\u6599\u5bf9 zeroDateTimeBehavior \u5c5e\u6027\u505a\u51fa\u4e86\u8be6\u7ec6\u7684\u89e3\u91ca\uff0c\u76f8\u89c1\u53c2\u8003\u8d44\u6599\u3002\n<\/p>\n<p>\n\t\u8bbe\u7f6e zeroDateTimeBehavior \u5c5e\u6027\uff0c\u5f53\u9047\u5230 DATETIME \u503c\u5b8c\u5168\u7531 0 \u7ec4\u6210\u65f6\uff0c\u6700\u7ec8\u7684\u6709\u6548\u503c\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\uff0c\u5f02\u5e38(exception)\uff0c\u4e00\u4e2a\u8fd1\u4f3c\u503c(round)\uff0c\u6216\u5c06\u8fd9\u4e2a\u503c\u8f6c\u6362\u4e3a null(convertToNull)\u3002\n<\/p>\n<p>\n\t\u9ed8\u8ba4\u60c5\u51b5\u4e3a exception\uff0c\u8bbe\u7f6e\u8fd9\u4e2a\u5c5e\u6027\u4f1a\u629b\u51fa\u4e00\u4e2a SQLException \u5f02\u5e38\uff0c\u4e5f\u5c31\u662f\u6587\u7ae0\u5f00\u5934\u6240\u8bf4\u5230\u7684\u5f02\u5e38\u3002\u5176 SQLSate \u7801\u4e3a S1009\u3002\u8fd9\u4e2a\u72b6\u6001\u7801\u5728\u5199\u5b58\u50a8\u8fc7\u7a0b\u5904\u7406\u5f02\u5e38\u65f6\u4e5f\u53ef\u4ee5\u7528\u5230\u3002\n<\/p>\n<p>\n\tconvertToNull\uff0c\u8fd4\u56de null \u6765\u66ff\u4ee3 0000-00-00 \u8fd9\u6837\u7684\u65e5\u671f\u3002\n<\/p>\n<p>\n\tround\uff0c\u5c06\u65e5\u671f\u8f6c\u6362\u4e3a 0001-01-01\u3002\n<\/p>\n<p>\n\t\u56e0\u6b64\uff0c\u51fa\u73b0 0000-00-00 \u5c5e\u4e8e\u4e00\u4e2a\u65e0\u6548\u65e5\u671f\uff0c\u7528 convertToNull \u5c5e\u6027\u5373\u53ef\u3002\n<\/p>\n<p>\n\t\u4e0b\u9762\u6211\u4eec\u518d\u4e00\u8d77\u6765\u56de\u987e\u4e00\u4e0b Java \u4e2d\u5bf9\u65e5\u671f\u7c7b\u578b\u7684\u5904\u7406\u65b9\u6cd5\u3002\n<\/p>\n<p>\n\t\u9996\u5148 Java \u4e2d\u80fd\u8868\u793a\u65e5\u671f\u7684\u63d0\u4f9b\u4e86 4 \u4e2a\u7c7b\uff0c\u5206\u522b\u662f\uff1ajava.util.Date\u3001java.sql.Date\u3001java.sql.Time\u3001java.sql.Timestamp\u3002\n<\/p>\n<p>\n\t\u5b83\u4eec\u7684\u7ee7\u627f\u5173\u7cfb\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:plain;\">\r\njava.lang.Object \r\n....|__java.util.Date \r\n..........|__java.sql.Date\/java.sql.Timestamp \/java.sql.Time\r\n\r\n....|__java.security.Timestamp<\/pre>\n<ul>\n<li>\n\t\tjava.util.Date \u65e5\u671f\u683c\u5f0f\u4e3a\uff1a\u5e74\u6708\u65e5\u65f6\u5206\u79d2&nbsp;\n\t<\/li>\n<li>\n\t\tjava.sql.Date \u65e5\u671f\u683c\u5f0f\u4e3a\uff1a\u5e74\u6708\u65e5[\u53ea\u5b58\u50a8\u65e5\u671f\u6570\u636e\u4e0d\u5b58\u50a8\u65f6\u95f4\u6570\u636e]&nbsp;\n\t<\/li>\n<li>\n\t\tjava.sql.Time \u65e5\u671f\u683c\u5f0f\u4e3a\uff1a\u65f6\u5206\u79d2&nbsp;\n\t<\/li>\n<li>\n\t\tjava.sql.Timestamp \u65e5\u671f\u683c\u5f0f\u4e3a\uff1a\u5e74\u6708\u65e5\u65f6\u5206\u79d2\u7eb3\u79d2\uff08\u6beb\u5fae\u79d2\uff09\n\t<\/li>\n<\/ul>\n<p>\n\t\u4ece\u4e0a\u53ef\u4ee5\u770b\u51fa java.util.Date \u8fd9\u4e2a\u7c7b\u662f java.sql.Date, &nbsp;java.sql.Time, &nbsp;java.slq.Timestamp \u8fd9\u4e09\u4e2a\u7c7b\u7684\u7236\u7c7b\u3002\u8fd9\u4e09\u4e2a\u7c7b\u5bf9 java.util.Date \u7c7b\u8fdb\u884c\u4e86\u5305\u88c5\u3002\n<\/p>\n<p>\n\tjava.sql.Date \u7c7b\u5c4f\u853d\u4e86 java.util.Date \u7c7b\u7684\u65f6\u95f4\u6709\u5173\u7684\u65b9\u6cd5\uff08\u5f62\u5982\uff1ahh:mm:ss\uff09,\u56e0\u6b64\uff0c\u4e0d\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u7c7b\u8bbf\u95ee\u65f6\u95f4\u6709\u5173\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\uff0c\u5982\u679c\u4f60\u901a\u8fc7 sqlDate.getHour() \u65b9\u6cd5\u53bb\u8bbf\u95ee\u5c0f\u65f6\u4fe1\u606f\uff0c\u6b64\u65b9\u6cd5\u4f1a\u629b\u51fa\u4e00\u4e2aIllegalArgumentException\u5f02\u5e38\u3002\u8fd9\u662f\u56e0\u4e3a java.sql.Date \u5728\u7ee7\u627f java.util.Date \u7c7b\u7684\u65f6\u5019\u5bf9\u7236\u7c7b\u8fdb\u884c\u4e86\u91cd\u5199\uff0c\u7981\u7528\u4e86\u65f6\u95f4\u8bbf\u95ee\u7684\u65b9\u6cd5\u3002\u4e4b\u6240\u4ee5\u8fd9\u4e48\u5904\u7406\uff0c\u662f\u4e3a\u4e86\u548c\u6570\u636e\u5e93\u7684Date\u6570\u636e\u7c7b\u578b\u76f8\u5339\u914d\uff0c\u6570\u636e\u5e93\u7684Date\u6570\u636e\u7c7b\u884c\u53ea\u662f\u4fdd\u5b58\u65e5\u671f\u6709\u5173\u7684\u5b57\u6bb5\u3002\n<\/p>\n<p>\n\tJava.sql.Time \u7c7b\u5c4f\u853d\u4e86 java.util.Date \u7684\u65e5\u671f\u6709\u5173\u7684\u5b57\u6bb5\uff08\u5f62\u5982\uff1ayyyy-MM-dd\uff09,\u56e0\u6b64\uff0c\u4e0d\u80fd\u901a\u8fc7\u8fd9\u4e2a\u7c7b\u8bbf\u95ee\u65e5\u671f\u6709\u5173\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\uff1a\u5982\u679c\u4f60\u901a\u8fc7 sqlTime.getYear() \u65b9\u6cd5\u53bb\u83b7\u53d6\u5e74\u6709\u5173\u7684\u4fe1\u606f\uff0c\u6b64\u65b9\u6cd5\u4f1a\u629b\u51fa\u4e00\u4e2a IllegalArgumentException \u5f02\u5e38\u3002\u8fd9\u662f\u56e0\u4e3a java.sql.Time \u5728\u7ee7\u627f java.util.Date \u7c7b\u7684\u65f6\u5019\u5bf9\u7236\u7c7b\u8fdb\u884c\u4e86\u91cd\u5199\uff0c\u7981\u7528\u4e86\u65e5\u671f\u8bbf\u95ee\u7684\u65b9\u6cd5\u3002\u4e4b\u6240\u4ee5\u8fd9\u4e48\u5904\u7406\uff0c\u662f\u4e3a\u4e86\u548c\u6570\u636e\u5e93\u7684 Time \u6570\u636e\u7c7b\u578b\u76f8\u5339\u914d\uff0c\u6570\u636e\u5e93\u7684Time\u6570\u636e\u7c7b\u884c\u53ea\u662f\u4fdd\u5b58\u65f6\u95f4\u6709\u5173\u7684\u5b57\u6bb5\u3002\n<\/p>\n<p>\n\tJava.sql.Timestamp \u5b57\u6bb5\u5219\u5bf9 java.util.Date \u8fd9\u4e2a\u7c7b\u8fdb\u884c\u4e86\u6269\u5145\uff0c\u5b83\u5728 java.util.Date \u7c7b\u7684\u57fa\u7840\u4e0a\u589e\u52a0\u4e86\u6beb\u79d2\u7684\u65f6\u95f4\u8bbf\u95ee\u63a7\u5236\uff0c\u56e0\u6b64\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 getNanos\uff08\uff09\u65b9\u6cd5\u53bb\u83b7\u53d6\u65f6\u95f4\u7684\u6beb\u5fae\u79d2\u6570\uff08\u6ce8\u610f\u6b64\u5904\u83b7\u53d6\u7684\u65f6\u95f4\u662f\u4ee5\u6beb\u5fae\u79d2\u4e3a\u5355\u4f4d\u7684,1\u79d2\u7b49\u4e8e\u5341\u4ebf\u6beb\u5fae\u79d2\uff09\uff0c\u540c\u6837\u7684\uff0c\u8fd9\u4e5f\u662f\u4e3a\u4e86\u548c\u6570\u636e\u5e93\u4e2d\u7684Timestamp\u6570\u636e\u7c7b\u578b\u8fdb\u884c\u5339\u914d\u3002\n<\/p>\n<p>\n\t\u7406\u6e05\u4e86\u4e0a\u8ff0\u56db\u4e2a\u7c7b\u7684\u5173\u7cfb\uff0c\u90a3\u4e48 java.util.Date \u548c java.util.Calendar \u7c7b\u6709\u4ec0\u4e48\u5173\u7cfb\u5462\uff1f\n<\/p>\n<p>\n\tJava.util.Calendar \u7c7b\u662f java.util.Date \u7c7b\u7684\u4e00\u4e2a\u66f4\u52a0\u6df1\u5165\uff0c\u66f4\u52a0\u5168\u9762\u7684\u66ff\u4ee3\u3002Java.util.Calendar \u7c7b\u652f\u6301 java.util.Date \u7684\u6240\u6709\u529f\u80fd\uff0c\u6b64\u5916\uff0cCalendar \u8fd8\u5f15\u5165\u4e86\u591a\u8bed\u8a00\uff0c\u591a\u533a\u57df\u7684\u7279\u6027\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u83b7\u53d6\u4e0d\u540c\u533a\u57df\uff0c\u4e0d\u540c\u65f6\u533a\u7684\u65f6\u95f4\uff0cCalendar \u8fd8\u589e\u52a0\u4e86\u6bd4 Date \u66f4\u52a0\u65b9\u4fbf\u548c\u5feb\u6377\u7684\u8bb8\u591a\u64cd\u4f5c\uff0c\u5982\u83b7\u53d6\u4e00\u5e74\u5f53\u4e2d\u7684\u7b2c\u51e0\u4e2a\u661f\u671f\uff0c\u5404\u4e2a\u6708\u7684\u5929\u6570\u7b49\u4fbf\u6377\u7684\u65b9\u6cd5\u3002\n<\/p>\n<p>\n\tjava.util.Calendar \u533a\u522b\u4e0e java.util.Date \u7684\u51e0\u4e2a\u5730\u65b9\u4e5f\u9700\u8981\u6ce8\u610f\u4e00\u4e0b\uff1a\u9996\u5148\uff0cCalendar \u589e\u52a0\u4e86\u6beb\u79d2\u7684\u65f6\u95f4\u6bb5\uff0c\u901a\u8fc7\u5b83\u53ef\u4ee5\u83b7\u53d6\u65f6\u95f4\u70b9\u7684\u6beb\u79d2\u503c\uff0c\u800c java.util.Date \u53ea\u662f\u7cbe\u786e\u5230\u79d2\u3002\u5176\u6b21\uff0cCalendar \u8fc7\u53bb\u5e74\u7684\u65f6\u5019\u662f\u5f53\u524d\u5e74\u4efd\u6bd4\u5982\uff1a2010\uff0c\u800c Date \u83b7\u53d6\u5e74\u4efd\u7684\u65f6\u83b7\u53d6\u5230\u7684\u662f\u5f53\u524d\u5e74\u4efd-1900\u7684\u4e00\u4e2a\u503c\uff082010-1900=110\uff0c\u56e0\u6b64\uff0c\u4f60\u8c03\u7528 getYear \u540e\u8fc7\u53bb\u7684\u503c\u5c31\u662f110\uff09\u3002\u6700\u540e Calendar \u662f\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u4e4b\u6240\u4ee5\u80fd\u591f\u5b9e\u4f8b\u5316\uff0c\u662f\u56e0\u4e3a\u6b64\u5904\u7684 Calendar \u5145\u5f53\u4e86\u4e00\u4e2a\u7c7b\u4f3c\u4e8e\u5de5\u5382\u7684\u4f5c\u7528\uff0c\u5728 getInstance \u65b9\u6cd5\u4e2d\u5b9e\u4f8b\u5316\u4e86 Calendar \u5b50\u7c7b GregorianCalendar\uff0c\u5e76\u628a\u5b83\u8fd4\u56de\u7ed9\u7528\u6237\u4f7f\u7528\u3002\n<\/p>\n<p>\n\t\u9488\u5bf9\u4e0d\u540c\u7684\u6570\u636e\u5e93\u9009\u7528\u4e0d\u540c\u7684\u65e5\u671f\u7c7b\u578b \u3002\u4f8b\u5982\uff1aOracle\u7684Date\u7c7b\u578b\uff0c\u53ea\u9700\u8981\u5e74\u6708\u65e5\uff0c\u9009\u62e9\u4f7f\u7528java.sql.Date\u7c7b\u578b\uff1bMySQL \u548c Sqlserver \u6570\u636e\u5e93\u7684 DateTime \u7c7b\u578b\uff0c\u9700\u8981\u5e74\u6708\u65e5\u65f6\u5206\u79d2\uff0c\u9009\u62e9 java.sql.Timestamp \u7c7b\u578b\u3002\n<\/p>\n<h2>\n\t\u53c2\u8003\u8d44\u6599<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t<a href=\"http:\/\/dev.mysql.com\/doc\/connector-j\/5.1\/en\/connector-j-installing-upgrading-3-0-to-3-1.html\" name=\"3.3.3 Upgrading from MySQL Connector\/J 3.0 to 3.1\" target=\"_blank\" title=\"3.3.3 Upgrading from MySQL Connector\/J 3.0 to 3.1\">3.3.3 Upgrading from MySQL Connector\/J 3.0 to 3.1<\/a>\n\t<\/li>\n<li>\n\t\t<a href=\"https:\/\/stackoverflow.com\/questions\/11133759\/0000-00-00-000000-can-not-be-represented-as-java-sql-timestamp-error\" name=\"'0000-00-00 00:00:00' can not be represented as java.sql.Timestamp error\" target=\"_blank\" title=\"'0000-00-00 00:00:00' can not be represented as java.sql.Timestamp error\">&#039;0000-00-00 00:00:00&#039; can not be represented as java.sql.Timestamp error<\/a>\n\t<\/li>\n<\/ul>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3018\">Cause: java.sql.SQLException: Value &#8216;0000-00-00 00:00:00&#8217; can not be represented as java.sql.Timestamp<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5728\u4f7f\u7528 Mysql \u4e2d\u7684\u4e00\u4e2a datetime \u5b57\u6bb5\u65f6\u78b0\u5230\u4e86\u4e00\u4e2a Cause: java.sql.SQLE [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,12],"tags":[266,259,1037,83,467],"class_list":["post-3018","post","type-post","status-publish","format-standard","hentry","category-java","category-sql","tag-java","tag-js","tag-mybatis","tag-mysql","tag-oracle"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3018"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3018\/revisions"}],"predecessor-version":[{"id":3020,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3018\/revisions\/3020"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}