Package org.springframework.jdbc.core.namedparam

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


        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

        log.error("Cannot batch save run: " + run.getName());
        e.printStackTrace();
      }
    }

    int[] rows = namedTemplate.batchUpdate(RUN_UPDATE, batch.toArray(new SqlParameterSource[batch.size()]));

    //flush caches
    purgeCaches(runs);

    log.debug("<<< Exiting saveAll");
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.