The SQLProcessor was created with the following motivations in mind:
- To fix some of the weaknesses of raw JDBC, including:
- Tons of
- Extremely verbose code.
- How easy it is to leave connections, statements, and result sets open.
- Matching "?" fields in PreparedStatements with values in subsequent code, which is very error prone.
- It's difficult to provide debug output for PreparedStatements.
- JDBC syntax errors can be cryptic, and therefore not fully useful.
- Finding a way to make SQL code more descriptive. Add a way to annotate SQL code for later support and readability.
- Provide convenience methods for commonly invoked SQL tasks.
With these goals in mind, let's look at some JDBC code examples.