java.lang.Object
org.seppiko.commons.utils.jdbc.ResultSetUtil
JDBC ResultSet utility
- Author:
- Leonard Woo
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanClose ResultSetConvert ResultSet toList<Map<ColumnName(String), ColumnValue(Object)>>.static <T> ArrayList<T> Convert ResultSet to entity list.
-
Method Details
-
convert
Convert ResultSet toList<Map<ColumnName(String), ColumnValue(Object)>>.- Parameters:
resultSet- ResultSet instance. Without close.- Returns:
- List of Map, value type is sql type.
- Throws:
SQLException- if a database access error occurs or this method is called on a closed result set.
-
convert
public static <T> ArrayList<T> convert(ResultSet resultSet, Class<T> clazz) throws SQLException, IllegalAccessException Convert ResultSet to entity list.- Type Parameters:
T- entity class type.- Parameters:
resultSet- ResultSet instance. Without close.clazz- entity class.- Returns:
- entity list.
- Throws:
SQLException- if a database access error occurs or this method is called on a closed result set.IllegalAccessException- target entity create failed.
-
close
Close ResultSet- Parameters:
resultSet- ResultSet instance.- Returns:
- true if ResultSet is closed. false is otherwise.
- Throws:
SQLException- if a database access error occurs.
-