Package org.springframework.jdbc.core.simple

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update()


        for (Iterator<org.dom4j.Element> it = (Iterator<org.dom4j.Element>) layout.selectNodes("folder | dlm:*").iterator(); it.hasNext();) {
            nextId = addIdAttributesIfNecessary(it.next(), nextId);
        }
        // Now update UP_USER...
        final SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(RDBMServices.getDataSource());
        jdbcTemplate.update("UPDATE up_user SET next_struct_id = ? WHERE user_id = ?", nextId, person.getID());

        // (4) Convert external DLM pathrefs to internal form (noderefs)...
        for (Iterator<org.dom4j.Attribute> itr = (Iterator<org.dom4j.Attribute>) layout.selectNodes("//@dlm:origin").iterator(); itr.hasNext();) {
            org.dom4j.Attribute a = itr.next();
            String noderef = getDlmNoderef(ownerUsername, a.getValue(), null, true, layout);
View Full Code Here


    public void setDataSource(DataSource ds) {

        // Initializes the in-memory database (not necessary in production)
        if (!initialized) {
            SimpleJdbcTemplate jt = new SimpleJdbcTemplate(ds);
            jt.update("CREATE TABLE sample_table ( id INTEGER IDENTITY, str_col VARCHAR(256), num_col INTEGER)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Ford', 100)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Toyota', 200)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Mazda', 300)");
            initialized = true;
        }
View Full Code Here

        // Initializes the in-memory database (not necessary in production)
        if (!initialized) {
            SimpleJdbcTemplate jt = new SimpleJdbcTemplate(ds);
            jt.update("CREATE TABLE sample_table ( id INTEGER IDENTITY, str_col VARCHAR(256), num_col INTEGER)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Ford', 100)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Toyota', 200)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Mazda', 300)");
            initialized = true;
        }
        this.ds = ds;
View Full Code Here

        // Initializes the in-memory database (not necessary in production)
        if (!initialized) {
            SimpleJdbcTemplate jt = new SimpleJdbcTemplate(ds);
            jt.update("CREATE TABLE sample_table ( id INTEGER IDENTITY, str_col VARCHAR(256), num_col INTEGER)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Ford', 100)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Toyota', 200)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Mazda', 300)");
            initialized = true;
        }
        this.ds = ds;
    }
View Full Code Here

        if (!initialized) {
            SimpleJdbcTemplate jt = new SimpleJdbcTemplate(ds);
            jt.update("CREATE TABLE sample_table ( id INTEGER IDENTITY, str_col VARCHAR(256), num_col INTEGER)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Ford', 100)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Toyota', 200)");
            jt.update("INSERT INTO sample_table(str_col,num_col) VALUES('Mazda', 300)");
            initialized = true;
        }
        this.ds = ds;
    }
View Full Code Here

    _version1Instant = now.minusSeconds(100);
    _version2Instant = now.minusSeconds(50);
    s_logger.debug("test data now:   {}", _version1Instant);
    s_logger.debug("test data later: {}", _version2Instant);
    final SimpleJdbcTemplate template = _secMaster.getDbConnector().getJdbcTemplate();
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity101", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity102", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity201", "EQUITY", "D");
View Full Code Here

    s_logger.debug("test data now:   {}", _version1Instant);
    s_logger.debug("test data later: {}", _version2Instant);
    final SimpleJdbcTemplate template = _secMaster.getDbConnector().getJdbcTemplate();
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity101", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity102", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity201", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestSecurity202", "EQUITY", "D");
View Full Code Here

    final SimpleJdbcTemplate template = _secMaster.getDbConnector().getJdbcTemplate();
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity101", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity102", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity201", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestSecurity202", "EQUITY", "D");
    _totalSecurities = 3;
//  id bigint not null,
View Full Code Here

        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity101", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity102", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestSecurity201", "EQUITY", "D");
    template.update("INSERT INTO sec_security VALUES (?,?,?,?,?, ?,?,?,?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestSecurity202", "EQUITY", "D");
    _totalSecurities = 3;
//  id bigint not null,
//  key_scheme varchar(255) not null,
//  key_value varchar(255) not null,
View Full Code Here

        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestSecurity202", "EQUITY", "D");
    _totalSecurities = 3;
//  id bigint not null,
//  key_scheme varchar(255) not null,
//  key_value varchar(255) not null,
    template.update("INSERT INTO sec_idkey VALUES (?,?,?)",
        1, "A", "B");
    template.update("INSERT INTO sec_idkey VALUES (?,?,?)",
        2, "C", "D");
    template.update("INSERT INTO sec_idkey VALUES (?,?,?)",
        3, "E", "F");
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.