This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC Driver for Sql Server Class not found Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Driver for Sql Server Class not found Exception" Watch "JDBC Driver for Sql Server Class not found Exception" New topic
Author

JDBC Driver for Sql Server Class not found Exception

Tamil vanan
Greenhorn

Joined: May 13, 2007
Posts: 2
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
sathish kumar
Ranch Hand

Joined: Feb 14, 2007
Posts: 47
Check this out!

http://support.microsoft.com/kb/313100
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

"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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Consider Paul's rocket mass heater.
 
subject: JDBC Driver for Sql Server Class not found Exception
 
Similar Threads
JDBC connection with SQL Server 2008 R2
How to connect Driver
looking for help with datatype match
prepareStatement problem with the driver classes12.zip
looking for help with datatype match