I'm trying to query database using java, I don't understand the problem with this function. it return a garbage values.
I just want to retrieve from a MySQL database the values matching the first_name.
public List<Customer> select(String cusDB) {
return jdbcTemplate.query(
"SELECT id, first_name, last_name FROM customers WHERE first_name= cusDB",
(rs, rowNum) -> new Customer(rs.getLong("id"),
rs.getString("first_name"), rs.getString("last_name")));
}
cusDBor something like that.