J. Francis J. Francis -3 years ago 117
MySQL Question

Working with Mysql and servlets in Java

I'm looking forward to reduce the initialization time of MySQL when working on servlets. It looks like this is a hard thing to do, so I need a better solution.

Is there any preloaded way to solve this?
Something like a pool or whatever? (I don't know what I'm talking about).

User sets login parameters.
Press Login button.
MySQL initializes (5 secs!!).
Still loads...
User thinks service is not working.
User closes tabs.

Answer Source

To reduce connection time in a servlet, usually a database conenction pool is used. This will take care of initializing connections and allocating them for you.

see https://commons.apache.org/proper/commons-dbcp/

for an example jar

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download