---
title: "java.sql.SQLException '0000-00-00 00:00:00' "
author: "zwh910621"
date: "2010-04-06T18:39:03Z"
tags: []
categories: ["数据库"]
slug: "java-sql-sqlexception-0000-00-00-00-00-00"
draft: false
lastmod: "2010-04-08T14:53:47Z"
id: 634821
url: "https://javaheart88.iteye.com/blog/634821"
---

错误信息：java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Date;

解决方法：

在URL上加上

&amp;zeroDateTimeBehavior=convertToNull

意思就是把'0000-00-00 00:00:00' 换为NULL

本人完成的URL如下

 

```
<property name="url" value="jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true&amp;zeroDateTimeBehavior=convertToNull" />
```