| java.lang.Object org.unitils.core.dbsupport.SQLHandler
SQLHandler | public class SQLHandler (Code) | | Class to which database updates and queries are passed. Is in fact a utility class, but is a concrete instance to
enable decorating it or switching it with another implementation, allowing things like a dry run, creating a script
file or logging updates to a log file or database table.
author: Filip Neven author: Tim Ducheyne |
SQLHandler | public SQLHandler(DataSource dataSource)(Code) | | Constructs a new instance that connects to the given DataSource
Parameters: dataSource - The data source, not null |
SQLHandler | public SQLHandler(DataSource dataSource, boolean doExecuteUpdates)(Code) | | Constructs a new instance that connects to the given DataSource
Parameters: dataSource - The data source, not null Parameters: doExecuteUpdates - Boolean indicating whether updates should effectively be executed on the underlyingdatabase |
executeCodeUpdate | public int executeCodeUpdate(String sql)(Code) | | Executes the given code update statement.
Parameters: sql - The sql string for retrieving the items The nr of updates |
executeUpdate | public int executeUpdate(String sql)(Code) | | Executes the given statement.
Parameters: sql - The sql string for retrieving the items The nr of updates |
exists | public boolean exists(String sql)(Code) | | Returns true if the query returned a record.
Parameters: sql - The sql string for checking the existence True if a record was returned |
getItemAsLong | public long getItemAsLong(String sql)(Code) | | Returns the long extracted from the result of the given query. If no value is found, a
UnitilsException is thrown.
Parameters: sql - The sql string for retrieving the items The long item value |
getItemAsString | public String getItemAsString(String sql)(Code) | | Returns the value extracted from the result of the given query. If no value is found, a
UnitilsException is thrown.
Parameters: sql - The sql string for retrieving the items The string item value |
getItemsAsStringSet | public Set<String> getItemsAsStringSet(String sql)(Code) | | Returns the items extracted from the result of the given query.
Parameters: sql - The sql string for retrieving the items The items, not null |
isDoExecuteUpdates | public boolean isDoExecuteUpdates()(Code) | | Whether updates are executed on the database or not |
|
|