Hi Peter Johnson
Thanks for your response.
I understand the concept now.
Have a question in getting it implemented.
http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html
This site says that there are 3 different types of datasource implementation
1. Basic implementation - produces a standard Connection object
2. Connection pooling implementation
3. Distributed transaction implementation
What i understood is every vendor will have 3 types of implementations as said above and provides connections appropriately.
For example,
1) in the sybase-ds.xml if i say <driver-class>com.sybase.jdbc2.jdbc.
SybDataSource</driver-class> and use
InitialContext context = new InitialContext();
DataSource dataSource = (DataSource) context.lookup("java:jdbc/SybaseDB");
Connection connection = dataSource.getConnection();
then i will get a normal connection object (the same as we get by invoking a DriverManager)
2) if i say <driver-class>com.sybase.jdbc2.jdbc.
SybConnectionPoolDataSource</driver-class> and use
InitialContext context = new InitialContext();
ConnectionPoolDataSource poolDataSource= (ConnectionPoolDataSource)context .lookup(""java:jdbc/SybaseDB");
PooledConnection pconn = poolDataSource.getPooledConnection();
then i will get a connection object from a pool.
3) com.sybase.jdbc2.jdbc.
SybXADataSource for Distributed transaction implementation.
This means that the second option specified above should be used for setting up a connection pool
Is my understanding correct?
Any help on this will be of great use.
Thanks and Regards
Nivi