Campbell Ritchie wrote:Ask your computer to echo your classpath. Because there are spaces in it, you may need to surround the classpath in "quotes".
Philip Grove wrote:... the environment variables on my Windows computer (including the classpath) contain spaces and works fine...
Also I have a question that classpath also been set for java...
where am I doing wrong in previous problem.(Connecting to Database).
Punya Pratap Singh wrote:When I use the command then output is as follows ---
CLASSPATH=C:\Program Files\SQL server driver\jtds-1.2.5.jar;
Also I have a question that classpath also been set for java.then why only class path for this particular jar is showing,why not for all set class path's.
Also suggest me ,where am I doing wrong in previous problem.(Connecting to Database).
set classpath = "C:\Program Files\SQL server driver\jtds-1.2.5.jar";%classpath%
Ulf Dittmer wrote:IMO, using the CLASSPATH environment variables is more trouble than it's worth. Something like this would be preferable:
java -cp "C:\Program Files\SQL server driver\jtds-1.2.5.jar;." Test
Punya Pratap Singh wrote:Thanks Ulf Dittmer,Ashutosh
Now It is able to locate the class but saying that this driver is not appropriate.
As I already mentioned that I am using windows autentication.
Is it not possible to connect to Sql server with windows autentication ??
Vijitha Kumara wrote:Welcome to CodeRanch, Rob Sang!
Philip Grove wrote:The code might be the same, but the problem and the exception is another and this thread is titled "ClassNotFoundException".
Verify that you can connect to the server through other means than your code, from the same computer that your code runs on.