use of com.adaptris.jdbc.StoredProcedure in project interlok by adaptris.
the class JdbcStoredProcedureProducer method doRequest.
@Override
protected AdaptrisMessage doRequest(AdaptrisMessage msg, String endpoint, long timeout) throws ProduceException {
Connection connection = null;
JdbcResult results = null;
try {
connection = getConnection(msg);
StoredProcedure storedProcedure = new StoredProcedure();
storedProcedure.setConnection(connection);
storedProcedure.setName(endpoint);
storedProcedure.setStatementCreator(getStatementCreator());
storedProcedure.setParameters(parseInParameters(msg));
storedProcedure.setStatementExecutor(getStatementExecutor());
storedProcedure.setTimeout(defaultTimeout());
storedProcedure.setAdaptrisMessage(msg);
storedProcedure.setResultSetTranslator(getResultSetTranslator());
results = storedProcedure.execute();
parseOutParameters(msg, results.getParameters());
commit(connection, msg);
} catch (Exception e) {
rollback(connection, msg);
throw new ProduceException(e);
} finally {
JdbcUtil.closeQuietly(results);
JdbcUtil.closeQuietly(connection);
}
return msg;
}
Aggregations