File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes reduce querying ODB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "reduce querying ODB" Watch "reduce querying ODB" New topic

reduce querying ODB

varkala prabhakar
Ranch Hand

Joined: Sep 08, 2001
Posts: 54
I have a oracle 8i database consisting of 10000 records in a table,
Now i have to check nearly more than the number of records wether the specified record is there in database or what i do is every time i make the query and check in the database. Is there any method to reduce my program execution.
Even if i store table in temp array and check for the necessary condition, full array[1000][] have to be searched and i think the time taken to query the database and accessing the whole array will not make much difference.
hope for better suggestion from u all.
Vladimir Ergovic
Ranch Hand

Joined: Apr 22, 2001
Posts: 63
You could add indexes to the DB if you haven't done it yet, or you could use HashMap for accessing by the key if you have some some unique keys. If thet is still to slow - try making some "smart" object which is going to contain only 1000 most wanted or recently used records. And if the record is not in the memory then query database.

Vladimir Ergovic
I agree. Here's the link:
subject: reduce querying ODB
It's not a secret anymore!