A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
JDBC and Relational Databases
Long connection time between MySQL and JDBC
Joined: Jun 14, 2010
Jul 31, 2012 00:23:24
I have a web application running on
that accesses data from a MySQL database.
However the time taken to establish a connection is very long.
The function that I'm using to connection to the database is
Connection con = DatabaseMgr.getConnection(driver, url, user, password);
It takes an average of 9 seconds to establish the connection. Query time is <1s depending on record size.
However, running the same function from Netbeans takes less than <1s from the same machine.
Hence, I would like to know if there's additional delay or firewall accessing the MySQL from Tomcat web application as compared to a direct connection.
Joined: Oct 13, 2005
Jul 31, 2012 01:58:15
Closing as apparently a duplicate of
I agree. Here's the link:
subject: Long connection time between MySQL and JDBC
MySQL with TOMCAT and JSP giving problems..
connection session variable
MySQL database connection fails after long idle
Remote JDBC connection performance question
Advice needed on how to connect to a database in JSP
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015