Hi Shahata,

You can measure the time it takes to execute a bunch of code with
System.currentTimeMillis()

For example :

long beginTime = System.currentTimeMillis();
//Do some work (like executing SQL query, or opening a connection)
long timeItTook = System.currentTimeMillis() - beginTime;
System.out.println("Action took " + timeItTook + " milliseconds to
execute");

If you are experiencing problems with delays in your JDBC connections, you
should probably think about plugging a connection pool in your application.

A simple search of "JDBC connection pooling" on Google will get you started!

HTH,

--
David

-----Message d'origine-----
De : A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED] la part de Shahata, Ash
Envoy� : 17 mars, 2003 05:50
� : [EMAIL PROTECTED]
Objet : JDBC connection time


Hi all - I'm experiencing delays in my in my jdbc connections, and I just
wanted to inquire if anyone knows of any shareware tool that could do this
for me, or if anyone knows of a programmatic way to measure the time it
takes for a query to execute and retrieve data?

Thanks

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to