wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to boost performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to boost performance" Watch "How to boost performance" New topic
Author

How to boost performance

Dave Robbins
Ranch Hand

Joined: Sep 16, 2003
Posts: 131
Hello All,
I'm writing a swing application that contains about a dozen JTables that are each populated with data from an Oracle database. The database is huge and the queries that populate each table take a few seconds to run. Right now I just populate them one by one in a loop which is pretty slow. I'm playing around with spawning a thread for each table so they can all load at the same time, is this the right approach or are there tricks in JDBC that will let me run the queries simultaniously?
Thanx
Dave
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1131

Hi Dave,
In the majority of cases, the best way to speed up SQL queries is to
tune the SQL of the query itself, or to tune the database. There is
a wealth of material available on tuning queries in Oracle databases.
In fact, many people make a good living from merely tuning Oracle
database queries. Oracle itself comes with tools that help you tune
your queries.
I don't think there are any "tricks" you can do with JDBC to speed up
these queries.
As regards using multi-threading, if you are on a single processor
machine, I doubt whether multi-threading would help you. But I would
suggest that there is only one way for you to find out for sure:-
try it!
In any case, an optimal performance would probably be gained by a
combination of database tuning and (perhaps) multi-threading. But as
far as I know, the only way to improve the performance is to use the
tried and tested system of:
  • time it and see if the time it takes is acceptable
  • if it's not, profile it to find bottlenecks
  • refactor
  • repeat from step one (1), above


  • Good Luck,
    Avi.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: How to boost performance