我是用Microsoft Access 2003 建立的数据,文件名是db1.mdb
存放位置是同目录下,请各位帮忙看下,那里有问题!
import java.sql.*;
import java.io.*;
public class dataAccess
{
private Connection con;
private Statement sate;
/*------------------------------------------
-------------该方法用于连接数据库-----------
-------------------------------------------*/
public dataAccess()//构造函数
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dbur1 = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=account.mdb";
con = DriverManager.getConnection(dbur1);
sate = con.createStatement();
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
}
..........................
...........................
........................
}