Package javatapas.sql
Class GetMapFromResultSet
java.lang.Object
javatapas.sql.GetMapFromResultSet
public class GetMapFromResultSet extends Object
Get a Java Map from a JDBC ResultSet, using a specified column value as the Map key.
Published at https://www.javatapas.com/sql/Java-Get-Map-From-Result-Set.html
Javadoc at https://www.javatapas.com/docs/javatapas/sql/GetMapFromResultSet.html
Published at https://www.javatapas.com/sql/Java-Get-Map-From-Result-Set.html
Javadoc at https://www.javatapas.com/docs/javatapas/sql/GetMapFromResultSet.html
- Version:
- 2021-05-20
- Author:
- Kodiak Brown
-
Constructor Summary
Constructors Constructor Description GetMapFromResultSet()
-
Method Summary
-
Constructor Details
-
GetMapFromResultSet
public GetMapFromResultSet()
-
-
Method Details
-
getMapFromResultSet
private Map<String,Map<String,String>> getMapFromResultSet(ResultSet rset, String keyCol) throws SQLException- Parameters:
rset
- The ResultSet to convert to the Map.keyCol
- The name of the column within the ResultSet that will serve as the Map key. If the key column is null, then a incremented integer value will be used as the key.- Throws:
SQLException
-