Package com.appslandia.common.jdbc
Class JdbcUtils
- java.lang.Object
-
- com.appslandia.common.jdbc.JdbcUtils
-
public class JdbcUtils extends java.lang.Object- Author:
- Loc Ha
-
-
Constructor Summary
Constructors Constructor Description JdbcUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseQuietly(java.lang.AutoCloseable closeable)static <T> java.util.List<T>executeList(ResultSetImpl rs, ResultSetMapper<T> mapper, java.util.List<T> list)static <T> java.util.List<T>executeList(StatementImpl stat, ResultSetMapper<T> mapper, java.util.List<T> list)static <K,V>
java.util.Map<K,V>executeMap(ResultSetImpl rs, ResultSetMapper<K> keyMapper, ResultSetMapper<V> valueMapper, java.util.Map<K,V> map)static <K,V>
java.util.Map<K,V>executeMap(StatementImpl stat, ResultSetMapper<K> keyMapper, ResultSetMapper<V> valueMapper, java.util.Map<K,V> map)static <K,V>
java.util.Map<K,V>executeMap(StatementImpl stat, java.lang.String keyColumn, java.lang.String valueColumn, java.util.Map<K,V> map)static <K,V>
java.util.Map<K,V>executeMap(java.sql.ResultSet rs, java.lang.String keyColumn, java.lang.String valueColumn, java.util.Map<K,V> map)static <T> TexecuteSingle(ResultSetImpl rs, ResultSetMapper<T> mapper)static <T> TexecuteSingle(StatementImpl stat, ResultSetMapper<T> mapper)static java.lang.String[]getColumnLabels(java.sql.ResultSet rs)static voidrollback(java.sql.Connection conn)static voidsetAutoCommit(java.sql.Connection conn)
-
-
-
Method Detail
-
rollback
public static void rollback(java.sql.Connection conn) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
setAutoCommit
public static void setAutoCommit(java.sql.Connection conn) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
closeQuietly
public static void closeQuietly(java.lang.AutoCloseable closeable)
-
executeSingle
public static <T> T executeSingle(StatementImpl stat, ResultSetMapper<T> mapper) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeSingle
public static <T> T executeSingle(ResultSetImpl rs, ResultSetMapper<T> mapper) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeList
public static <T> java.util.List<T> executeList(StatementImpl stat, ResultSetMapper<T> mapper, java.util.List<T> list) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeList
public static <T> java.util.List<T> executeList(ResultSetImpl rs, ResultSetMapper<T> mapper, java.util.List<T> list) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeMap
public static <K,V> java.util.Map<K,V> executeMap(StatementImpl stat, java.lang.String keyColumn, java.lang.String valueColumn, java.util.Map<K,V> map) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeMap
public static <K,V> java.util.Map<K,V> executeMap(java.sql.ResultSet rs, java.lang.String keyColumn, java.lang.String valueColumn, java.util.Map<K,V> map) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
executeMap
public static <K,V> java.util.Map<K,V> executeMap(StatementImpl stat, ResultSetMapper<K> keyMapper, ResultSetMapper<V> valueMapper, java.util.Map<K,V> map) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
executeMap
public static <K,V> java.util.Map<K,V> executeMap(ResultSetImpl rs, ResultSetMapper<K> keyMapper, ResultSetMapper<V> valueMapper, java.util.Map<K,V> map) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getColumnLabels
public static java.lang.String[] getColumnLabels(java.sql.ResultSet rs) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
-