title: Sql statement to get single cell value
body: <p>I need to get a single cell value from the table. And I am using hibernate with Spring MVC.</p>
  
  <p>I did is:</p>
  
  <pre><code>Session s = getSessionFactory().getCurrentSession();  
  query q= s.createQuery("select xxx from abc where asd=:asd");
  </code></pre>
  
  <p>now, I need to save this single value into a string variable and need to use this string variable to compare with other string in a jsp page using <code>&lt;c:choose&gt; &lt;c:when&gt; &lt;c:otherwise&gt;</code> tags...</p>
  
  <p>This is what I have now..</p>
  
  <pre><code>@Transactional
  public String getUseNis(String code) {
  Session s = getSessionFactory().getCurrentSession();
  Query q = s.createQuery("select useNis from tle_location where code = :code");
  q.setString("code", code);
  String result = (String) q.uniqueResult();
  return result; 
  </code></pre>
  
  <p>I need to use the return value in a jsp page to check for either yes or no...how to pass it to my jsp page..</p>