executebatch and update using single Connection
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   deepak_ralli
Posted On:   Wednesday, October 27, 2004 08:53 AM

I am using a single DB Connection object and then doing multiple batch updates as given below: pstmt1 = connection.prepareStatement(sbQuery_Update_Rev.toString()); pstmt2 = connection.prepareStatement(sbQuery_Update_Contract.toString()); while{condition1} { pstmt3 = connection.prepareStatement(sbQuery_Update_Con.toString()); while(condition2) { pstmt3.addbatch() } pstmt3.executebatch() pstmt1.addbatch(); pstmt2.addbatch(); } pstmt1.executebatch() pstmt2.executebatch() pstmt1 and pstmt2 work fine, but the pstmt3 does not somehow update the database.    More>>

I am using a single DB Connection object and then doing multiple batch updates as given below:

pstmt1 = connection.prepareStatement(sbQuery_Update_Rev.toString());


pstmt2 = connection.prepareStatement(sbQuery_Update_Contract.toString());


while{condition1}
{


pstmt3 = connection.prepareStatement(sbQuery_Update_Con.toString());


while(condition2) {


pstmt3.addbatch()
}


pstmt3.executebatch()
pstmt1.addbatch();
pstmt2.addbatch();


}



pstmt1.executebatch()
pstmt2.executebatch()


pstmt1 and pstmt2 work fine, but the pstmt3 does not somehow update the database.


Is there any limittaion to this kind of usage


Please use html tags to format code blocks.

   <<Less

Re: executebatch and update using single Connection

Posted By:   Kevin_Mandeville  
Posted On:   Wednesday, October 27, 2004 01:32 PM

I don't see any issues with the way you are using it, per say. The error must lie with your different SQL queries. I can't think of anything that would cause this to work for one PreparedStatement and not another except for the SQL statements.
About | Sitemap | Contact