Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC database connections in servlets

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64973
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Creating connections in this manner is not recommended. Use a connection pool.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic