введите описание изображения здесь У меня есть значения в JTable. Я хочу хранить его в MySQL. Я хочу, чтобы значения из ранга в JTAble были сохранены в ранге в MySQL.
try {
String n=(String)comboBoxc.getSelectedItem();
String sql="SELECT evaluation.* FROM `evaluation`INNER JOIN student ON evaluation.student_id=student.id WHERE student.Class=?";
String sql1="SELECT DISTINCT evaluation.*, FIND_IN_SET( percentage, ( SELECT GROUP_CONCAT( DISTINCT percentage ORDER BY percentage DESC) FROM evaluation INNER JOIN student ON evaluation.student_id=student.id WHERE student.Class=?) ) AS Rank FROM evaluation INNER JOIN student ON evaluation.student_id=student.id WHERE student.Class =?";
String s="Update evaluation set rank=? Where evaluation.student_id=student.id";
PreparedStatement ps, ps1;
ps=con.prepareStatement(sql);
ps1=con.prepareStatement(sql1);
//ps.setString(1, n);
ps1.setString(1, n);
ps1.setString(2, n);
ResultSet rs=ps1.executeQuery();
table.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e1) {
e1.printStackTrace();
}