-
DAo - Connection Pooling (3 messages)
- Posted by: aakash bhatt
- Posted on: November 11 2003 05:51 EST
If the connection code is written in DAO. How will the app server do the connection poolingThreaded Messages (3)
- Reply to Message in Discussion / EJB Design by Viswa Cheenu on November 11 2003 07:00 EST
- DAo - Connection Pooling by Paul Strack on November 11 2003 10:12 EST
- DAO, DataSource by Sean Sullivan on November 11 2003 12:21 EST
-
Reply to Message in Discussion / EJB Design[ Go to top ]
- Posted by: Viswa Cheenu
- Posted on: November 11 2003 07:00 EST
- in response to aakash bhatt
In DAO we just fetch the connection. App. Server is responsible for creating & closing the connections etc., -
DAo - Connection Pooling[ Go to top ]
- Posted by: Paul Strack
- Posted on: November 11 2003 10:12 EST
- in response to aakash bhatt
The connection pool is managed through the DataSource, not through the EJB class. So long as you retrieve the connection from the DataSource, pooling will work, whether you are calling the DataSource from your EJB class or from another class (such as a DAO). -
DAO, DataSource[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: November 11 2003 12:21 EST
- in response to aakash bhatt
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/