this.context.setAttribute("position", null); } catch (SQLException e) { throw new UnableToExecuteStatementException( String.format( "Exception while binding positional param at (0 based) position %d", "the JDBC 'start at 1' scheme) has been set.", named_param, i, i + 1); throw new UnableToExecuteStatementException(msg, context);
protected final void afterExecution(final PreparedStatement stmt) { for (StatementCustomizer customizer : customizers) { try { customizer.afterExecution(stmt, context); } catch (SQLException e) { throw new UnableToExecuteStatementException("Exception thrown in statement customization", e, context); } } }
protected final void cleanup() { for (StatementCustomizer customizer : customizers) { try { customizer.cleanup(context); } catch (SQLException e) { throw new UnableToExecuteStatementException("Could not clean up", e, context); } } }
protected final void beforeExecution(final PreparedStatement stmt) { for (StatementCustomizer customizer : customizers) { try { customizer.beforeExecution(stmt, context); } catch (SQLException e) { throw new UnableToExecuteStatementException("Exception thrown in statement customization", e, context); } } }
protected final void beforeExecution(final PreparedStatement stmt) { for (StatementCustomizer customizer : customizers) { try { customizer.beforeExecution(stmt, context); } catch (SQLException e) { throw new UnableToExecuteStatementException("Exception thrown in statement customization", e, context); } } }
protected final void afterExecution(final PreparedStatement stmt) { for (StatementCustomizer customizer : customizers) { try { customizer.afterExecution(stmt, context); } catch (SQLException e) { throw new UnableToExecuteStatementException("Exception thrown in statement customization", e, context); } } }
protected final void cleanup() { for (StatementCustomizer customizer : customizers) { try { customizer.cleanup(context); } catch (SQLException e) { throw new UnableToExecuteStatementException("Could not clean up", e, context); } } }
private String[] getStatements() { final String script; final StatementContext ctx = new ConcreteStatementContext(globalStatementAttributes); try { script = locator.locate(name, ctx); } catch (Exception e) { throw new UnableToExecuteStatementException(String.format("Error while loading script [%s]", name), e, ctx); } return script.replaceAll("\n", " ").replaceAll("\r", "").split(";"); } }
/** * Execute this script in a batch statement * * @return an array of ints which are the results of each statement in the script */ public int[] execute() { final String script; final StatementContext ctx = new ConcreteStatementContext(globalStatementAttributes); try { script = locator.locate(name, ctx); } catch (Exception e) { throw new UnableToExecuteStatementException(String.format("Error while loading script [%s]", name), e, ctx); } final String[] statements = script.replaceAll("\n", " ").replaceAll("\r", "").split(";"); Batch b = handle.createBatch(); for (String s : statements) { if ( ! WHITESPACE_ONLY.matcher(s).matches() ) { b.add(s); } } return b.execute(); } }
throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); "the JDBC 'start at 1' scheme) has been set.", named_param, i, i + 1); throw new UnableToExecuteStatementException(msg, context);
throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); "the JDBC 'start at 1' scheme) has been set.", named_param, i, i + 1); throw new UnableToExecuteStatementException(msg, context);
throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); "the JDBC 'start at 1' scheme) has been set.", named_param, i, i + 1); throw new UnableToExecuteStatementException(msg, context);
throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); "the JDBC 'start at 1' scheme) has been set.", named_param, i, i + 1); throw new UnableToExecuteStatementException(msg, context);
this.context.setAttribute("position", null); } catch (SQLException e) { throw new UnableToExecuteStatementException( String.format( "Exception while binding positional param at (0 based) position %d", "the JDBC 'start at 1' scheme) has been set.", named_param, i, i + 1); throw new UnableToExecuteStatementException(msg, context);
throw new UnableToExecuteStatementException("Unable to configure JDBC statement", e, getContext()); throw new UnableToExecuteStatementException(e, getContext());
throw new UnableToExecuteStatementException("Unable to configure JDBC statement", e, getContext()); throw new UnableToExecuteStatementException(e, getContext());
throw new UnableToExecuteStatementException("Exception while binding parameters", e, getContext()); throw new UnableToExecuteStatementException(e, getContext());
throw new UnableToExecuteStatementException("Exception while binding parameters", e, getContext()); throw new UnableToExecuteStatementException(e, getContext());
throw new UnableToExecuteStatementException("Unable to bind parameters to query", e, getContext()); throw new UnableToExecuteStatementException(e, getContext());
throw new UnableToExecuteStatementException("Unable to bind parameters to query", e, getContext()); throw new UnableToExecuteStatementException(e, getContext());