请问JSP如何通过JDBC与ACCESS连接

解决方案 »

  1.   

    你可以看看:
    http://www.java3z.com/cwbwebhome/article/article5a/5130.jsp?id=242
      

  2.   

    http://www.comprg.com.cn/bbs/ShowAnnounce.asp?boardID=1&RootID=1038&ID=1067首先配好ODBC数据源import java.sql.*; class database { 
    public static void main(String args[]) { 
    try{ 
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
    String url="jdbc:odbc:Access2000";  //Access2000是ODBC数据源
    Connection connection=DriverManager.getConnection(url); 
    Statement statement = connection.createStatement(); 
    String sql="SELECT * FROM table1"; 
    ResultSet rs = statement.executeQuery(sql); 
    String tt; 
    while (rs.next()) { 
    System.out.print("姓名:" + rs.getString("Name")); 
    System.out.println(" 年龄:" + rs.getString("Age")); 

    rs.close(); 
    connection.close(); 

    catch(Exception ex){ 
    System.out.println(ex); 
    System.exit(0);