title: comparing values that you get from database in java and sql
body: <p>im trying to compare the two values i get from my database and will return true if BOTH values are null or it doesnt exist in my database. And i already try debugging in netbeans it will jump from rs.getString("post_id").equals(""); to return liked; it will not read the next rs.getString and if statement. here is my code by the way</p>
  
  <pre><code>public boolean likedPost()
  {
      String thePostID = POSTID();
      String likerName = objInfo.name;
      boolean liked = true;
  
      try
      {
          String sql = "select * from Like where post_id=? and people_who_like=?";
          pst = conn.prepareStatement(sql);
          pst.setString(1,thePostID);
          pst.setString(2,likerName);
          rs = pst.executeQuery();
          boolean comparePostID = rs.getString("post_id").equals("");
          boolean compareLiker = rs.getString("people_who_like").equals("");
  
          if(liked == (comparePostID &amp;&amp; compareLiker))
              liked = true;
          else
              liked = false;
      }
  
      catch(Exception e)
      {
          JOptionPane.showMessageDialog(null,e);
      }
  
      return liked;
  }
  </code></pre>