• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC Driver for Sql Server Class not found Exception

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai, i am tried to use the Sql Server with Java and Tomcat 5.0 Application Server.
I am using the JDBC Driver for Java connecting with SQL Server. I am using SQL Server 2005.
I have used the following code for java database connectivity with SQL Server.


import java.sql.*;
public class Test {
public static void main(String[] args)
{
try
{
//load the driver class
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433; DatabaseName=timetracking ");
}
catch(ClassNotFoundException cnfe)
{
System.err.println(cnfe);
}
catch (SQLException sqle)
{
System.err.println(sqle);
}
}
}




The above code was compiled successfully, but it's not running. The below error was raised. I have coped and paste it the JDBC Driver class for SQL Server 2005(sqljdbc.jar) to the WEB-INF/lib folder.

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver



I don't know what i am doing with wrong. If anybody know, how to solve this, kindly post me.

Thanks

Tamilvanan
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this out!

http://support.microsoft.com/kb/313100
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Tamilvanan",
We're pleased to have you here with us here at JavaRanch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character.

Thanks,
Jeanne
Forum Bartender
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic