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); 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.
Source: https://ru.stackoverflow.com/questions/786165/
All Articles