Trong khi đang sử dụng mã này nó cho thấy java.sql.SQLException Parameter index out of range (1 > number of parameters, which is 0)
:java.sql.SQLException Parameter index ra khỏi phạm vi
private void cmd_searchActionPerformed(java.awt.event.ActionEvent evt) {
try{
String sql = "select * from STD where Name like '%?%' ";
pst=conn.prepareStatement(sql);
pst.setString(1,TXT_STUDENTNAME.getText());
String value=TXT_STUDENTNAME.getText();
rs=pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}
Làm thế nào tôi có thể phục hồi từ ngoại lệ này?
thankz maaan itz working ... –