类 JdbcParameterUtils


  • public class JdbcParameterUtils
    extends java.lang.Object
    Helper methods for SQL statement parameter parsing. Only intended for internal use.
    从以下版本开始:
    2.0
    作者:
    Thomas Risberg, Juergen Hoeller
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型方法说明
      static intcountParameterPlaceholders​(java.lang.String sql, java.util.List<java.lang.String> namedParameterHolder)
      Count the occurrences of the character placeholder in an SQL string sql.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • countParameterPlaceholders

        public static int countParameterPlaceholders​(java.lang.String sql,
                                                     java.util.List<java.lang.String> namedParameterHolder)
        Count the occurrences of the character placeholder in an SQL string sql. The character placeholder is not counted if it appears within a literal, that is, surrounded by single or double quotes. This method will count traditional placeholders in the form of a question mark ('?') as well as named parameters indicated with a leading ':' or '&'. The code for this method is taken from an early version of the NamedParameterUtils class. That method was later removed after some refactoring, but the code is useful here for the Spring Batch project. The code has been altered to better suite the batch processing requirements.
        参数:
        sql - String to search in. Returns 0 if the given String is null.
        namedParameterHolder - holder for the named parameters
        返回:
        the number of named parameter placeholders