Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes How to make a query faster. 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 "How to make a query faster." Watch "How to make a query faster." New topic

How to make a query faster.

Gorakshanath Pandey

Joined: Feb 25, 2004
Posts: 11
I have a sql query which works well. but the only problem with it
is its extremely slow.Its a compound query and i have to query DB2
database.I am using Java/JDBC to write a stored procedure
David Peterson
Ranch Hand

Joined: Oct 14, 2001
Posts: 154
You need to identify the bottleneck: is it JDBC or DB2? Run the query from a command-line tool (i.e. not through JDBC). Is it still as slow?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

Did you try adding indexes to your table? Also, try posting the query. Maybe someone here can give you tips on it.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: How to make a query faster.
It's not a secret anymore!