public class DatabaseQueryHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DatabaseQueryHelper.Config
The Enum Config.
|
static interface |
DatabaseQueryHelper.Filter<T>
The Interface Filter.
|
static interface |
DatabaseQueryHelper.RequestExecutionCallback
The Interface RequestExecutionCallback.
|
static interface |
DatabaseQueryHelper.ResultSetIteratorCallback
Callback interface for the
executeQueryStatement(Connection, String, ResultSetIteratorCallback)
method. |
| Modifier and Type | Method and Description |
|---|---|
static void |
executeQueryStatement(Connection connection,
String sql,
DatabaseQueryHelper.ResultSetIteratorCallback callback)
Unlike executeSingleStatement(String, boolean, RequestIteratorCallback), this method
iterates on the ResultSet and produces a table data structure in the form of a list of ordered key-value tuples.
|
static void |
executeSingleStatement(Connection connection,
String sql,
boolean isQuery,
DatabaseQueryHelper.RequestExecutionCallback callback)
Executes a single SQL statement.
|
public static void executeSingleStatement(Connection connection, String sql, boolean isQuery, DatabaseQueryHelper.RequestExecutionCallback callback)
connection - the connectionsql - the SQL expressionisQuery - whether it is a query or updatecallback - the callbackpublic static void executeQueryStatement(Connection connection, String sql, DatabaseQueryHelper.ResultSetIteratorCallback callback)
[[{column 1:value A}, {column 2: value B}, {column 3: value C}],
[{column 1:value D}, {column 2: value E}, {column 3: value F}],
[{column 1:value G}, {column 2: value I}, {column 3: value H}]]
The callbacks are on completing the whole data structure, on error, and on each row construction.connection - the connectionsql - the SQL expressioncallback - the callbackCopyright © 2010–2018 Eclipse Foundation. All rights reserved.