This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes connecting with oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connecting with oracle" Watch "connecting with oracle" New topic
Author

connecting with oracle

abhijeet srivastava
Greenhorn

Joined: Aug 22, 2006
Posts: 26
Hi all!

I am using jdk1.6 and oracle 9i. My jdbc driver is classes111.jar. Though this is getting loaded but i am not able to connect my application with database. Connection string is-

Connection conn = DriverManager.getConnection("jdbcracle:thin@localhost:1521:<SID name>","scott","tiger");

It is throwing SQLException.

Whats wrong??
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why are you using classes111.jar? That is the driver for 7i I think. Have a a look at their driver support page to get the correct one.


It is throwing SQLException.

What is the SQLException message?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Can you give the full exception ? Any error code associated with the exception.


Rahul Bhattacharjee
LinkedIn - Blog
abhijeet srivastava
Greenhorn

Joined: Aug 22, 2006
Posts: 26
java.sql.SQLException: Invalid Oracle URL specified
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by abhijeet srivastava:
java.sql.SQLException: Invalid Oracle URL specified


The URL seems to be fine.
abhijeet srivastava
Greenhorn

Joined: Aug 22, 2006
Posts: 26
Ya i Checked but still not working. I have doubt in SID and user password.How can i know what is SID value (where it get stored in oracle directory). is scott and tiger are correct?
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
You can contact the database admin for this clarification.
 
Consider Paul's rocket mass heater.
 
subject: connecting with oracle
 
Similar Threads
to stop unlocking an account from if failed attempts is more than 5 within 24hrs
Need help from Oracle Gurus
DriverManager.getConnection
Connection Pool in WebSphere
Database connectivity taking too much time