java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 在指定的 DSN 中,驱动程序和应用程序之间不匹配
import java.sql.*;
public class example {
public static void main(String[] args) {
// TODO 自动生成的方法存根
Connection con;
Statement sql;
ResultSet rs;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){
System.out.print(e);
}
try{
con = DriverManager.getConnection("jdbc:odbc:star","","");
sql = con.createStatement();
rs = sql.executeQuery("SELECT * FROM employee WHERE salary > 1900");
while(rs.next()){
String number = rs.getString(1);
String name = rs.getString(2);
Date date = rs.getDate("birthday");
double salary = rs.getDouble("salary");
System.out.printf("% - 4s",number);
System.out.printf("% - 6s",name);
System.out.printf("% - 15s",date.toString());
System.out.printf("% 6s\n",salary);
}
con.close();
}
catch(SQLException e){
System.out.println(e);
}
}
}
以上代码在eclipse上运行出现错误,系统是64位的,用的是sysWoW64中的odbcad32创建的数据源,求解啊,小白一个= =