Data is empty-development error collection

【Null pointer】

List<Map<String,Object>> resultList = null;

This is wrong, the correct way is as follows

List<Map<String,Object>> resultList = new ArrayList<Map<String, Object>>();

 【java.lang.IndexOutOfBoundsException: Index: 0, Size: 0】

Call the get method when no null operation is performed on the list returned by the query

The error is written as follows

log.debug(resultList.get(0));
log.debug(resultList.get(resultList.size() - 1));

Correct writing 

if(resultList!=null){
    log.debug(resultList.get(0));
}

 

Guess you like

Origin blog.csdn.net/qq_36766417/article/details/107553063