Package org.springframework.jdbc.core

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


        String value = jdbcTemplate.queryForObject(
                "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
        assertEquals("virattrcache", value);

        jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getId());

        value = jdbcTemplate.queryForObject(
                "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
        assertEquals("virattrcache2", value);
        // ----------------------------------------
View Full Code Here


            String value = jdbcTemplate.queryForObject(
                    "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
            assertEquals("virattrcache", value);

            jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", userTO.getId());

            value = jdbcTemplate.queryForObject(
                    "SELECT USERNAME FROM testsync WHERE ID=?", String.class, userTO.getId());
            assertEquals("virattrcache2", value);
View Full Code Here

        Date now = new Date();

        for (Map<String, Object> map : list) {
            Date startTime = (Date) map.get("start_time_");
            long duration = now.getTime() - startTime.getTime();
            jdbcTemplate
                    .update("update ACT_HI_ACTINST set end_time_=?,duration_=? where id_=?",
                            now, duration, map.get("id_"));
        }
    }
View Full Code Here

        Date now = new Date();

        for (Map<String, Object> map : list) {
            Date startTime = (Date) map.get("start_time_");
            long duration = now.getTime() - startTime.getTime();
            jdbcTemplate
                    .update("update ACT_HI_ACTINST set end_time_=?,duration_=? where id_=?",
                            now, duration, map.get("id_"));
        }
    }
View Full Code Here

                        processDefinitionId);
        String resourceName = processDefinitionEntity.getResourceName();
        String deploymentId = processDefinitionEntity.getDeploymentId();
        JdbcTemplate jdbcTemplate = new JdbcTemplate(Context
                .getProcessEngineConfiguration().getDataSource());
        jdbcTemplate
                .update("update ACT_GE_BYTEARRAY set BYTES_=? where NAME_=? and DEPLOYMENT_ID_=?",
                        bytes, resourceName, deploymentId);

        Context.getProcessEngineConfiguration().getProcessDefinitionCache()
                .remove(processDefinitionId);
View Full Code Here

                .findIdentityLinksByProcessInstanceId(processInstanceId);

        for (IdentityLinkEntity identityLinkEntity : identityLinks) {
            // identityLinkEntity.setProcessDefId(processDefinitionId);
            // dbSqlSession.update(identityLinkEntity);
            jdbcTemplate
                    .update("update ACT_RU_IDENTITYLINK set PROC_DEF_ID_=? where ID_=?",
                            processDefinitionId, identityLinkEntity.getId());
        }

        // 操作historicProcessInstance表
View Full Code Here

                Context.getCommandContext()
                        .getHistoricTaskInstanceEntityManager()
                        .deleteHistoricTaskInstanceById(taskId);
            }

            jdbcTemplate.update("delete from ACT_HI_ACTINST where id_=?", id);
        }
    }

    public void processHistoryTask(
            HistoricTaskInstanceEntity historicTaskInstanceEntity,
View Full Code Here

    private void createDatabase() {
        DataSource dataSource = (DataSource) muleContext.getRegistry().lookupObject("dataSource");
        JdbcTemplate template = new JdbcTemplate(dataSource);
        try {
            template.update("DROP TABLE orders");
        } catch (BadSqlGrammarException ex) {
            logger.error(ex);
        }
        template.update("CREATE TABLE orders " +
                "(id BIGINT NOT NULL, details VARCHAR(4096), timestamp TIMESTAMP)");
View Full Code Here

        try {
            template.update("DROP TABLE orders");
        } catch (BadSqlGrammarException ex) {
            logger.error(ex);
        }
        template.update("CREATE TABLE orders " +
                "(id BIGINT NOT NULL, details VARCHAR(4096), timestamp TIMESTAMP)");

        Date now = new Date();
        template.update("INSERT INTO orders VALUES (0,?,?)",
                new Object[]{"foo", new Date(now.getTime() - (86400000 * 2))});
 
View Full Code Here

        }
        template.update("CREATE TABLE orders " +
                "(id BIGINT NOT NULL, details VARCHAR(4096), timestamp TIMESTAMP)");

        Date now = new Date();
        template.update("INSERT INTO orders VALUES (0,?,?)",
                new Object[]{"foo", new Date(now.getTime() - (86400000 * 2))});
    }
}
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.