JDBC problem

X

xhy_China

Hi All,

I hava a problem about speed of database enquiry.

Problem:
It's a B/S application. Now I hava a database enquiry.
The statement stmt.executeQuery(sSQL) used long time(about 30s). The
return result have about 500 rows. If I copy the SQL to database
utilities to run it, itruns very fast(about 1-2s), why?? In another
function it also use stmt.executeQuery(sSQL)(returns about 500 rows),
it runs fast, so I dont think the reason is network between client,
database, server.
Could any one tell me why?? And how to change this
situation??
Thx for you suggestion!
 
R

Roedy Green

It's a B/S application
In Canadian that would be "bull shit" application, meaning a pointless
exercise. I doubt that is what you intended. What does BS stand for
in your part of the world?
 
R

Roedy Green

The statement stmt.executeQuery(sSQL) used long time(about 30s).

can you show the code you are using the process the results? perhaps
you are doing something highly inefficient?
 
G

GArlington

Hi All,

I hava a problem about speed of database enquiry.

Problem:
It's a B/S application. Now I hava a database enquiry.
The statement stmt.executeQuery(sSQL) used long time(about 30s). The
return result have about 500 rows. If I copy the SQL to database
utilities to run it, itruns very fast(about 1-2s), why?? In another
function it also use stmt.executeQuery(sSQL)(returns about 500 rows),
it runs fast, so I dont think the reason is network between client,
database, server.
Could any one tell me why?? And how to change this
situation??
Thx for you suggestion!

Check that your JDBC driver is optimising and reusing query cache, try
to use PreparedStatement(), optimise whatever is in sSQL, run
stmt.executeQuery(sSQL), time it alone (i.e. put some timing code
around it), if there is still a problem post the actual code in sSQL.
 
X

xhy_China

In Canadian that would be "bull shit" application, meaning a pointless
exercise. I doubt that is what you intended. What does BS stand for
in your part of the world?

B/S means Browser/Server in my part of the world
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top