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);

}

}

}

相关文章:

  • 2021-07-04
  • 2021-06-30
  • 2021-11-21
  • 2021-05-03
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-22
  • 2022-03-08
  • 2021-11-08
  • 2021-05-18
  • 2021-11-27
  • 2021-11-16
相关资源
相似解决方案