943,790 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 1450
  • Java RSS
Oct 21st, 2007
0

Sql + Java

Expand Post »
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
Similar Threads
Reputation Points: 12
Solved Threads: 3
Junior Poster in Training
Chaster is offline Offline
68 posts
since Jun 2007
Oct 21st, 2007
0

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Oct 21st, 2007
0

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.
Reputation Points: 12
Solved Threads: 3
Junior Poster in Training
Chaster is offline Offline
68 posts
since Jun 2007
Oct 22nd, 2007
0

Re: Sql + Java

Read your Eclipse documentatioin for how to set the class path for libraries you are using in your project.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Display Calculations to a Dialog Box
Next Thread in Java Forum Timeline: socket problem,,,,, plz help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC