---
title: "org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update"
author: "pichcar"
date: "2010-11-11T09:41:12Z"
tags: ["DAO", "Hibernate", "JDBC", "数据结构"]
categories: ["企业架构"]
slug: "org-hibernate-exception-sqlgrammarexception-could-not-execute-jdbc-batch-update"
draft: false
lastmod: "2010-11-11T09:41:12Z"
id: 808287
url: "https://pichcar.iteye.com/blog/808287"
---

今天开发项目时，遇到一个错误每次执行插入方法是老报异常：

1.org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update

2.org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update

一般情况下可能的原因：

1.数据库里面的表没创建，这点应该去检查一下，可能楼创建了。

2.数据库对应表里面的字段没有创建，导致插入语句的时候报错。

3.数据库里面的表结构与配置文件中的表结构不一致。