Yanming Zhou opened SPR-16211 and commented

I'm developing a query console using NamedParameterJdbcTemplate, I need get parameter names from sql to construct UI form let user input parameters

ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql);
List<String> params = parsedSql.getParameterNames(); //NOT public

It's better if NamedParameterJdbcTemplate could provide a method to get parameter name and parameter type, using PreparedStatement.getParameterMetaData().getParameterType()


Reference URL: https://github.com/spring-projects/spring-framework/pull/1597

Issue Links: - #15442 make org.springframework.jdbc.core.namedparam.ParsedSql public accessible ("is duplicated by") - #20887 NamedParameterJdbcTemplate fails on PostgreSQL array - #20908 SqlParameterSource needs method for extracting parameter names

Comment From: spring-projects-issues

Juergen Hoeller commented

ParsedSql would have to provide new accessor methods which don't allow for mutation; the current methods are really only meant to for internal purposes. Let's revisit this for 5.1.

Comment From: spring-projects-issues

Yanming Zhou commented

Please revisit this for 5.1.

Comment From: rengy-github

Namedparameterutils is a tool class. I also want to use this class instead of copying one