1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] How to get results as array with JdbcTemplate?

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 3, 2024 às 12:23.

  1. Stack

    Stack Membro Participativo

    String sql = "SELECT name, age, gender from persons";
    List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, params);


    Question: how can I get the results just as an array List<String[]>? As I select only 3 values from each row, I know that result[0] is the name, or results[2] is the gender.

    So I'd prefer jdbcTemplate to not return key-value maps, but just plain arrays without db column names.

    Continue reading...

Compartilhe esta Página