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

  • Error while generating report by fragmenting two cubes.

    I have two Essbase cubes 'bas_reg'(current) and 'basreg09'(history) combined them into one in BMM layer by fragmentation based on Quarter of the Year. This two cubes have 3 unconfirmed dimensions . But for this report i am using the all fields from f

  • Is the Macbook Air 2011 able to run the Apple Cinema Display 30" ?

    Hello Everyone. So, I am about to buy a Macbook Air 2011 11". I want this product because of the ssd driver and the versality of such a light object. The things is that i work at school with a laptop, and when i come back home, i use my Apple Cinema

  • How to preview a whole portrait picture in pan zoom mode?

    Hi I'm new. Currently, I'm trying to create a slide show for my website, and I want to make some motion(zoom in zoom out fade in and fade out) in my pictures. In pan zoom mode, I can preview a whole landscape oriented picture, but portrait oriented p

  • Linksys CHAT hung up on me TWICE...What gives?

    I am very angry right now.  After waiting 10-20 minutes TWICE, I was disconnected by a Linksys rep, one named Angelvel. How can I get a REAL chat?  I need help!

  • Set event 100183 & 10027 in Oracle 11g

    Hi     I have upgraded the Oracle 10.2.0.4.0 to Oracle 11.2.0.2.0 . while running the script provided by SAP vide note no. 1171650 (Automated Oracle DB Parameter Check) , following recommendation comes after running the scripts means change the event