Examples of batchUpdate()


Examples of org.springframework.jdbc.core.JdbcTemplate.batchUpdate()

                                    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.JdbcTemplate.batchUpdate()

      throw new OmhException("Could not convert some data to JSON.", e);
    }
   
    // Add the data.
    try {
      jdbcTemplate
        .batchUpdate(
          "INSERT INTO " + DataSet.DB_NAME + " (" +
              UserBin.DB_NAME + "_id" + ", " +
              Registry.DB_NAME + "_id" + ", " +
              Data.JSON_KEY_METADATA + "_" +
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.batchUpdate()

                        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.JdbcTemplate.batchUpdate()

                                    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.JdbcTemplate.batchUpdate()

                                    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.JdbcTemplate.batchUpdate()

                                    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.JdbcTemplate.batchUpdate()

          public void setValues(PreparedStatement ps, int i) throws SQLException {
            RowBasedReplicationContext context = endContexts.get(i);
            ps.setString(1, context.getSyncLogId());
          }
        };
        jt.batchUpdate(e.getKey(), setter);
        if (log.isDebugEnabled()) {
          log.debug("[batchDeleteSyncLog], sql = [" + e.getKey() + "], batch size="+endContexts.size());
        }
      }
    }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.batchUpdate()

            RowBasedReplicationContext context = endContexts.get(i);
            ps.setTimestamp(1, getNextSyncTime(context, extraPlusTime));
            ps.setString(2, context.getSyncLogId());
          }
        };
        jt.batchUpdate(e.getKey(), setter);
        if (log.isDebugEnabled()) {
          log.debug("[batchUpdateSyncLog], sql = [" + e.getKey() + "], batch size="+endContexts.size());
        }
      }
    }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.batchUpdate()

        try {
            txTemplate.execute(new TransactionCallbackWithoutResult() {

                @Override
                public void doInTransactionWithoutResult(TransactionStatus ts) {
                    npjt.batchUpdate(insertQuery, parameters);
                }
            });
           
            return;
        } catch (RuntimeException ex) {
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.batchUpdate()

        try {
            txTemplate.execute(new TransactionCallbackWithoutResult() {
                @Override
                public void doInTransactionWithoutResult(TransactionStatus ts) {
                    int[] affectedRows =
                            npjt.batchUpdate(insertQuery.getSql(), parameters.toArray(new MapSqlParameterSource[0]));
                   
                    int sum = 0;
                    for (int i = 0; i < affectedRows.length; ++i) {
                        sum += DatabaseUtils.getAffectedRowsNumber(affectedRows[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.