Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.BatchPreparedStatementSetter


                            watchList.getXid(), watchList.getName(), watchList.getUserId() }));
                else
                    ejt2.update("update watchLists set xid=?, name=? where id=?", new Object[] { watchList.getXid(),
                            watchList.getName(), watchList.getId() });
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchList.getId() });
                ejt2.batchUpdate("insert into watchListPoints values (?,?,?)", new BatchPreparedStatementSetter() {
                    @Override
                    public int getBatchSize() {
                        return watchList.getPointList().size();
                    }
View Full Code Here


    void saveWatchListUsers(final WatchList watchList) {
        // Delete anything that is currently there.
        deleteWatchListUsers(watchList.getId());

        // Add in all of the entries.
        ejt.batchUpdate("insert into watchListUsers values (?,?,?)", new BatchPreparedStatementSetter() {
            @Override
            public int getBatchSize() {
                return watchList.getWatchListUsers().size();
            }
View Full Code Here

    void saveViewUsers(final GraphicalView view) {
        // Delete anything that is currently there.
        deleteViewUsers(view.getId());

        // Add in all of the entries.
        ejt.batchUpdate("insert into graphicalViewUsers values (?,?,?)", new BatchPreparedStatementSetter() {
            @Override
            public int getBatchSize() {
                return view.getViewUsers().size();
            }
View Full Code Here

    protected void createEntries(final MutableAcl acl) {
        if(acl.getEntries().isEmpty()) {
            return;
        }
        jdbcTemplate.batchUpdate(insertEntry,
            new BatchPreparedStatementSetter() {
                public int getBatchSize() {
                    return acl.getEntries().size();
                }

                public void setValues(PreparedStatement stmt, int i) throws SQLException {
View Full Code Here

   */
  public void deleteTokensForNodes(final String processInstanceId, final List<String> nodeIdsList)
  {

    super.getJdbcTemplate().batchUpdate("delete from t_ff_rt_token where processinstance_id = ? and node_id=? ",
        new BatchPreparedStatementSetter()
        {
          public void setValues(PreparedStatement ps, int i) throws SQLException
          {
            ps.setString(1, processInstanceId);
            ps.setString(2, nodeIdsList.get(i));
View Full Code Here

    StringBuffer sql = new StringBuffer();
    sql.append(" INSERT INTO BPM_APPRINFO ");
    sql.append("     (APPR_KEY, APPR_VERSION, APPR_EMPCODE, APPR_TRUTH_EMPCODE, APPR_TYPE, APPR_COMMENT, APPR_STATUS, APPR_ENDDATE, TASKID, TRCTAG, APPR_ORDERBY) ");
    sql.append(" VALUES (?       , ?           , ?           , ?                 , ?        , ?           , ?          , ?           , ?     , ?     , ?           ) ");
   
    BatchPreparedStatementSetter pss = new BatchPreparedStatementSetter() {
     
      public void setValues(PreparedStatement ps, int index) throws SQLException {
        Approver approver = approverList.get(index);
        int parameterIndex = 1;
        ps.setString(parameterIndex++, approver.getApprovalKey());
View Full Code Here

    StringBuffer sql = new StringBuffer();
    sql.append(" UPDATE BPM_APPRINFO ");
    sql.append(" SET TASKID = ?, APPR_TRUTH_EMPCODE = ?, APPR_STATUS = ?, APPR_ENDDATE = ?, TRCTAG = ?, APPR_COMMENT =? ");
    sql.append(" WHERE APPR_KEY = ? AND APPR_ORDERBY = ? AND APPR_VERSION = ? ");
   
    BatchPreparedStatementSetter pss = new BatchPreparedStatementSetter() {
     
      public void setValues(PreparedStatement ps, int index) throws SQLException {
        Approver approver = approverList.get(index);
        int parameterIndex = 1;
        ps.setString(parameterIndex++, approver.getTaskId());
View Full Code Here

      return new int[] {0};
    }
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, batchArgs[0]);
    return jdbcOperations.batchUpdate(
        sqlToUse,
        new BatchPreparedStatementSetter() {

          public void setValues(PreparedStatement ps, int i) throws SQLException {
            Object[] values = NamedParameterUtils.buildValueArray(parsedSql, batchArgs[i], null);
            int[] columnTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, batchArgs[i]);
            setStatementParameters(values, ps, columnTypes);
View Full Code Here

      logger.debug("Executing statement " + getInsertString() + " with batch of size: " + batchValues.length);
    }
    final int[] columnTypes = getInsertTypes();
    int[] updateCounts = jdbcTemplate.batchUpdate(
        getInsertString(),
        new BatchPreparedStatementSetter() {

          public void setValues(PreparedStatement ps, int i) throws SQLException {
            List<Object> values = batchValues[i];
            setParameterValues(ps, values, columnTypes);
          }
View Full Code Here

    if (logger.isDebugEnabled()) {
      logger.debug("Executing statement " + getInsertString() + " with batch of size: " + batchValues.length);
    }
    int[] updateCounts = jdbcTemplate.batchUpdate(
        getInsertString(),
        new BatchPreparedStatementSetter() {

          public void setValues(PreparedStatement ps, int i) throws SQLException {
            List<Object> values = batchValues[i];
            setParameterValues(ps, values, getInsertTypes());
          }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.BatchPreparedStatementSetter

Copyright © 2018 www.massapicom. 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.