my dog learned polymorphism*
The moose likes JDBC and the fly likes Does callableStatement.getInt method hit database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Does callableStatement.getInt method hit database?" Watch "Does callableStatement.getInt method hit database?" New topic
Author

Does callableStatement.getInt method hit database?

Makrand Pare
Greenhorn

Joined: Dec 07, 2005
Posts: 10
Hi,

I've a query regarding callableStatement. When we call callableStatement.execute() and then call getInt or getString or any getter method to get the out parameters of the procedure does it hit the database each time we call those getters or it returns the value from the object?

Thanks,
Makrand
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

Not for single calls of getInt() or getString() but possibly for calls of next() depending on the driver. Some drivers return all result set records, some do not, but once you have a single result set record, you have all the data in it.


My Blog: Down Home Country Coding with Scott Selikoff
Makrand Pare
Greenhorn

Joined: Dec 07, 2005
Posts: 10
Thanks a lot Scott...
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

...with the exception of clob/blobs (since the data contained in them may be huge)... buts a whole nother ball of wax.
[ July 17, 2006: Message edited by: Scott Selikoff ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does callableStatement.getInt method hit database?
 
Similar Threads
Application Control heap size of DB2 with JDBC
[liferay] My sample project
Finding the primary key
Loading proxy without hitting database
stop() method of applet and GC