aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Dao - connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Dao - connection pool" Watch "Dao - connection pool" New topic
Author

Dao - connection pool

aakash bhatt
Ranch Hand

Joined: Jan 09, 2003
Posts: 182
If the connection code is written in DAO. How will the app server do the connection pooling
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
It depends on how the DAO is implemented. The pattern itself doesn't mandate any particular approach to getting JDBC connections -- or even using one in the first place.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
If you want to take advantage of the connection pooling provided by the application server, you will need to:

1) lookup the javax.sql.DataSource object via JNDI
2) invoke DataSource.getConnection()
Example code:
http://daoexamples.sourceforge.net/
Article:
http://www-106.ibm.com/developerworks/java/library/j-dao/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dao - connection pool