it seems your sqljdbc4.jar is not accessible when you run your application. Since you can't specify additional jars to the class path when using -jar, I would suggest to go with
java -cp MyAppl.jar;sqljdbc4.jar MyMainClass
Joined: Dec 19, 2007
Thanks for the tip, Tamas
I just want one file to cklick on. When I have the application in a .class file, it works well (I have sqljdbc4.jar in the classpath). I do not understand, if I have the folder wrapped in a .jar file, sqljdbc4.jar is not found any more.
If you really want just a single jar file, then you need to package the classes that make up the JDBC driver along with your application classes (adding the driver jar file as it is to your app's jar file will not work).