This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes getting batchupdate exception while inserting recored for second time... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "getting batchupdate exception while inserting recored for second time..." Watch "getting batchupdate exception while inserting recored for second time..." New topic
Author

getting batchupdate exception while inserting recored for second time...

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
this is code i wrote ..to connect to database and also getting filename,filedate and filesize from one folder but if i am trying to insert same records again then i am getting the error as

Statements that produce resultsets are not allowed in batch comments...





can anyone help me?


SCJP5 and SCWCD1.5
Think Twice Act Wise...
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 273

What does the stored procedure do? It looks like it's trying to return data via a SELECT statement, and that JDBC has a problem with that.

Also, you should use foreach loops. For example:

And you should move the SimpleDateFormat object outside of the for loop because otherwise, you're creating it over and over again. Ditto for the setAutoCommit(false) line.


SCJP 6 || SCWCD 5
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getting batchupdate exception while inserting recored for second time...
 
Similar Threads
Problem inserting a single quote (')
Getting Problem in Delete operation in Struts application
batchupdateException.getUpdateCounts() doesnot return correct result as per JDBC api
DSN name not found error with TOMCAT5.5.7
oracle connection with jdbc