I inherited a...well, I guess I can call it a piece-of-#### Struts application, and am tasked with optimizing a Levey-Jennings process that checks if our quality control standards are up to snuff.
The process itself runs fine, but there has always been a huge spike in performance time even if the dataset is small. I tested time between each part of the algorithm and discovered that the big time hog was Java's executeQuery() method.
Most recently I ran the application and logged the execution time to be 10 seconds. The executeQuery() took six of those seconds by itself. Curious to see what the problem was, I took the query into TOAD and ran it verbatim -- it only took 1 second to run.
I ran an even larger dataset, which took 60 seconds to run in the Levey-Jennings application -- however, in TOAD, it took 10.
Is this a problem with the query at all, or is using executeQuery() typically a precursor to extreme slowdown?