import java.sql.*;
public class Main{
public static void main(String[] args) throws ClassNotFoundException {
Connection con;
Statement sql;
ResultSet rs;
con = null;
try {
String ur1="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/myfile/qfc.mdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(ur1);
sql= con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs = sql.executeQuery("select * from 设备号'");
while (rs.next()) {
String user = rs.getString("设备号");
System.out.println(user);
}
}
catch (Exception e) {
System.out.println("sql出错:");
System.out.println(e);
}
}
}