The Artima Developer Community
Sponsored Link

Java Answers Forum
CallableStatment reuse

2 replies on 1 page. Most recent reply: Oct 23, 2003 1:34 AM by Senthoorkumaran Punniamoorthy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

CallableStatment reuse Posted: Oct 22, 2003 1:03 AM
Reply to this message Reply
Advertisement
The stmt is a CallableStatment

      for (int i=0; i<IDs.length; i++){
        stmt = connection.prepareCall("{call RESUB_REQUEST(?)}");
        stmt.setString(1,IDs[i]);
        stmt.executeUpdate();
      }

Can I rewrite it like
     stmt = connection.prepareCall("{call RESUB_REQUEST(?)}");
 
      for (int i=0; i<IDs.length; i++){
        stmt.setString(1,IDs[i]);
        stmt.executeUpdate();
      }


sindu

Posts: 15
Nickname: sindu
Registered: Sep, 2003

Re: CallableStatment reuse Posted: Oct 22, 2003 9:29 PM
Reply to this message Reply
I think u should have tried this one and then posting it.If u have tried it what was the answer u got ??

Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: CallableStatment reuse Posted: Oct 23, 2003 1:34 AM
Reply to this message Reply
At the moment I am working against a dummy SP so I don’t get any real results. Therefore I was not able to verify this against my code and that’s why I posted the question here, so that if anyone had before tried to call a SP within a loop, just to know which way they did it. So that when I replace the SP with a real one I can straight away go to code rather than reinventing the wheel.

Flat View: This topic has 2 replies on 1 page
Topic: INTERFACE vs ABSTRACT Previous Topic   Next Topic Topic: String problem

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use