---
title: "jdbc批处理获取中间sql语句出错"
author: "cetusz"
date: "2011-01-28T11:31:04Z"
tags: []
categories: ["编程语言"]
slug: "jdbc-sql"
draft: false
lastmod: "2011-01-28T11:31:04Z"
id: 898781
url: "https://cetus.iteye.com/blog/898781"
---

最近在用jdbc的批处理，在使用过程中出现了批处理当中的几条sql语句有问题导致出错。具体解决方案如下：

```
try{
 
  pstmt.executeBatch();
 
 }catch(SQLException e){
      while (e != null) {
		  System.out.println("Message:   "  + e.getMessage ());  
		   e = e.getNextException();  
		   System.out.println("..........."+e);  
		      
		     }  
}
```