public class SqlRunner
Constructor and description |
---|
SqlRunner
(DatabaseConnection databaseConnection, String query)
|
SqlRunner
(DatabaseConnection databaseConnection, String query, Object[] params)
|
SqlRunner
(Connection connection, String query)
|
SqlRunner
(Connection connection, String query, Object[] params)
|
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
close() Close connection, avoid closing if null and hide any SQLExceptions that occur. |
|
public boolean |
isConnectionAlive() |
|
public ResultSet |
query() Execute the given SELECT SQL query. |
<T> |
public T |
query(ListResultSetHandler<T> resultSetHandler) Execute the given SQL SELECT query. |
databaseConnection
- Database Connectionquery
- SQL querydatabaseConnection
- Database Connectionquery
- SQL queryparams
- Parameter objects for queryconnection
- Connectionquery
- SQL queryconnection
- Connectionquery
- SQL queryparams
- Parameter objects for queryClose connection, avoid closing if null and hide any SQLExceptions that occur.
Execute the given SELECT SQL query.
Execute the given SQL SELECT query. The caller is responsible for closing the connection.
resultSetHandler
- The handler that converts the results into an object.