public class RowExtractor2Map extends Object implements RowExtractor<Map<String,Object>>
| 构造器和说明 |
|---|
RowExtractor2Map() |
RowExtractor2Map(Map<String,String> alias) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Map<String,Object> |
createColumnMap(int columnCount)
Create a Map instance to be used as column map.
|
protected String |
getColumnKey(String columnName)
Determine the key to use for the given column in the column Map.
|
protected Object |
getColumnValue(ResultSet rs,
int index)
Retrieve a JDBC object value for the specified column.
|
Map<String,Object> |
mapRow(ResultSet rs,
int rowNum)
实现必须实现此方法来映射ResultSet中的每一行数据。
|
public Map<String,Object> mapRow(ResultSet rs, int rowNum) throws SQLException
RowExtractormapRow 在接口中 RowExtractor<Map<String,Object>>rs - 要映射的结果集(为当前行预初始化)rowNum - 当前行数null)SQLException - 如果遇到获取列值的SQLException(即,不需要捕获SQLException)protected Map<String,Object> createColumnMap(int columnCount)
By default, a linked case-insensitive Map will be created.
columnCount - protected String getColumnKey(String columnName)
columnName - the column name as returned by the ResultSetResultSetMetaData.getColumnName(int)protected Object getColumnValue(ResultSet rs, int index) throws SQLException
The default implementation uses the getObject method. Additionally,
this implementation includes a "hack" to get around Oracle returning a non
standard object for their TIMESTAMP datatype.
rs - index - SQLExceptionCopyright © 2023. All rights reserved.