O'Reilly logo

MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL by James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging and Database Connection Pooling

Another thing you're going to spend much of your time doing in this project is opening and closing database connections. If you were doing this using J2EE, you would have connection-pooling mechanisms available automatically. But because you are working in pure JSP, you have to manage the connections yourself.

Now, one way to handle this is to have each usage of the database open and close a connection explicitly. A number of problems are associated with this approach, however. For one thing, this would require every class that talked to the database to have enough information available to establish a connection. Also, opening and closing database connections are just about the most expensive thing an application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required