If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Delte 1000 Records In Jdbc Batch

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-09, 05:38
nd1980 nd1980 is offline
Registered User
 
Join Date: Aug 2009
Posts: 2
Post Delte 1000 Records In Jdbc Batch

Hi,

I have a requirement where I have to delete 1000 records from a single table for a given set of conditions. How can I go ahead with JDBC batch? Is there any perormance issue for this approach? If few of the records are not deleted from this batch, then the whether all others will be commited?

Thanks for the help.

Regards,
nd1980
Reply With Quote
  #2 (permalink)  
Old 08-11-09, 05:55
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
delete from .. where ..
if statement executed and not succeeded it will be rolled back
the only problem could be logspace (not with 1000 rows)
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 08-11-09, 06:08
nd1980 nd1980 is offline
Registered User
 
Join Date: Aug 2009
Posts: 2
Actually My requirement is to do the batch delete from a JAVA application through JDBC Batch feature. My concern is if few records are not getting deleted, then whether the whole batch will be rolled back?
Reply With Quote
  #4 (permalink)  
Old 08-12-09, 03:26
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
it depends on the commit
it will rollback to last luw
(I find it strange that so many people are trying to use DB2 and have not read at least 1 book about it or never consult the online infocenter)
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 08-12-09, 21:17
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by przytula_guy
(I find it strange that so many people are trying to use DB2 and have not read at least 1 book about it or never consult the online infocenter)
Why should they when there are so many people willing to spoon feed them (instead of asking them to RTFM) on this forum in order to rack up posting counts (must be in their performance plan)?

I have answered a lot of questions, but I make a lot of references to the manuals, usually telling them exactly which manual to look in.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 08-13-09, 10:57
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by Marcus_A
Why should they when there are so many people willing to spoon feed them (instead of asking them to RTFM) on this forum in order to rack up posting counts (must be in their performance plan)?

I may be wrong... but I have a feeling that I'm part of this group of people. Given them hints and telling to RTFM is perfectly fine (and this is what I try to do), but this doesn't work for all. I get to work with different kinds of people - some are extremely knowledgeable DBAs and one hint is more than enough and some are very new to DB2 or the DBA role. So, giving them a few hints and telling to RTFM is often not enough. So, I'm kind of used to "spoon feed them". If this is against the rules of this forum, then I'll stop.

And I'm not doing it to "rack up posting counts"... I could care less about it.
Reply With Quote
  #7 (permalink)  
Old 08-13-09, 11:16
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by db2girl
If this is against the rules of this forum, then I'll stop.
it isn't

the only time you should not offer a solution is when it's an obvious homework assignment

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On