[jboss-user] [Beginners Corner] - Re: how to make a jdbc connection to oracle db ?

PeterJ do-not-reply at jboss.com
Fri Jan 26 15:25:34 EST 2007

The basic steps are to first define a *-ds.xml file for your database. Examples can be found at docs/examples/jca. Then in your application, you can look up the datasource using JNDI and from there get the JDBC connection:

Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:myDS");
Connection c = ds.getConnection();

When you are done, close the connection to release it back to the connection pool.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007008#4007008

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007008

More information about the jboss-user mailing list