Menu DEVPPL Search
157.707
MEMBERS
15.939
TOPICS
63.213
POSTS
  562
FLASH GAMES
7.718
TUTORIALS
 

Login

E-mail:
Password:

JDBC Driver for SQL Server 2005, Class not found Exception

0

Loading

JDBC Driver for SQL Server 2005, Class not found Exception

Postby Devtamil » Tue May 15, 2007 1:55 pm

Hai, i am tried to use the Sql Server with Java and Tomcat 5.0 Application Server. But the connection doesn't created.
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 [/i][/b]
Devtamil
 
Reputation: 0
Posts: 8
Joined: Mon May 14, 2007 6:06 am
Highscores: 0
Arcade winning challenges: 0

JDBC Driver for SQL Server 2005, Class not found Exception - Sponsored results

Sponsored results

Login to get rid of ads

 

^ Back to Top