No suitable driver found for 'ojdbc6.jar' [message #1016054] |
Mon, 04 March 2013 18:23 |
Richard Francis Messages: 4 Registered: March 2013 |
Junior Member |
|
|
Hi, this may appear simple and i hope it is...thanks for helping.
Using Eclipse SDK 4.2.1 on Windows Server 2003 SP2, Java jdk1.6.0_24
I build jar with referencd lib of ojdbc6.jar, right click select export -> java, jarfile -> next -> keep all defaults on jar file specs -> next -> keep defaults on jar packaging options -> next -> on jar manifest specs I have to select (and this is another question - why do i have to do this - or is this required, if required, why is it required, if I don't select this the jar fails with Failed to load Main-Class manifest attribute from file.jar) the class of the application entry point -> next -> finish
Then I copy the jar file into a directory where I've copied the ojdbc6.jar file. Then I set CLASSPATH=c:\file\ojdbc6.jar;c:\file\file.jar;.;
When I run the jar with 'java -jar file.jar' it fails with the error:
No suitable driver found for jdbc:oracle:thin:@10.10.10.10:1521:orcl
Retrying Connection for 1 time
However, when I build the jar manually, it works fine.
0. md c:\file\com\tasks
1. copy file.java to c:\file, copy ojdbc6.jar to c:\file, copy file.class to c:\file\com\tasks
2. javac file.java
3. jar -cvf file.jar com*
4. run with java com.tasks.file
java code executes without errors...what gives with the Eclipse setup, why doesn't java -jar file.jar work and why do i have set the application entry point.
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03153 seconds