I have a table having 30000 rows and when I am trying to pull one single column into a List of type String, the query is hanging for ever. If I apply check to pull only few rows it is working fine.
Below is my Method to pull the data.
public class HeFeaturesJdbcRepository {
@Autowired
JdbcTemplate jdbcTemplate;
public List<String> getAllProductIdCodes() {
return jdbcTemplate.query("select distinct product_id_code from saa_dim_product",
new BeanPropertyRowMapper(String.class));
}
}
It works fine if I put a logic to pull few rows.
public List getAllProductIdCodes() {
return jdbcTemplate.query("select distinct product_id_code from saa_dim_product where rownum<=10",
new BeanPropertyRowMapper(String.class));
}
Also I increased my JVM memory to 3gb to check. Much appreciate your inputs.
Thanksenter code here