|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.camel.component.jdbc.DefaultJdbcPrepareStatementStrategy
public class DefaultJdbcPrepareStatementStrategy
Default JdbcPrepareStatementStrategy which is a copy from the camel-sql component having
this functionality first.
| Constructor Summary | |
|---|---|
DefaultJdbcPrepareStatementStrategy()
|
|
| Method Summary | |
|---|---|
Iterator<?> |
createPopulateIterator(String query,
String preparedQuery,
int expectedParams,
org.apache.camel.Exchange exchange,
Object value)
Creates the iterator to use when setting query parameters on the prepared statement. |
protected boolean |
hasNamedParameters(String query)
|
void |
populateStatement(PreparedStatement ps,
Iterator<?> iterator,
int expectedParams)
Populates the query parameters on the prepared statement |
String |
prepareQuery(String query,
boolean allowNamedParameters)
Prepares the query to be executed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultJdbcPrepareStatementStrategy()
| Method Detail |
|---|
public String prepareQuery(String query,
boolean allowNamedParameters)
throws SQLException
JdbcPrepareStatementStrategy
prepareQuery in interface JdbcPrepareStatementStrategyquery - the query which may contain named query parametersallowNamedParameters - whether named parameters is allowed
SQLException
public Iterator<?> createPopulateIterator(String query,
String preparedQuery,
int expectedParams,
org.apache.camel.Exchange exchange,
Object value)
throws SQLException
JdbcPrepareStatementStrategy
createPopulateIterator in interface JdbcPrepareStatementStrategyquery - the original query which may contain named parameterspreparedQuery - the query to actually use, which must be accepted by the JDBC driver.expectedParams - number of expected parametersexchange - the current exchangevalue - the message body that contains the data for the query parameters
SQLException - is thrown if error creating the iterator
public void populateStatement(PreparedStatement ps,
Iterator<?> iterator,
int expectedParams)
throws SQLException
JdbcPrepareStatementStrategy
populateStatement in interface JdbcPrepareStatementStrategyps - the prepared statementiterator - the iterator to use for getting the parameter dataexpectedParams - number of expected parameters
SQLException - is thrown if error populating parametersprotected boolean hasNamedParameters(String query)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||