I am creating a simple JDBC connection and executing a prepared statement. The query returns 10 rows and it takes around 20 secs to execute the query in simple Java application.
When I deploy this as a WAR File in tomcat and the same query is executed by a servlet it takes around 3 to 4 minutes, sometimes more.
Not able to figure out the possible reason.