title: Jdbctemplate query for string: EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
body: <p>I am using Jdbctemplate to retrieve a single String value from the db.  Here is my method.</p>
  
  <pre><code>    public String test() {
          String cert=null;
          String sql = "select ID_NMB_SRZ from codb_owner.TR_LTM_SLS_RTN 
               where id_str_rt = '999' and ID_NMB_SRZ = '60230009999999'";
          cert = (String) jdbc.queryForObject(sql, String.class); 
          return cert;
      }
  </code></pre>
  
  <p>In my scenario it is complete possible to NOT get a hit on my query so my question is how do I get around the following error message.</p>
  
  <pre><code>EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
  </code></pre>
  
  <p>It would seem to me that I should just get back a null instead of throwing an exception.  How can I fix this?  Thanks in advance.</p>