[jboss-user] [Installation, Configuration & Deployment] - Re: Configure and use Connection pool of Jboss
jaikiran
do-not-reply at jboss.com
Tue Oct 24 00:02:50 EDT 2006
Assuming that this is your datasource configuration:
<datasources>
| <local-tx-datasource>
| <jndi-name>MyAppDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@youroraclehost:1521:yoursid</connection-url>
| .....
|
| </datasources>
Note the jndi-name that you have specified for your datasource. The datasource will be bound to java:/MyAppDS jndi-name(in this example). From your web application, you can do a jndi lookup of this datasource, using the jndi-name that you have specified for the datasource, which will return you a Datasource object. You can then invoke the getConnection() method on the returned object. Something like:
Context ctx = new InitialContext();
| Datasource ds = ctx.lookup("java:/MyAppDS");
| Connection conn = ds.getConnection();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980247#3980247
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980247
More information about the jboss-user
mailing list