title: java.sql.SQLException: Before start of result set
body: <p>I'm facing a problem getting data from my <code>MySql</code> database. My code is the following:</p>
  
  <pre><code>        try {
          Connection con = datasource.getConnection();
          Statement stmt = con.createStatement();
  
          ResultSet rs;
          rs = stmt.executeQuery("SELECT tittle,date,path " +
                  "FROM announcement "+
                  "ORDER BY date");
          String tittle=rs.getString("tittle");
          String date=rs.getString("date");
          String text=rs.getString("path");
  
  
       if (!rs.isBeforeFirst())
       {
          out.println("&lt;p&gt;No data !&lt;/p&gt;");
      }
       else
       {            
          out.println("&lt;table class=\"data\"&gt;");
          out.println("&lt;tr &gt;&lt;td class=\"sectionheader\"&gt; tittleς&lt;/td&gt;&lt;td            class=\"sectionheader\"&gt;date&lt;/td&gt;&lt;td class=\"sectionheader\"&gt;text&lt;/td&gt;&lt;/tr&gt;");
  
          while (rs.next()) {
              String row="";
              row  += "&lt;td&gt;&lt;a href=\"\"&gt; "+tittle+ "&lt;/td&gt;";
              row  += "&lt;td&gt;" + date + "&lt;/td&gt;";
              row +="&lt;td&gt;"+text+"&lt;/td&gt;";
  
              row +="&lt;/tr&gt;";
              out.println(row);
  
          }
  </code></pre>
  
  <p>The error I get is <code>"java.sql.SQLException: Before start of result set"</code>
  Any tip of what I am doing wrong? </p>
  
  <p>Thank you in advance.</p>