title: How to get a single value back from query vs resultset
body: <p>I have a JSP file that runs a select statement against an Oracle database.</p>
  
  <p>All the examples I have seen use something like:</p>
  
  <pre><code>Statement st=connection.createStatement();
  ResultSet rs=st.executeQuery("Select * from data");
   while(rs.next(){
  String name=rs.getString("name");
  String add=rs.getString("address");
  out.println(name+" "+add);
   }
  </code></pre>
  
  <p>I will never have more than one row coming back is there an alternative to ResultSet and a while loop to get at my returning single row of data?</p>