Hi Rudy,
Thanks for replying me once again.
Let I'll explain my query clearly:
Since you mentioned that ConnectionPoolDataSource is related with the ConnectionPool. To get a connection from the connection Pool Object I expect the following Code
Context ctx= new InitialContext();
ConnectionPoolDataSource cpDS=(ConnectionPoolDataSource)ctx.lookup("ConnectionPoolDataSource);
PooledConnection ps= cpDS.getPooledConnection(("myUserName", "myPassword");
Connection con= ps.getConnection();
That is in JNDI lookup we will search for ConnectionPoolDataSource for the ConnectionPoolDataSource Object for the ConnectionPool and get the pooledConneciton Object then we can get the connection OBject.
But in Sun
Doc or any other app server doc they are using the following Code:
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/EmployeeDB");
Connection con = ds.getConnection("myUserName", "myPassword");
.
So My Question is
1.
DataSource ds = (DataSource)ctx.lookup("jdbc/EmployeeDB");
Connection con = ds.getConnection("myUserName", "myPassword");
To get a connection Object from the connection Pool we are using DataSource Object and not Connection Pool DataSource.
2. I want to know how the Driver Class implements the Connection Pool Mechanism. Is it Driver Classes are internally using the Connection Pool DataSource Object.
3. In many documents it has mentioned that ConnectionPoolDataSource is used to get the Connection Object for the Connection POOL. But in nowhere they are using the ConnectionPoolDataSource.
Regards,
M.S.Raman