This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes JDBC database connections in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JDBC database connections in servlets" Watch "JDBC database connections in servlets" New topic
Author

JDBC database connections in servlets

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
Hi,

I read connections to database threadsafe hence we can create connections in init() to reuse in doGet() and doPost() methods.I have not understood what author meant. Any ideas, suggestions, sample code, resources, links highly appreciated. Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60817
    
  65

Creating connections in this manner is not recommended. Use a connection pool.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: JDBC database connections in servlets
 
Similar Threads
Update statement hangs
database connection
Java.lang.OutOfMemoryError
Maximum Pool Connection using Hibernate..
Hibernate code not working on Linux Server