| Author |
Unable to load the JDBC driver
|
Nirmal Mukundan
Ranch Hand
Joined: Feb 21, 2007
Posts: 31
|
|
Hi
I was trying to execute a java file from Unix. I am using a JDBC connection in this program.
Code:
XXXXX/test/nirmal/Java > ls -lrt
drwxrwxrwx 3 ideasm10 ide 3 Jul 7 11:01 classes
drwxrwxrwx 3 ideasm10 ide 3 Jul 7 11:01 src
drwxrwxrwx 2 ideasm10 ide 3 Jul 7 11:47 lib
-rw-r--r-- 1 ideasm10 ide 71 Jul 7 13:01 sysout.log
From here I give the when I give the command
Code:
java -cp classes com/test/jdbc/InvalidNumberTest
I am getting java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver.
Then I placed the ojdbc14.jar in the lib abd then executed the command
Code:
java -cp classes;lib/ojdbc14.jar com/test/jdbc/InvalidNumberTest
Now I am getting the exception
Code:
Failed to load Main-Class manifest attribute from
lib/ojdbc14.jar.
Can some one please help me to execute the java file.
The same program can be executed from Windows using the same commnds.
Also can you please provide a .sh file wher I can set the classpaths and also execute the java program.
Thanks
Nirmal
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Use colons, not semicolons, to separate entries in your classpath on a Unix system.
|
 |
Nirmal Mukundan
Ranch Hand
Joined: Feb 21, 2007
Posts: 31
|
|
|
I did not understand. Where are you asking to use the colons. Since I did not use any export command ...
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Paul Clapham wrote:Use colons, not semicolons, to separate entries in your classpath on a Unix system.
What I meant by that was to use them in your classpath. That's why I used those words. Do you not see where you set your classpath? Let me point it out more precisely:
java -cp classes;lib/ojdbc14.jar com/test/jdbc/InvalidNumberTest
|
 |
Nirmal Mukundan
Ranch Hand
Joined: Feb 21, 2007
Posts: 31
|
|
Oops ..sorry..I didnt not recognize that..thanks for the quick solution..
I also wanted to know if there is any chat available so as to get expertise on issues quickly?
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
There isn't one here. There might be one somewhere else, but I expect if you want experts standing by to answer your questions in real time you might have to pay real money for that.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26168
|
|
Nirmal Mukundan wrote:I also wanted to know if there is any chat available so as to get expertise on issues quickly?
You got an answer in under an hour. That's pretty quick!
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Unable to load the JDBC driver
|
|
|