This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
I am using MS SQL Server 2000 and Tomcat 4.0. I am using Microsoft's JDBC Driver for MS SQL Server 2000. I have set up a data source in Tomcat and it works fine. I was reading throught the documentation on the driver I am using and was wondering if I had to execute code like this to take advantage of connection pooling : Context initialContext = new InitialContext(); Context envCtx = (Context) initialContext.lookup("java:comp/env"); ConnectionPoolDataSource pooledDataSource = (ConnectionPoolDataSource) envCtx.lookup("jdbc/SQLSERVER"); PooledConnection pcon = pooledDataSource.getPooledConnection(); Connection con = pcon.getConnection(); or if I could execute code like this : Context initialContext = new InitialContext(); Context envCtx = (Context) initialContext.lookup("java:comp/env"); DataSource dataSource = (DataSource) envCtx.lookup("jdbc/SQLSERVER"); Connection con = dataSource.getConnection(); Would the code above that doesnt use the ConnectionPoolDataSource interface still be taking advantage of ConnectionPooling? Is this true or do you have to cast the jndi lookup of your data source to a ConnectionPoolDataSource to take advantage of connection pooling?? Do all jdbc compliant drivers take care of implementing the ConnectionPoolDataSource for you so all you have to do is define a datasource and it will pool the connections automatically?? Thanks. Karim
[This message has been edited by karim qazi (edited November 20, 2001).]