-
JDBC Driver for Sql Server Class not found Exception
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
Similar Threads
-
Replies: 26
Last Post: 12-01-2012, 04:12 AM
-
Replies: 1
Last Post: 10-06-2005, 03:35 PM
-
By Tibor Hegyi in forum Database
Replies: 0
Last Post: 10-02-2001, 08:29 AM
-
Replies: 1
Last Post: 04-19-2001, 05:58 PM
-
By andriano in forum Enterprise
Replies: 1
Last Post: 10-02-2000, 03:54 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks