Is there any way / framework in Java to access request parameters by name, not by index?

stmt = con.prepare("SELECT field1 FROM mytable WHERE myfield2 = :param1"); stmt.setIntPrm("param1", 2); 
  • In zhpa so it is possible. - aleshka-batman

1 answer 1

Pure JDBC named parameters do not support, only indexed. Another thing is that there are various tools that allow you to circumvent this limitation. For example, Spring-jdbc (see NamedParameterJdbcTemplate ), JPA, etc.