public class SQLUnitils extends Object
| 构造器和说明 |
|---|
SQLUnitils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
executeUpdate(String sql,
DataSource dataSource)
Executes the given update statement.
|
static int |
executeUpdateQuietly(String sql,
DataSource dataSource)
Executes the given statement ignoring all exceptions.
|
static long |
getItemAsLong(String sql,
DataSource dataSource)
Returns the long extracted from the result of the given query.
|
static String |
getItemAsString(String sql,
DataSource dataSource)
Returns the value extracted from the result of the given query.
|
static Set<String> |
getItemsAsStringSet(String sql,
DataSource dataSource)
Returns the items extracted from the result of the given query.
|
static boolean |
isEmpty(String tableName,
DataSource dataSource)
Utility method to check whether the given table is empty.
|
public static int executeUpdate(String sql, DataSource dataSource)
sql - The sql string for retrieving the itemsdataSource - The data source, not nullpublic static int executeUpdateQuietly(String sql, DataSource dataSource)
sql - The sql string for retrieving the itemsdataSource - The data source, not nullpublic static long getItemAsLong(String sql, DataSource dataSource)
UnitilsException
is thrown.sql - The sql string for retrieving the itemsdataSource - The data source, not nullpublic static String getItemAsString(String sql, DataSource dataSource)
UnitilsException
is thrown.sql - The sql string for retrieving the itemsdataSource - The data source, not nullpublic static Set<String> getItemsAsStringSet(String sql, DataSource dataSource)
sql - The sql string for retrieving the itemsdataSource - The data source, not nullpublic static boolean isEmpty(String tableName, DataSource dataSource)
tableName - The table, not nulldataSource - The data source, not nullCopyright © 2008–2020 Matrix. All rights reserved.