RE: SQL2005 JDBC ClassNotFoundException

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The KB article you referenced is refering to the SQL2000 JDBC driver. Unfortunately, I am not aware of an updated one yet.

This is the Class syntax for 2005: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
This is the Class syntax for 2000: Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

Note the subtle difference in order between jdbc and sqlserver.

Evan

--------------------
Thread-Topic: SQL2005 JDBC ClassNotFoundException
thread-index: AcZtfd/v+5BFGOD1SmGzQgBp94Tzdw==
From: =?Utf-8?B?UnlhblM=?= <RyanS@xxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: SQL2005 JDBC ClassNotFoundException
Date: Mon, 1 May 2006 17:18:02 -0700

I've downloaded the SQL2005 JDBC and extracted it to a path that is in my
CLASSPATH. I then used the sample microsoft java code at
http://support.microsoft.com/default.aspx?scid=kb;en-us;313100 to output the
driver name/version and database name/version. When I execute the code with
"java -cp . <classfile>", I get th error: java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver. If I execute it with just
"java <classfile>" I get the error: java.sql.SQLException: No suitable driver.

I've even tried putting the JAR in the same folder as the class with no
success. I read some other posts about similar issues, and they noted 2
other JAR files that were not in the package that I downloaded from the
Microsoft site. All I have is "sqljdbc.jar".

Any ideas where I might be going wrong? Thanks!



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

.



Relevant Pages

  • Re: Problem with boolean return parameter of CallableStatement.exe
    ... JDBC driver with Java 1.5.0 06. ... Some of our code uses the execute method of a CallableStatement to get a result set and checks that the boolean return parameteris true before then processing that result set. ... Using the sybase jdbc driver 'true' is returned when there are any results, whereas with the sqljdbc driver a 'false' is being returned. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: slow connections with jdbc driver and no entry in hosts file
    ... slow connections with jdbc driver and no entry in hosts file ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: JDBC and handling of errors
    ... connect to an SQL Server and execute some stored procedures. ... JDBC driver. ... If I use our MS SQL Server 2000 Driver for JDBC driver as below, ...
    (microsoft.public.sqlserver.clients)
  • Re: jdbc help:sun.jdbc.odbc.JdbcOdbcDriver
    ... > * I have just started JDBC in java. ... The interfaces in java.sql.* are implemented by the provider of the JDBC driver (which ... The provider may be Sun ... ...
    (comp.lang.java.help)
  • RE: MS JDBC Rowset size doubled ?
    ... | I'm a SQL Server DBA, doing some profiling and tuning on a SQL Server ... | database that is being accessed by a JDBC Driver. ... | This is a MS JDBC Driver, running under IBM Websphere access SQL ... | The developers claim they are not adding the asterisk and that SQL ...
    (microsoft.public.sqlserver.jdbcdriver)