This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Performance and the fly likes major difference between oracle and ms-access with java code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "major difference between oracle and ms-access with java code" Watch "major difference between oracle and ms-access with java code" New topic
Author

major difference between oracle and ms-access with java code

mohan shetty
Greenhorn

Joined: Oct 26, 2007
Posts: 9
Hi All,
I am facing a problem regarding performance.This is all about java code which involves a sql query to fetch huge data(in 1000's)from tables.this code with sql select statement works fine in MS-ACCESS(i.e execution of this query takes in seconds)but the same java code with same sql select statement takes 40 minutes or even more for its execution on ORACLE.The query goes like this
select ="e.dataDate, e.reference,e.status,";

from = DBNames.A_TABLE " p, "
+ DBNames.B_TABLE
+ " t,
+ DBNames.WECTM_ENGINE_ALERT_TABLE
+ " e ";

where1="p.id=t.nl"+ " and t.alertId=e.id and e.engineId=";

where2 ="p.id=t.nh"+ " and t.alertId=e.id and e.engineId=";

This where1 or where2 am passing through a FOR loop to make a sql statement.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26173
    
  66

Mohan,
Do you have an index on those tables? The first thing I think of when seeing an order or magnitude difference is that maybe MS-Access has an index while Oracle is doing a full table scan - or worse - 3 full table scans.

You can tune this by running the query through Oracle explain. Explain will tell you what execution plan the database is using. You want to make sure it is using indexes rather than table scans. If it is not, you may be missing an index.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: major difference between oracle and ms-access with java code
 
Similar Threads
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
PreparedStatement
how to fetch data from resultset containing result of two queries
Getting java.sql.SQLException. Why?
regarding MS access sql query