title: How to save the result from JDBC query into a variable?
body: <p>in java.How to save a result of a sql query into a variable?</p>
  
  <pre><code>        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();
  </code></pre>
  
  <p>I need to save the retrieved season into a variable how can I do this ?</p>