up previous next contents
Up: sqlprocessor Previous: Introduction Next: A Simple JDBC Example   Contents

Motivation

The SQLProcessor was created with the following motivations in mind:

  1. To fix some of the weaknesses of raw JDBC, including:
    1. Tons of String manipulation.
    2. Extremely verbose code.
    3. How easy it is to leave connections, statements, and result sets open.
    4. Matching "?" fields in PreparedStatements with values in subsequent code, which is very error prone.
    5. It's difficult to provide debug output for PreparedStatements.
    6. JDBC syntax errors can be cryptic, and therefore not fully useful.
  2. Finding a way to make SQL code more descriptive. Add a way to annotate SQL code for later support and readability.
  3. Provide convenience methods for commonly invoked SQL tasks.

With these goals in mind, let's look at some JDBC code examples.