public class SqlUtils extends Object
| Constructor and Description |
|---|
SqlUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Connection conn) |
static void |
close(ResultSet resultSet) |
static void |
close(Statement stmt) |
static <T> T |
execute(Connection conn,
String sql,
Class<T> clazz,
Object... args) |
static <T> T |
execute(PreparedStatement stmt,
Class<T> clazz,
Object... args) |
static ResultSet |
execute(PreparedStatement stmt,
Object... args) |
static ResultSet |
executeCore(Connection conn,
String sql,
Object... args) |
static <T> List<T> |
executeList(Connection conn,
String sql,
Class<T> clazz,
Object... args) |
static <T> List<T> |
executeList(PreparedStatement stmt,
Class<T> clazz,
Object... args) |
static <T> void |
executeSetArgs(PreparedStatement stmt,
Object... args) |
static <T> List<T> |
list(ResultSet rs,
Class<T> clazz) |
static <T> List<T> |
list(ResultSet rs,
Class<T> clazz,
boolean bClose) |
static <T> T |
single(ResultSet rs,
Class<T> clazz) |
static <T> T |
single(ResultSet rs,
Class<T> clazz,
boolean bClose)
Returns the 1st column of the first row or null of there is no row.
|
public static <T> void executeSetArgs(PreparedStatement stmt, Object... args) throws SQLException
SQLExceptionpublic static <T> T execute(Connection conn, String sql, Class<T> clazz, Object... args) throws SQLException
SQLExceptionpublic static ResultSet executeCore(Connection conn, String sql, Object... args) throws SQLException
SQLExceptionpublic static ResultSet execute(PreparedStatement stmt, Object... args) throws SQLException
SQLExceptionpublic static <T> T execute(PreparedStatement stmt, Class<T> clazz, Object... args) throws SQLException
SQLExceptionpublic static <T> List<T> executeList(Connection conn, String sql, Class<T> clazz, Object... args) throws SQLException
SQLExceptionpublic static <T> List<T> executeList(PreparedStatement stmt, Class<T> clazz, Object... args) throws SQLException
SQLExceptionpublic static void close(Connection conn)
public static void close(Statement stmt)
public static void close(ResultSet resultSet)
public static <T> T single(ResultSet rs, Class<T> clazz) throws SQLException
SQLExceptionpublic static <T> T single(ResultSet rs, Class<T> clazz, boolean bClose) throws SQLException
SQLExceptionpublic static <T> List<T> list(ResultSet rs, Class<T> clazz) throws SQLException
SQLExceptionpublic static <T> List<T> list(ResultSet rs, Class<T> clazz, boolean bClose) throws SQLException
SQLExceptionCopyright © 2015. All rights reserved.