I am using Spring boot for my application. Using jdbctemplate to run MySQL queries.
query = "Select * from users";
List<Map<String, Object>> response = jdbcTemplate.queryForList(query);
Current output:
[
{
"id": 1,
"firstname": "Sam",
"address": "US"
},
{
"id": 2,
"firstname": "Alex",
"address": "US"
}
]
I want to return like below output using jdbctemplate. Is there any method in jdbctemplate to return like below output?
Expected output:
[
[
"id"
"firstname"
"address"
],
[
1,
"Sam",
"US"
],
[
2,
"Alex",
"US"
]
]