title: Get the value of COUNT(*) into an html table
body: <p>I'm using a servlet to make the jdbc connection, write the PreparedStatements and execute ResultSets. I am able to display the data into a webpage just fine, however I also want to be able to count the number of entries. I know there are other ways to count how many rows I have using java code, but I want to use SQL statements and I saw this</p>
  
  <pre><code>SELECT COUNT(*) FROM table_name;
  </code></pre>
  
  <p>and made a preparedstatement and tried to execute. However, it is not returning the value of the count, I instead get 
   <code>"com.mysql.jdbc.JDBC42ResultSet@4a9b1e8b"</code> or <code>"com.mysql.jdbc.JDBC42PreparedStatement@4a9b1e8b"</code> (because I tried getting the value of the count using both). </p>
  
  <p>Basically, I am wondering how to get the count value in my html table from the servlet, not the long statements above. </p>
  
  <p>Many thanks, I'm a beginner. </p>