I am studying for the Spring Core certification and I have some doubts about the use of JdbcTemplate . On the study material I found this question:
Can I execute a plain SQL statement with the JDBC template?
What exactly is a plain SQL statement ? Is it a standard SQL query? or what?
If it is a standard SQL query (not something like JPQL) I think that the answer is yes because I can do something like it:
public Date getOldest() {
String sql = “select max(dob) from PERSON”;
return jdbcTemplate.queryForObject(sql, Date.class);
}
public long getPersonCount() {
String sql = “select count(*) from PERSON”;
return jdbcTemplate.queryForObject(sql, Long.class);
}
But I am absolutly not sure to have understand the sense of the question and what exactly represent a plain SQL statement .
What do you think about?
From my point of view:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.