title: How to retrieve the Sum of particular field from MySql table column into variable
body: <p>Hii Guys!!!,
                I have written a query in MySql which gives the sum of particular field in table column  And the Query is </p>
  
  <pre><code>PreparedStatement st = con.prepareStatement("SELECT COUNT(toc) AS std FROM processeddata_table where date(calldate) between '2009-01-01' and '2012-09-01' and toc='std' GROUP BY toc ");
  </code></pre>
  
  <p>Now As per my need i have to store the sum of all 'std' values into a variable for which i have written code like </p>
  
  <pre><code>ResultSet res = st.executeQuery();      
  while (res.next())
  {
      int std='';
  }
  </code></pre>
  
  <p>How to get the sum of the field in variable named "std".</p>
  
  <p>Guys plz help me. Thanx in advance</p>