因此,我仅出于教育目的编写代码。那检查 通过扫描条形码来学习学生。所以当我运行我的 代码它给我一个错误“功能不受支持”。请我需要一些帮助。
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Connection conn = null;
PreparedStatement pst = null;
ResultSet rs = null;
try {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
conn = DriverManager.getConnection("jdbc:ucanaccess://D:\\1.mdb");
String sql = "select * from records where ID=1";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery(sql);
while (rs.next()) {
txtname.setText(rs.getString("s_Name"));
txtsection.setText(rs.getString("s_Section"));
txtage.setText(rs.getString("s_Age"));
txtlrn.setText(rs.getString("s_LRN"));
}
} catch (ClassNotFoundException | SQLException e) {
JOptionPane.showMessageDialog(null, e);
}
}
我该怎么办?谁能帮我?用这些?你可以让它运行吗?