title: Java SQL how to get value from a column?
body: <p>Nice to meet you all! I wanna get value from a column with the simple following code:</p>
  
  <pre><code>String statement = "select rated,vote_count from iptv_media_source where channel_id= '"
                  + channelId + "'"; 
  float rated = 0; 
  int vote_count =0;
  
  try {           
      rs =Main.db.getCon().createStatement().executeQuery(statement);
      rated = rating.getFloat("rated");
      vote_count = rating.getInt("vote_count");       
  vote_count++; rated++;
  
      statement = "UPDATE iptv_media_source SET rated = '"+rated+"' , vote_count = '"+vote_count+"' WHERE channel_id= '" + channelId + "'";
      Main.db.getCon().createStatement().executeUpdate(statement);
  
  } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  </code></pre>
  
  <p>The UPDATE statement runs well, but these 2 lines:</p>
  
  <pre><code>rated = rating.getFloat("rated");
  vote_count = rating.getInt("vote_count");
  </code></pre>
  
  <p>got some problems. Thanks for any reply!</p>