Hi all,
In my
EJB i get the databse connection using this code
<env-entry>
<env-entry-name>poolname</env-entry-name>
<env-entry-type>java.lang.String </env-entry-type>
<env-entry-value>MyConnectionPool</env-entry-value>
</env-entry>
and i get the database connection using the code below
initCtx = new InitialContext();
String pool = (String) ((Context)initCtx.lookup("java:comp/env/poolname");
DataSource ds = (javax.sql.DataSource)initCtx.lookup(pool);
I use the above "ds" to get the database connection
Also i read that we can get the connection by using <resource-ref> as shown below
<resource-ref>
<res-ref-name>MyconnectionPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Can any one tell me the diffrence between the 2 approaches.
thanks in advance
Hari