---
title: "'0000-00-00 00:00:00' can not be represented as java.sql.Timestamp error"
author: "winder_sety"
date: "2016-07-14T14:47:40Z"
tags: []
categories: ["数据库"]
slug: "0000-00-00-00-00-00-can-not-be-represented-as-java-sql-timestamp-error"
draft: false
lastmod: "2016-07-14T14:47:40Z"
id: 2311208
url: "https://winder-sety.iteye.com/blog/2311208"
---

```
### Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
; SQL []; Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
org.springframework.dao.TransientDataAccessResourceException: 
### Error querying database.  Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
```

 

### 最简单的解决办法：

在jdbc的连接中增加：`zeroDateTimeBehavior=convertToNull`