Home > database >  JDBCTemplate in mySQL query method and what is the difference between queryForList method?
JDBCTemplate in mySQL query method and what is the difference between queryForList method?

Time:05-13

Both methods can return a collection List, is the difference?

CodePudding user response:

A look at the source you understand:
The public & lt; T> List QueryForList (String SQL, Class ElementType) {
Return this. The query (SQL, enclosing getSingleColumnRowMapper elementType ());
}
QueryForList is invoked SingleColumnRowMapper (), returns the multi-line column data,
The query returns the multi-line column data more you want,
  • Related