JDBC Utility Library

Sample Code

String sSQL = " SELECT * FROM <[TableName]> WHERE column = <[Condition]>"

SQLStatement sqlStatement = new SQLStatement(sSQL);

// To make the above a PreparedStatement, we would simply call the prepare() method on the SQLStatement instance

// Create a collection of parameter values (these could easily come from parsing an XML file, or the request parameter collection)

Entity branch = new Entity("SQLParms");

branch.add(new Leaf<String>("TableName", "Customer"));
branch.add(new Leaf<String>("Condition", "Smith"));

// Execute the statement, returning a resultset (Wrapper)
ResultSet resultSet = sqlStatement.executeSQL(branch).getResultSet();