|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.database.SQLUnitils
public class SQLUnitils
Utilities for executing statements and queries.
| Constructor Summary | |
|---|---|
SQLUnitils()
|
|
| Method Summary | |
|---|---|
static int |
executeUpdate(java.lang.String sql,
javax.sql.DataSource dataSource)
Executes the given update statement. |
static int |
executeUpdateQuietly(java.lang.String sql,
javax.sql.DataSource dataSource)
Executes the given statement ignoring all exceptions. |
static long |
getItemAsLong(java.lang.String sql,
javax.sql.DataSource dataSource)
Returns the long extracted from the result of the given query. |
static java.lang.String |
getItemAsString(java.lang.String sql,
javax.sql.DataSource dataSource)
Returns the value extracted from the result of the given query. |
static java.util.Set<java.lang.String> |
getItemsAsStringSet(java.lang.String sql,
javax.sql.DataSource dataSource)
Returns the items extracted from the result of the given query. |
static boolean |
isEmpty(java.lang.String tableName,
javax.sql.DataSource dataSource)
Utility method to check whether the given table is empty. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLUnitils()
| Method Detail |
|---|
public static int executeUpdate(java.lang.String sql,
javax.sql.DataSource dataSource)
sql - The sql string for retrieving the itemsdataSource - The data source, not null
public static int executeUpdateQuietly(java.lang.String sql,
javax.sql.DataSource dataSource)
sql - The sql string for retrieving the itemsdataSource - The data source, not null
public static long getItemAsLong(java.lang.String sql,
javax.sql.DataSource dataSource)
UnitilsException
is thrown.
sql - The sql string for retrieving the itemsdataSource - The data source, not null
public static java.lang.String getItemAsString(java.lang.String sql,
javax.sql.DataSource dataSource)
UnitilsException
is thrown.
sql - The sql string for retrieving the itemsdataSource - The data source, not null
public static java.util.Set<java.lang.String> getItemsAsStringSet(java.lang.String sql,
javax.sql.DataSource dataSource)
sql - The sql string for retrieving the itemsdataSource - The data source, not null
public static boolean isEmpty(java.lang.String tableName,
javax.sql.DataSource dataSource)
tableName - The table, not nulldataSource - The data source, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||