title: Exporting PDF files in Java
body: <p>I have a table that gets it's data from a SQL DB.
  I'm trying to find the easiest way to export that table, as it is, into a PDF file.
  Nothing fancy, just a title and the table with it's content.
  I've searched around here and also checked into external packages (docmosis and such), but did not make up my mind.
  I am fairly new in Java and I'm looking for the easiest way to export a table to a pdf.</p>
  
  <p>Trying to answer possible questions, here's how I populate the table:</p>
  
  <pre><code>try {
     result = DBConnection.getTableContent("customers", attributes, where, null, null);
     DefaultTableModel model = (DefaultTableModel) searchTable.getModel();
     model.setRowCount(0);
     for (int i = 0; i &lt; result.size(); i++) {                        
        model.addRow(result.get(i).toArray());
     }
  }
  </code></pre>
  
  <p>Thanks</p>