title: JDBC Problem wth select where query
body: <p>My Code:</p>
  
  <pre><code>con = jdbc.connect();
          System.out.println("status of con"+con);
  String query = " select * from BmgCPUTotalUsage where CPUserID='"+CPUserID+"' and MessageTypeID='"+MessageTypeID+"'";
          System.out.println(query);
          PreparedStatement statement = con.prepareStatement(query);
      ResultSet result = statement.executeQuery();
      System.out.println(result);
      int QuotaUsed=result.getInt("QuotaUsed"); 
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>   status of concom.mysql.jdbc.JDBC4Connection@182600f
       select QuotaUsed from BmgCPUTotalUsage where CPUserID='msdp' and MessageTypeID='SMS'
      com.mysql.jdbc.JDBC4ResultSet@16e1dd8
      java.sql.SQLException: Before start of result set.
  </code></pre>
  
  <p>Can anybody please say me how can I remove this exception.and fetch the QuotaUsed from the table.where QuotaUsed  is an integer.</p>