通过jdbc 连接 Access
import java.sql.*;
public class Access
{
public static void main(String args[])
{
try
{
String strurl="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=books.mdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection(strurl) ;
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select * from books");
if(rs.next())
{
System.out.println(rs.getString("简介"));
}
}catch(Exception e)
{
System.out.println(e);
}
}
}