tags:

views:

45

answers:

2

while establishing database connectivity with java application,i tried to run .jar file it showing an error msg "Failed to load main class manifest attribute from c:\program files\sqljdbc_2.0.1803.100_enu\sqljdbc_2.0\enu\sqljdbc4.jar " how i can proceed further?

+1  A: 

First pick one from here

The .jar file with the driver is not supposed to be run - it is supposed to provide low-level implementation of the communication between your java application and the database in question.

Anyway, what are you doing "while establishing db connectivity" ?

Bozho
+1  A: 

Don't run the .jar file. It's a library. Instead you need to reference it whilst running your class file e.g.

java -cp c:\program files\..\sqljdbc_2.0\enu\sqljdbc4.jar {yourclassfile}

You can run a .jar file if it's configured as such. However a JDBC .jar won't have the appropriate configuration and you should think of it as similar to a (say) .DLL.

Brian Agnew
Don't forget to wrap the path in quotes. There's a space in it.
BalusC
Good point re. the spaces
Brian Agnew