final String my_sql ;
try {
my_sql = locator.locate(sql, context);
}
catch (Exception e) {
throw new UnableToCreateStatementException(String.format("Exception while locating statement for [%s]",
sql), e);
}
final RewrittenStatement rewritten = rewriter.rewrite(my_sql, current.getParameters(), context);
PreparedStatement stmt = null;
try {
try {
stmt = connection.prepareStatement(rewritten.getSql());
}
catch (SQLException e) {
throw new UnableToCreateStatementException(e);
}
try {
for (PreparedBatchPart part : parts) {
rewritten.bind(part.getParameters(), stmt);