DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Sql + Java (http://www.daniweb.com/forums/thread93797.html)

Chaster Oct 21st, 2007 1:13 pm
Sql + Java
 
Hi guys, sorry in advance for the following question:

So, I've downloaded the adequate SQL Server 2000 driver, from the Microsoft's website. I've installed it to C:\JDBC\. I've set the classpath variable using the command promt by typing:
set CLASSPATH=.;c:\jdbc\lib\msbase.jar;c:\jdbc\lib\msutil.jar;c:\jdb
c\lib\mssqlserver.jar;

The problem is that the following error message appears, when I run Microsoft's sample code(I am using Eclipse) :java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
... and so on.

Could anybody help me please? Thanks a lot

jwenting Oct 21st, 2007 4:51 pm
Re: Sql + Java
 
you didn't add the jar to your project...
The system classpath is not something you normally should use, as most tools will simply ignore it.
Set a classpath for each JVM you start as you start it.

Chaster Oct 21st, 2007 6:57 pm
Re: Sql + Java
 
Wow. I thought that 'set CLASSPATH=...' stuff set the variable and added the jars. So I was wrong. Please explain me detailed what should I do, becouse I'm new at this. Thanks for your patience.

Ezzaral Oct 22nd, 2007 12:26 pm
Re: Sql + Java
 
Read your Eclipse documentatioin for how to set the class path for libraries you are using in your project.


All times are GMT -4. The time now is 4:55 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC