如何快速的将jdbc结果集映射到对象中去

2024-12-02 04:40:54
推荐回答(1个)
回答(1):

注解
List pojoList = resultSetMapper.mapRersultSetToObject(resultSet, SamplePojo.class);
// print out the list retrieved from database
if(pojoList != null){
for(SamplePojo pojo : pojoList){
System.out.println(pojo);
}
}else{
System.out.println("ResultSet is empty. Please check if database table is empty");
}