Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

JDBC problem

Thread view: 
xhy_China - 06 Nov 2007 07:36 GMT
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!
Roedy Green - 06 Nov 2007 09:04 GMT
> It's a B/S application
In Canadian that would be "bull sh.t" application, meaning a pointless
exercise. I doubt that is what you intended.  What does BS stand for
in your part of the world?
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

xhy_China - 06 Nov 2007 21:45 GMT
On Nov 6, 5:04 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:

> > It's a B/S application
>
> In Canadian that would be "bull sh.t" 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
Roedy Green - 06 Nov 2007 09:05 GMT
>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?
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

GArlington - 06 Nov 2007 13:25 GMT
> Hi All,
>
[quoted text clipped - 11 lines]
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.