JDBC-ODBC访问Access
import java.sql.*; public class TestJDBC{ public static void main(String[] args){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:student","",""); Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery("select * from student"); while(rs.next()){ System.out.print("\t name:"+rs.getString(1)); System.out.print("\t sex:"+rs.getString(2)); System.out.print("\t score:"+rs.getString(3)); System.out.println(); } }catch(Exception e){ e.printStackTrace(); } } }