同上
没有必要!不妨试一试
你是用的ODBC桥吧,配一下ODBC就可以了
桥连接不用驱动程序
如果还是不行的话可能是别的原因造成的
import java.sql.*;
public class Mssql_odbc{
public static void main(String[] args){
try{
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
Class.forName(driver);
System.out.println("驱动程序载入成功!");
String url = "jdbc:odbc:test";//test是数据源名
Connection con = DriverManager.getConnection(url,"","");
System.out.println("连接数据库成功!");
}catch(ClassNotFoundException e){
System.out.println(e);
}catch(SQLException e){
System.out.println(e);
}
con.close();
}
}
然后做一个叫test的数据源就可以了