This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connection Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Problem" Watch "Connection Problem" New topic
Author

Connection Problem

Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Hi all,
I am having a bit of difficulty getting a connection to my database using JDBC. I am using JDeveloper and have managed to create a connection to my database using the connection wizard. However when I attempt to create a connection in my code I get a ClassNotFoundException: oracle.jdbc.driver.OracleDriver
I have installed the classes12.jar in my <JAVA_HOME>\jre\lib\ext directory and can compile my code from the command line.
First question how do I set JDev to point to the SDK I want it to?
Secondly when I try and run the compiled code from the command line I am getting a SQLException: Invalid Oracle URL specified.
I have the following code
PLease can someone tell me where I am going wrong. I know that the database is listening on port 1521 and has a SID of ORA1 so I don't understand why I am receiving a SQLException.

Regards
Nigel
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

You know what, I think you will get a better response in the JDBC forum, so I am going to move this thread there.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Panic over.
I was missing a colon from my URL. It should have been
But if anyone knows the answer to my first question it would be welcome.
regards
Nigel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection Problem
 
Similar Threads
Not Suitable Driver Error
problem with connection
Database Connection
oracle connection with jdbc
Class.forName() for drive using Oracle 8i