Мое предложение ORDER BY
не выполнено.Код:
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/kabumbu?autoReconnect=true&useSSL=false", "root", "****");
String q = "select player_id, sum(number_of_goals) as 'Number of Goals',school_name "
+ "from goal_scorers g , schools s "
+ "where g.school_id = s.school_id "
+ "group by g.player_id "
+ "ORDER BY number_of_goals DESC";
PreparedStatement pstm = conn.prepareStatement(q);
ResultSet rs = null;
rs = pstm.executeQuery();
jTable2.setModel(DbUtils.resultSetToTableModel(rs));
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}