title: Java jdbc preparedstatements how can I check for empty row
body: <p>I am implementing a forgot_password type feature on my application and I can not find how to check if I have any rows returned. The user first enters his/her email and then I search the database if the email is found proceed otherwise stop and tell them their email has not been found; This is my code</p>
  
  <pre><code>           Connection dbConnection=null;
  
  
                      dbConnection= DB.getConnection();
              PreparedStatement preparedStatement= dbConnection.prepareStatement("Select email,password from profiles where email=?");
                  preparedStatement.setString(1, User_Email);
             preparedStatement.executeQuery();
  // This code is not working below empty null rows still say email found
   if(preparedStatement==null)           
  {
      return ok("Email not found");
  }
  else
  {
   return ok("Email Found");
   }
  </code></pre>
  
  <p>The User_Email string works correctly and I have verified but it seems that </p>
  
  <p><strong>preparedStatement==null</strong> does nothing</p>