Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2005

Tip: Looking for answers? Try searching our database.

Problem batching DB2 stored procedure calls using JDBC

Thread view: 
usenet@kikobu.com - 13 Sep 2005 16:51 GMT
Hi.

I have a DB2 stored procedure that I call using JDBC. Now I'm trying to
batch the call. This is done by the book:

stmt = connection.prepareCall(" ... ");

stmt.setString(1, "foo");
stmt.addBatch();

stmt.setString(1, "bar");
stmt.addBatch();

stmt.setString(1, "baze");
stmt.addBatch();

stmt.executeBatch();

It appears that the stored procedure only gets invoked once - so after
the above there's only one record in the table the SP writes to, namely
the first ("foo"). The stmt.executeBatch(); returns an array of size 3,
all 0's.

Using same methodology I can make batching of prepared statements work
fine.

Any tips?

Thanks.

Morten
Joe Weinstein - 13 Sep 2005 17:02 GMT
> Hi.
>
[quoted text clipped - 23 lines]
>
> Any tips?

That should work, so I'd contact IBM about the driver.
Joe

> Thanks.
>
> Morten


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.