Class DefaultSqlPrepareStatementStrategy

    • Constructor Detail

      • DefaultSqlPrepareStatementStrategy

        public DefaultSqlPrepareStatementStrategy()
      • DefaultSqlPrepareStatementStrategy

        public DefaultSqlPrepareStatementStrategy​(char separator)
    • Method Detail

      • prepareQuery

        public String prepareQuery​(String query,
                                   boolean allowNamedParameters,
                                   org.apache.camel.Exchange exchange)
                            throws SQLException
        Description copied from interface: SqlPrepareStatementStrategy
        Prepares the query to be executed.
        Specified by:
        prepareQuery in interface SqlPrepareStatementStrategy
        Parameters:
        query - the query which may contain named query parameters
        allowNamedParameters - whether named parameters is allowed
        exchange - the current exchange
        Returns:
        the query to actually use, which must be accepted by the JDBC driver.
        Throws:
        SQLException
      • createPopulateIterator

        public Iterator<?> createPopulateIterator​(String query,
                                                  String preparedQuery,
                                                  int expectedParams,
                                                  org.apache.camel.Exchange exchange,
                                                  Object value)
                                           throws SQLException
        Description copied from interface: SqlPrepareStatementStrategy
        Creates the iterator to use when setting query parameters on the prepared statement.
        Specified by:
        createPopulateIterator in interface SqlPrepareStatementStrategy
        Parameters:
        query - the original query which may contain named parameters
        preparedQuery - the query to actually use, which must be accepted by the JDBC driver.
        expectedParams - number of expected parameters
        exchange - the current exchange
        value - the message body that contains the data for the query parameters
        Returns:
        the iterator
        Throws:
        SQLException - is thrown if error creating the iterator
      • hasNamedParameters

        protected boolean hasNamedParameters​(String query)
      • lookupParameter

        protected static Object lookupParameter​(String nextParam,
                                                org.apache.camel.Exchange exchange,
                                                Object body)
      • hasParameter

        protected static boolean hasParameter​(String nextParam,
                                              org.apache.camel.Exchange exchange,
                                              Object body)
      • createInParameterIterator

        protected static org.springframework.util.CompositeIterator createInParameterIterator​(Object value)