i have encountered problem when trying to retrieve the score from my database and there seems to be something wrong with my sql statement. can someone help me check the codes? the table is named Table1 and consist of the column number, NameParticipant and Score.
private void results() { try { if(rs == null) { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:tips"); String sql = "Select NameParticipant from Table1 ORDER BY Score DESC LIMIT 1 "; Statement statement = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); rs = statement.executeQuery(sql); addtolabel(); } } catch(Exception e) { e.printStackTrace(); } } private void addtolabel() { try{ label91.setText(rs.getString("tips")); } catch(SQLException e) { e.printStackTrace(); } } }