OracleJDEV10_JNDI

I am new to JNDI ,I'm trying to connect to 10g using JDeveloper 10.1.3.2
Here is the code
String user="hr";
String password="xx";
// 1-Intialize Connecton Properties
OracleDataSource ods = new OracleDataSource();
ods.setURL("jdbc:oracle:thin:@127.0.0.1:1521:oracle");
ods.setUser(user);
ods.setPassword(password);
///2-Register DataSource
Context ctx=new InitialContext();
ctx.bind("jdbc/hr",ods);
//3-Open Connection
ods=(OracleDataSource)ctx.lookup("jdbc/hr");
Connection conn = ods.getConnection();
I always get the following error:
Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Thanks for help

Kuassi,
Actually microomran did post a JNDI_datasource in JDeveloper10.1.3.2 in the JDeveloper forum.
microomran,
Your URL looks incorrect to me.
And your mixing different methods.
Use either one or the other, but not both.
Once you create an instance of class "OracleDataSource" and set its properties, you don't need to use JNDI.
Please refer to the JDBC User's Guide and Reference which is part of the Oracle documentation and available from:
http://www.oracle.com/technology/documentation/index.html
Good Luck,
Avi.

Similar Messages

Maybe you are looking for

  • HT5295 podcasts downloaded to pc not working in podcast app on ipad after sync

    Hi, We have multiple apple devices so I download all my apps,movies,music,podcasts etc to my pc then sync to each device. I have found that even though I have downloaded episodes of podcasts to my pc and these are checked in the podcast section in iT

  • How do i change the boring white background that shows the google search button, thank you

    i have changed the tool bar backgrouind for something a bit more colourful but want to add a background picture to where the google search button is shown, at the moment its just boring white, hope you can help

  • Command + f2 doesn't work!

    Hi! Sorry for my english... but i try to explain my problem! I have an iMac27, two months ago i have bought a Dr. Bott for playing with my ps3. Ok, all works fine! Two weeks ago i came back from my holiday, i try to play but "command + f2" doesn't wo

  • Edits in iPhoto not showing up on file

    I've made some changes usingĀ  a few of the edit functions in iPhoto. The changes seem to appear when the photo is displayed in smaller views using the slider, but when I double click on the image, only the original shows up. Are the edits not saved?

  • How a user of external database can be connected to other database

    Hi I have two databases A and B. I have one user XYZ on database B.we want user XYZ to be connected to database A and also wants to create few tables on database A. Can you please tell me what are list of steps i need to perform. Regards, RJ.