Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdb:odbc:yourDSN");
Use this then try!

解决方案 »

  1.   

    有几个步骤
    1。注册数据库驱动程序
    2。创建数据库连接对象!
    3。创建Statement 或 Prestatement 对象。两者得区别在于:前者不支持参数却每次访问数据库都须重新编译sql语句;后者支持参数设置且sql语句只在第一次访问数据库时编译,以后无须再编译。
    4。执行Statement 或 Prestatement 把结果付给ResultSet对象!Let's ok!祝你好运!