This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
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".
While normally a good theory, the environment variables on my Windows computer (including the classpath) contain spaces and works fine. If you set an environment variable in Windows my experience is that the change does not take effect on the command line before you start a new session.
to display classpath the command is without the assignment operator.
Punya Pratap Singh
Ranch Hand
Joined: Nov 23, 2010
Posts: 74
posted
0
When I use the command then output is as follows ---
C:\>set classpath
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).
Punya Pratap Singh wrote:When I use the command then output is as follows ---
C:\>set classpath
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).
Try setting it again as:
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
Yep That's a better approach. That will ensure it takes the right path to the jar.
Punya Pratap Singh
Ranch Hand
Joined: Nov 23, 2010
Posts: 74
posted
0
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 ??
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 ??
The URL you've used indicates the Microsoft proprietary SQLServer JDBC driver. To use JTDS you need
Use the connect string that Rob posted, that should clear up your problems. One good thing though, it is the driver that is complaining so there is no problems finding the correct driver.
Punya Pratap Singh
Ranch Hand
Joined: Nov 23, 2010
Posts: 74
posted
0
Now It is giving following Exception ,What could be the possible causes,
Please Help me.
Start a new thread to avoid getting overlooked as it is a different problem and different exception, and this time please post your code as we can't help without seeing the code.
Generally a connection refused is not a code issue, of course it can be. It is far more likely to be caused by the server no longer running in the same place or even allowing connections from the place of your code.
Punya Pratap Singh
Ranch Hand
Joined: Nov 23, 2010
Posts: 74
posted
0
The code is same as above.that is why I posted it here.
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.
I think,jar file was not set tot the classpath.When you can't set jar file to the classpath.This problem comes.Please check classpath by using echo command.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.