org.springframework.cloud.dataflow.server.repository.support

## Class JdbcParameterUtils

- java.lang.Object
- - org.springframework.cloud.dataflow.server.repository.support.JdbcParameterUtils

-     public class JdbcParameterUtils
      extends Object

  Helper methods for SQL statement parameter parsing.

  Only intended for internal use.

  Author:
    Thomas Risberg, Juergen Hoeller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JdbcParameterUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `countParameterPlaceholders(String sql, List<String> namedParameterHolder)` Count the occurrences of the character placeholder in an SQL string `sql`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JdbcParameterUtils

          public JdbcParameterUtils()

  - ### Method Detail

    - #### countParameterPlaceholders

          public static int countParameterPlaceholders(String sql,
                                                       List<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.

      Parameters:
        `sql` - String to findByTaskNameContains in. Returns 0 if the given String is `null`.
        `namedParameterHolder` - the list of parameter placehholder names
      Returns:
        the number of parameter placeholder and adds to the namedParameterHolder list any parsed namedParameters from the sql

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.