Skip to content
Advertisement

Tag: jdbctemplate

JDBCTemplate set nested POJO with BeanPropertyRowMapper

Given the following example POJO’s: (Assume Getters and Setters for all properties) One can easily query a database (postgres in my case) and populate a list of Message classes using a BeanPropertyRowMapper where the db field matched the property in the POJO: (Assume the DB tables have corresponding fields to the POJO properties). I’m wondering – is there a convenient

How to query for a List in JdbcTemplate?

I’m using Spring’s JdbcTemplate and running a query like this: There are no named parameters being passed, however, column name, COLNAME, will be passed by the user. Questions Is there a way to have placeholders, like ? for column names? For example SELECT ? FROM TABLEA GROUP BY ? If I want to simply run the above query and get

Advertisement