在 java.How 将 sql 查询的结果保存到变量中?
java.sql.PreparedStatement preparedStatement = null;
String query = "select season from seasonTable where league_name=?";
preparedStatement = conn.prepareStatement(query);
preparedStatement.setString(1, league);
ResultSet rs = preparedStatement.executeQuery();
我需要将检索到的季节保存到变量中,我该怎么做?