Solved

example java code using jndi to connect to Oracle

Posted on 2008-10-27
10
1,565 Views
Last Modified: 2013-11-23
Can someone send me a snippet of java code that uses a jndi to connect to an Oracle Database
0
Comment
Question by:user1146
  • 4
  • 3
10 Comments
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 168 total points
ID: 22812305
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 22812347
0
 
LVL 59

Assisted Solution

by:Kevin Cross
Kevin Cross earned 166 total points
ID: 22812434
Hopefully you already have the OC4J library downloaded.

Here is the official information on this topic from Oracle:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-jndi-intro/doc/how-to-jndi-intro.html
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22812445
Take a look at the Oracle site and give it a try and then post back if you have any specific issues with getting this working.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22812463
Sorry, chaituu.  That is what happens when I open a question window and don't get to post into it for a few minutes.  I miss someone else posting. :)  Didn't check those links, but would guess they look about the same.
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 22812487
no problem mwvisa1.i am also checking your links.it will help me and also the author.here we come to share our knowledge.
0
 
LVL 20

Assisted Solution

by:Venabili
Venabili earned 166 total points
ID: 22814590
And I will just ask the very obvious question - why you cannot use JDBC and the Oracle Java driver? Not that the OC4J drivers are not good or that the JNDI way won't work but unless you really have a good reason not to, I would go with the JDBC way...

If you really need the JNDI thing - the guys above gave you wonderful answers.
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22815508
<sidebar at="Venabili">As usual, good point!  Glad to see you.</sidebar>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 76
Which is the latest version of Apache Tomcatl 3 50
Checkbox and ListView in Android Layout 4 56
Java Server Faces parameter pass? 6 39
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now