Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you use a database connection in java application

Russell MAug 23 2013 — edited Aug 26 2013

Hi,

In verion 10 of jdeveloper we used a datasource object  and the following code to connect to our database.

      Context ic = new InitialContext();

      DataSource ods = (DataSource) ic.lookup("jdbc/mps");

      con = ods.getConnection();

our datasource defines  mps as the name.  The ic.lookup finds it in the jdbc tree.

Now in version 11 we created a database connection and referenced it in the ic.lookup call but it does not work.  we cannot seem to find how to connect to the database connection  from the application.  How is this done now?  I also don't see a way to create a datasource entry via the scripts.

Thanks for your help.

Russell

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2013
Added on Aug 23 2013
5 comments
388 views