Results 1 to 4 of 4
- 10-24-2011, 10:33 AM #1
Member
- Join Date
- May 2011
- Posts
- 21
- Rep Power
- 0
is it possible to execute 3-4 prepated statements at once as batch?
Ex:-
PreparedStatement pstmt = conn.prepareStatement(INSERT_RECORD);
pstmt.setString(1, "1");
pstmt.setString(2, "name1");
pstmt.addBatch();
pstmt = conn.prepareStatement(DELETE_RECORD);
pstmt.setString(1, "5");
pstmt.addBatch();//is it possible?
int[] i = pstmt.executeBatch();//is it possible?
- 10-24-2011, 10:43 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
Re: is it possible to execute 3-4 prepated statements at once as batch?
Well, seeing as how you are redefining the variable and so pstmt after the second prepareStatement no longer refers to the same object as it did before that, what do you think?
- 10-24-2011, 11:46 AM #3
Member
- Join Date
- May 2011
- Posts
- 21
- Rep Power
- 0
Re: is it possible to execute 3-4 prepated statements at once as batch?
yes , even i got the same doubt, if i want to execute all statements at once is it possible? any other way?
- 10-24-2011, 12:05 PM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
Similar Threads
-
how to write process to execute batch jop on particular date.
By laungarth in forum Advanced JavaReplies: 3Last Post: 07-07-2011, 06:20 AM -
how to write process to execute batch job on particular date.
By laungarth in forum Web FrameworksReplies: 1Last Post: 07-06-2011, 09:19 PM -
Batch RSA
By Nita Jackson in forum Advanced JavaReplies: 0Last Post: 02-15-2011, 05:24 AM -
How to Execute SQL statements in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:41 AM -
How to Execute SQL statements in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-28-2007, 12:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks