Hello,
I am using a bmp where i want to use a res-ref-name as follows in the code:
private Connection getConnection()
throws SQLException
{
InitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/oracle");
return ds.getConnection();
}
catch(NamingException ne)
{
throw new EJBException(ne);
}
finally
{
try
{
if(initCtx != null) initCtx.close();
}
catch(NamingException ne) { throw new EJBException(ne); }
}
}
My ejb-jar.xml res-ref entries are as follows:
<resource-ref>
<res-ref-name>jdbc/oraclel</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
My jboss.xml is a follows:
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/oracle</res-ref-name>
<jndi-name>java:/OracleDS</jndi-name>
</resource-description>
</reference-descriptor>
I am not able to use the res-ref-name jdbc/oracle as shown in the code. Is
java:comp/env/ is the prefix we use in JBoss. I used the same code previously
with WLS 7.0 and it worked.
Can any one help me to solve this problem?
Thank you,
Srikanth Pragada.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931403#3931403
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931403
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user