This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Retrieving information for a collection of objects from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Retrieving information for a collection of objects from database" Watch "Retrieving information for a collection of objects from database" New topic
Author

Retrieving information for a collection of objects from database

Yan Lee
Ranch Hand

Joined: Sep 15, 2003
Posts: 94
Hi:
I am redesigning a module that has to get records from the database corresponding a collection of objects.

In the current implementation, for each object in a collection a JDBC call
is made to an oracle database and information for that object is obtained and mapped to an object. Obviously that causes a lot of database calls.

Is it possible to do this in a more efficient manner? How can I pass a collection of primary keys to a stored procedure and get a resultset that can be mapped back to the collection of primary keys? Is it possible using PL/SQL?

Thanks in advance for the help.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1138
    
    1

p,

Is it possible using PL/SQL?

Yes, it is. Please see my reply in the topic Passing Arrays to Oracle stored procedures (in this forum).

Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieving information for a collection of objects from database
 
It's not a secret anymore!