Examples of BatchPreparedStatementSetter


Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

  public void saveStepExecutions(final Collection<StepExecution> stepExecutions) {
    Assert.notNull(stepExecutions, "Attempt to save a null collection of step executions");

        if (!stepExecutions.isEmpty()) {
            final Iterator<StepExecution> iterator = stepExecutions.iterator();
            getJdbcTemplate().batchUpdate(getQuery(SAVE_STEP_EXECUTION), new BatchPreparedStatementSetter() {

                @Override
                public int getBatchSize() {
                    return stepExecutions.size();
                }
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

                        try {
                            transactionTemplate.execute(new TransactionCallback() {

                                public Object doInTransaction(TransactionStatus status) {
                                    JdbcTemplate jdbcTemplate = dbDialect.getJdbcTemplate();
                                    return jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {

                                        public void setValues(PreparedStatement ps, int idx) throws SQLException {
                                            int id = start + idx;
                                            StatementCreatorUtils.setParameterValue(ps, 1, Types.INTEGER, null, id);
                                            StatementCreatorUtils.setParameterValue(ps,
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

  public void insert(final List<InsertDeleteInfo> deleteInfos) {
    if (deleteInfos.isEmpty()) {
      return;
    }

    jdbcTemplate.batchUpdate(INSERT_DELETE_INFO, new BatchPreparedStatementSetter() {
      @Override
      public void setValues(PreparedStatement ps, int i) throws SQLException {
        InsertDeleteInfo info = deleteInfos.get(i);

        ps.setInt(1, info.getMsgid());
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

                                    try {
                                        failedDatas.clear(); // 先清理
                                        processedDatas.clear();
                                        interceptor.transactionBegin(context, splitDatas, dbDialect);
                                        JdbcTemplate template = dbDialect.getJdbcTemplate();
                                        int[] affects = template.batchUpdate(sql, new BatchPreparedStatementSetter() {

                                            public void setValues(PreparedStatement ps, int idx) throws SQLException {
                                                doPreparedStatement(ps, dbDialect, lobCreator, splitDatas.get(idx));
                                            }
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

            transactionTemplate.execute(new TransactionCallback() {

                public Object doInTransaction(TransactionStatus status) {
                    jdbcTemplate.execute(MessageFormat.format(deleteDataSql, markTableName));
                    String batchSql = MessageFormat.format(updateSql, new Object[] { markTableName, markTableColumn });
                    jdbcTemplate.batchUpdate(batchSql, new BatchPreparedStatementSetter() {

                        public void setValues(PreparedStatement ps, int idx) throws SQLException {
                            ps.setInt(1, idx);
                            ps.setInt(2, 0);
                            // ps.setNull(3, Types.VARCHAR);
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

                                    try {
                                        failedDatas.clear(); // 先清理
                                        processedDatas.clear();
                                        interceptor.transactionBegin(context, splitDatas, dbDialect);
                                        JdbcTemplate template = dbDialect.getJdbcTemplate();
                                        int[] affects = template.batchUpdate(sql, new BatchPreparedStatementSetter() {

                                            public void setValues(PreparedStatement ps, int idx) throws SQLException {
                                                doPreparedStatement(ps, dbDialect, lobCreator, splitDatas.get(idx));
                                            }
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

            transactionTemplate.execute(new TransactionCallback() {

                public Object doInTransaction(TransactionStatus status) {
                    jdbcTemplate.execute(MessageFormat.format(deleteDataSql, markTableName));
                    String batchSql = MessageFormat.format(updateSql, new Object[] { markTableName, markTableColumn });
                    jdbcTemplate.batchUpdate(batchSql, new BatchPreparedStatementSetter() {

                        public void setValues(PreparedStatement ps, int idx) throws SQLException {
                            ps.setInt(1, idx);
                            ps.setInt(2, 0);
                            // ps.setNull(3, Types.VARCHAR);
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

                                    try {
                                        failedDatas.clear(); // 先清理
                                        processedDatas.clear();
                                        interceptor.transactionBegin(context, splitDatas, dbDialect);
                                        JdbcTemplate template = dbDialect.getJdbcTemplate();
                                        int[] affects = template.batchUpdate(sql, new BatchPreparedStatementSetter() {

                                            public void setValues(PreparedStatement ps, int idx) throws SQLException {
                                                doPreparedStatement(ps, dbDialect, lobCreator, splitDatas.get(idx));
                                            }
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

  public void setArticleTags(final Article article, final List<Integer> tagIDs) {
    if (null == tagIDs) return;
    String sql = "delete from ArticleTagAssoc where articleID = ? ";
    jdbcTemplate.update(sql, article.getId());
    jdbcTemplate.batchUpdate("insert into ArticleTagAssoc (articleID, tagID) values (?, ?) ",
        new BatchPreparedStatementSetter() {
     
          @Override
          public void setValues(PreparedStatement ps, int i) throws SQLException {
            ps.setInt(1, article.getId());
            ps.setInt(2, tagIDs.get(i));
View Full Code Here

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter

    for (Map.Entry<JdbcTemplate, Map<String, List<RowBasedReplicationContext>>> e0 : sortedContexts.entrySet()) {
      JdbcTemplate jt = e0.getKey();
      for (Map.Entry<String, List<RowBasedReplicationContext>> e : e0.getValue().entrySet()) {
        final List<RowBasedReplicationContext> endContexts = e.getValue();
        BatchPreparedStatementSetter setter = new BatchPreparedStatementSetter() {
          public int getBatchSize() {
            return endContexts.size();
          }
          public void setValues(PreparedStatement ps, int i) throws SQLException {
            RowBasedReplicationContext context = endContexts.get(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.