Okay, I\'m confused. My SQL Server JAR is here:
Volume in drive C has no label.
Volume Serial Number is 8008-2D93
Directory of c:\\temp
03/07/2014
copy sqljdbc4.jar under WebContent-->WEB_INF -->lib folder. This resolved my problem.
If you pass -jar to java.exe then the classpath is taken from the specified Jar file's manifest; all external classpath settings (e.g. %CLASSPATH%) are ignored.
Do one of:
Use java -cp ...\myapp.jar MainClassName
Put sqljdbc.jar into the Class-Path field in myapp.jar's manifest.
Discover and load sqljdbc.jar programmatically.
set the class path for sqljdbc4.jar
CLASSPATH= D:\sqljdbc_4.0.2206.100_enu\sqljdbc_4.0\enu\sqljdbc4.jar;
if you are eclipse user remove unnecessary .jar
file sqljdbc
If you programme application ZK, then put sqljdbc4.jar in the folder WebContent -> WEB_INF -> lib .
Reference: Anand's comment.
I got this error after updating my Eclipse STS, it turned out my server forgot all of its configuration info during the update. I had to set up the server's classpath and environment variables all over again and that fixed the issue.
Open a new command prompt, and try with steps as below, its not good to work inside C:\WINDOWS\system32
The issue says the sqljdbc4.jar is not properly set in the classpath.
C:\Test
set classpath=%classpath%;.;c:\temp\sqljdbc4.jar
java -jar "C:\Users\MYUSER\Documents\NetBeansProjects\myappSource\dist\myappSource.jar" -u MYUSER -p MYPASS -j "jdbc:sqlserver://127.0.0.1\\msqlserver:1433;database=MYDB"