Solved

example java code using jndi to connect to Oracle

Posted on 2008-10-27
10
1,570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
10 Comments
 
LVL 20

Accepted Solution

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

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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 60

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
 
LVL 60

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 60

Expert Comment

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

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

615 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