This content has been marked as final.
Show 1 reply
-
1. Re: External Hypersonic
timmorrow Sep 29, 2004 2:15 PM (in response to jerryp64)Define a resource reference in web.xml, then map that to the JBoss jndi name in jboss-web.xml and look it up (using the name defined in web.xml) from the container java:comp/env context.
web.xml:<resource-ref> <res-ref-name>jdbc/myDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
jboss-web.xml:<resource-ref> <res-ref-name>jdbc/myDS</res-ref-name> <jndi-name>java:/HypersonicDS</jndi-name> </resource-ref>
Code:InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/myDS");
Tim