title: How to handle jdbc.queryForObject if it doesn't return a row
body: <p>I would like to know how to properly use jdbc in my case.</p>
  
  <p>The <code>saveLinkHistory</code> column is a bit(1) type in mysql.</p>
  
  <pre><code>public boolean getIsSavedLinkHistory(String name) {
          String sql = "select saveLinkHistory from users where name = ?";
          Boolean isTracked = jdbcTemplateObject.queryForObject(sql, new Object[] { name }, Boolean.class);
          return isTracked;
  }
  </code></pre>
  
  <p>The query worked well until I got an error of <code>Incorrect result size: expected 1, actual 0</code> because sometimes the <code>name</code> didn't exist, the <code>queryForObject</code> method expects that I ALWAYS get 1 row as a result.</p>
  
  <p>How can I handle this case, just throw an exception that says "name" doesn't exist ? 
  and by the way, is <code>Boolean</code> ok here ? because I didn't see such code before.</p>