• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to load the JDBC driver

 
Ranch Hand
Posts: 37
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use colons, not semicolons, to separate entries in your classpath on a Unix system.
 
Nirmal Mukundan
Ranch Hand
Posts: 37
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not understand. Where are you asking to use the colons. Since I did not use any export command ...
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 37
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
rubbery bacon. rubbery tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic