Connecting to DataBase
hello ,
how to connect to MySql database i have copied sqljdbc.jar in eclipse IDE
(right click on project ,click on properties,click on java build path,clicked on
libraries and clicked on add external jar files and in c:\program
files\Microsoft sql server\Microsoft sql server 2005 JDBC Driver sqljdbc.jar
file is copied into the built path ) but when i am writing the sql program
for ex:
import java.sql.*;
public class SqlDemo {
public static void main(String args[]) throws Exception
{
Driver drv = new com.mysql.jdbc.Driver();
DriverManager.registerDriver(drv);
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","",");");
System.out.println("Connection Opened");
System.out.println("Connection class"+con.getClass());
}
}
eclips is not recognizing the Driver class what is the solution for this
plz mention me in clear steps to connect to data base and copiying the jar files . i am using type IV Driver plz reply me soon

