'How would I display both first name and Surname on my html spring boot jdbc
I am using a select statement in my jdbcTemplate. I am trying to select firstname and surname and display them on the html page however I am getting errors.The error code I am getting on the HTml page is "Incorrect column count: expected 1, actual 2"
public List<String> getAllUserNames() {
List<String> usernameList = new ArrayList<>();
usernameList.addAll(jdbcTemplate.queryForList("SELECT FirstName,Surname from paitents",String.class));
return usernameList;
}
Html file
<tr th:each="user : ${users}">
<a href="#" th:text="${user} + ${user.Surname}" ></a> <br>
<!-- <td th:text="${user}"> </td> <br>-->
</tr>
</body>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
