aspose file tools*
The moose likes JDBC and the fly likes JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC" Watch "JDBC" New topic
Author

JDBC

Mishra Dinesh Jee
Greenhorn

Joined: Aug 27, 2001
Posts: 2
Please tell me is there any short cut to use the same callable statement a number of times.
Michael Fitzmaurice
Ranch Hand

Joined: Aug 22, 2001
Posts: 168
Hi
When you say 'use' the same CallableStatement a number of times, what do you mean? If you want to execute the same stored proc, there shouldn't be a problem with that (in theory at least - I have never actually tried it), even if you are resetting input parameters between calls. To test this, find the part of your code that makes the execute() call, and duplicate it on the next line. If there are problems, you'll soon find out.
A word of warning though. A callable statement and its resultset are linked - this can cause memory leaks in some situations if you are not careful, although in my experience this happens when you are reassigning the same resultset rather than calling the execute method repeatedly on a callable statement.
If you have problems with that, post again and I'll tell you how I got around it.
Hope this helps
Michael
------------------
"One good thing about music - when it hits, you feel no pain"
Bob Marley


"One good thing about music - when it hits, you feel no pain" <P>Bob Marley
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Originally posted by Mishra Dinesh Jee:
Please tell me is there any short cut to use the same callable statement a number of times.

It's a bit unclear what you want to do. But from what I can get from what you have said, you might want to look into PreparedStatements. It's like a statement, but you can use it several times with different parameters.
Hope this helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JDBC