up previous next contents
Up: sqlprocessor Previous: List of Figures Next: Motivation   Contents

Introduction

A lot of developers have switched to using tools like Hibernate to manage their database interactions in Java programs, but if you can't use Hibernate or a similar object-to-relational mapping tool, you're almost certainly going to be using JDBC.

Any developer that has worked with JDBC for a while appreciates its flexibility and broad database support, but you've probably also run into a few of the JDBC pitfalls, maybe forgetting to close a connection here or there, missing a question mark in a PreparedStatement, or you have code swimming in try/catch blocks as you try to figure out what to do with JDBC exceptions.

If you use traditional JDBC Statements with your SQL INSERT and UPDATE commands, you'll also be manipulating Strings like crazy, and your code may be open to SQL Injection attacks. These problems quickly lead you to use PreparedStatements, which solve some problems, but there are still issues with try/catch statements, and problems of closing Statements and ResultSets.

So, you know your JDBC code is ugly and error-prone, but what can you do?

This is where a tool named SQLProcessor comes in.