Sql + Java

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jun 2007
Posts: 59
Reputation: Chaster is an unknown quantity at this point 
Solved Threads: 3
Chaster Chaster is offline Offline
Junior Poster in Training

Sql + Java

 
0
  #1
Oct 21st, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Sql + Java

 
0
  #2
Oct 21st, 2007
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 59
Reputation: Chaster is an unknown quantity at this point 
Solved Threads: 3
Chaster Chaster is offline Offline
Junior Poster in Training

Re: Sql + Java

 
0
  #3
Oct 21st, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,481
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 515
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Sql + Java

 
0
  #4
Oct 22nd, 2007
Read your Eclipse documentatioin for how to set the class path for libraries you are using in your project.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC