This content has been marked as final.
Show 1 reply
-
1. Re: how to make a jdbc connection to oracle db ?
peterj Jan 26, 2007 3:25 PM (in response to hussain.maricar)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.