• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1591
  • Last Modified:

example java code using jndi to connect to Oracle

Can someone send me a snippet of java code that uses a jndi to connect to an Oracle Database
0
user1146
Asked:
user1146
  • 4
  • 3
3 Solutions
 
chaitu chaituCommented:
0
 
Kevin CrossChief Technology OfficerCommented:
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Kevin CrossChief Technology OfficerCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
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
 
chaitu chaituCommented:
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
 
VenabiliCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
<sidebar at="Venabili">As usual, good point!  Glad to see you.</sidebar>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now