title: What are the pros and cons to writing DB2 stored procedures in SQL versus Java?
body: <p>With newer versions of DB2 you can write stored procedures in SQL or you can create procedures in Java (or other languages) that can then be added to the database and called just like SQL procedures.  I'm wondering what the the pros and cons of each method are.  I'm specifically interested in comparing those two types of procedures, not debating procedures versus external code which I think has already been covered. Here is what I've come up with so far:</p>
  
  <p>SQL:</p>
  
  <ul>
  <li><p>Better performance for basic SQL functionality</p></li>
  <li><p>Less verbose for simple logic, i.e. you can run SQL directly</p></li>
  <li><p>No extra compile step - just create procedure ...</p></li>
  </ul>
  
  <p>Java:</p>
  
  <ul>
  <li><p>More structured and full-featured code (classes, objects, reuse, libraries)</p></li>
  <li><p>Better resources for help both in terms of programmers and documentation</p></li>
  </ul>
  
  <p>Any other thoughts?</p>