Class SqlUtils
java.lang.Object
org.aksw.commons.util.jdbc.SqlUtils
- Author:
- Claus Stadler Date: 7/26/11 Time: 3:23 PM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic <T> Texecute(Connection conn, String sql, Class<T> clazz, Object... args) static <T> Texecute(PreparedStatement stmt, Class<T> clazz, Object... args) static ResultSetexecute(PreparedStatement stmt, Object... args) static ResultSetexecuteCore(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> voidexecuteSetArgs(PreparedStatement stmt, Object... args) static <T> List<T> static <T> List<T> static <T> Tstatic <T> TReturns the 1st column of the first row or null of there is no row.
-
Constructor Details
-
SqlUtils
public SqlUtils()
-
-
Method Details
-
executeSetArgs
- Throws:
SQLException
-
execute
public static <T> T execute(Connection conn, String sql, Class<T> clazz, Object... args) throws SQLException - Throws:
SQLException
-
executeCore
public static ResultSet executeCore(Connection conn, String sql, Object... args) throws SQLException - Throws:
SQLException
-
execute
- Throws:
SQLException
-
execute
public static <T> T execute(PreparedStatement stmt, Class<T> clazz, Object... args) throws SQLException - Throws:
SQLException
-
executeList
public static <T> List<T> executeList(Connection conn, String sql, Class<T> clazz, Object... args) throws SQLException - Throws:
SQLException
-
executeList
public static <T> List<T> executeList(PreparedStatement stmt, Class<T> clazz, Object... args) throws SQLException - Throws:
SQLException
-
close
-
single
- Throws:
SQLException
-
single
Returns the 1st column of the first row or null of there is no row. Also throws exception if there is more than 1 row and 1 column.- Returns:
- Throws:
SQLException
-
list
- Throws:
SQLException
-
list
- Throws:
SQLException
-