title: How do I export the result of a query to an Excel file?
body: <p>Given the following query:</p>
  
  <pre><code>     String SQL = "select name,years from person"; 
       ps = con.createStatement();
       rs = ps.executeQuery(SQL);
       jTable1.setModel(DbUtils.resultSetToTableModel(rs));
  </code></pre>
  
  <p>How can I easily export data to an Excel file?</p>
  
  <p>Thank you</p>