Reputation: 11
Have a error, already added a jar rs2xml.jar but when project clean and build show this error- error: cannot find symbol
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
don't understand that, please help me.
private void productCodeKeyReleased(java.awt.event.KeyEvent evt) {
String tf=productCode.getText();
PreparedStatement ps = null;
ResultSet rs = null;
Result rt = null;
Connection con = getCon();
try {
if(tf.matches("^[0-9]+$")){
String query = "SELECT * FROM product WHERE ProductCode="+tf;
ps = con.prepareStatement(query);
rs=ps.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));//error show here
}else{
String query1 = "SELECT * FROM product WHERE ProductName LIKE'%"+tf+"%'";
ps = con.prepareStatement(query1);
rs=ps.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));// error show here
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(ps!=null){
rs.close();
ps.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Upvotes: 0
Views: 3488
Reputation: 11
Remove private Object DBUtils And import instead net.proteanit.sql.DbUtils
Upvotes: 1