• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connections issue

 
Miltos Tereres
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello...
I have some classes within my model...which do some tasks..
For connections i use apache connection pooling stuff....
My question is..




getblabla() and getall() is ok to get a new connection from the pool ? Is there a better way to just use one connection as long as the servlet is being executed?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you're using DBCP, then getting and releasing connection object in each method is good and widely used technique.
Actually, what you need is good tutorial on DAO and DTO, for this, follow:
http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!