Examples of JdbcOperations


Examples of org.springframework.jdbc.core.JdbcOperations

    _holMaster.setClock(Clock.fixed(now, ZoneOffset.UTC));
    _version1Instant = now.minusSeconds(100);
    _version2Instant = now.minusSeconds(50);
    s_logger.debug("test data now:   {}", _version1Instant);
    s_logger.debug("test data later: {}", _version2Instant);
    final JdbcOperations template = _holMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO hol_holiday VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "TestHoliday101", "COPP_CLARK", "1", "CURRENCY", null, null, null, null, "GBP");
    template.update("INSERT INTO hol_holiday VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "TestHoliday102", "COPP_CLARK", "2", "CURRENCY", null, null, null, null, "EUR");
    template.update("INSERT INTO hol_holiday VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "TestHoliday201", "COPP_CLARK", "3", "CURRENCY", null, null, null, null, "GBP");
    template.update("INSERT INTO hol_holiday VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP,
        "TestHoliday202", "COPP_CLARK", "3", "CURRENCY", null, null, null, null, "GBP");
    _totalHolidays = 3;
//    holiday_id bigint not null,
//    hol_date date not null,
    template.update("INSERT INTO hol_date VALUES (?,?)",
        101, toSqlDate(LocalDate.of(2010, 1, 1)));
    template.update("INSERT INTO hol_date VALUES (?,?)",
        102, toSqlDate(LocalDate.of(2010, 1, 2)));
    template.update("INSERT INTO hol_date VALUES (?,?)",
        102, toSqlDate(LocalDate.of(2010, 1, 3)));
    template.update("INSERT INTO hol_date VALUES (?,?)",
        201, toSqlDate(LocalDate.of(2010, 2, 1)));
    template.update("INSERT INTO hol_date VALUES (?,?)",
        202, toSqlDate(LocalDate.of(2010, 2, 1)));
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

    _secMaster.setClock(Clock.fixed(now, ZoneOffset.UTC));
    _version1Instant = now.minusSeconds(100);
    _version2Instant = now.minusSeconds(50);
    s_logger.debug("test data now:   {}", _version1Instant);
    s_logger.debug("test data later: {}", _version2Instant);
    final JdbcOperations template = _secMaster.getDbConnector().getJdbcOperations();
    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,
//  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");
    template.update("INSERT INTO sec_idkey VALUES (?,?,?)",
        4, "GH", "HI");
//  security_id bigint not null,
//  idkey_id bigint not null,
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        101, 1);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        101, 2);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        101, 3);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        102, 1);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        102, 2);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        102, 4);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        201, 2);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        201, 3);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        202, 2);
    template.update("INSERT INTO sec_security2idkey VALUES (?,?)",
        202, 3);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

  protected void doSetUp() {
    _batchMaster = new DbBatchMaster(getDbConnector(), new DefaultComputationTargetResolver());
   
    Timestamp now = toSqlTimestamp(Instant.now());

    final JdbcOperations template = _batchMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO rsk_compute_host (id, host_name) VALUES (?,?)", 1, "compute host");
    template.update("INSERT INTO rsk_compute_node (id, compute_host_id, node_name) VALUES (?,?,?)", 1, 1, "compute node");
    template.update("INSERT INTO rsk_computation_target (id, type, id_scheme, id_value, id_version) VALUES (?,?,?,?,?)", 1, "SECURITY", "DbSec", "APPL", null);
    template.update("INSERT INTO rsk_function_unique_id (id, unique_id) VALUES (?,?)", 1, "FV");
    template.update("INSERT INTO rsk_live_data_snapshot (id, base_uid_scheme, base_uid_value, base_uid_version) VALUES (?,?,?,?)", 1, _marketDataSnapshotUid.getScheme(), _marketDataSnapshotUid.getValue(), _marketDataSnapshotUid.getVersion());
    template.update("INSERT INTO rsk_live_data_snapshot_entry (id, snapshot_id, computation_target_id, name, value) VALUES (?,?,?,?,?)", 1, 1, 1, "FV", 999.99);   
    template.update("INSERT INTO rsk_run (id, version_correction, viewdef_scheme, viewdef_value, viewdef_version, live_data_snapshot_id, create_instant, start_instant, end_instant, valuation_time, num_restarts, complete) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)",
      1, _versionCorrection.toString(), _viewDefinitionUid.getScheme(), _viewDefinitionUid.getValue(), _viewDefinitionUid.getVersion(), 1, now, now,
        new SqlParameterValue(Types.TIMESTAMP, null), toSqlTimestamp(_valuationTime), 0, false);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

    _usrMaster.setClock(Clock.fixed(now, ZoneOffset.UTC));
    _version1Instant = now.minusSeconds(100);
    _version2Instant = now.minusSeconds(50);
    s_logger.debug("test data now:   {}", _version1Instant);
    s_logger.debug("test data later: {}", _version2Instant);
    final JdbcOperations template = _usrMaster.getDbConnector().getJdbcOperations();
    ManageableOGUser user = new ManageableOGUser("101");
    user.setUniqueId(UniqueId.of("DbUsr", "101", "0"));
    user.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("E", "F")));
    user.setUserId("Test101");
    user.setName("TestUser101");
    user.setTimeZone(ZoneId.of("Europe/London"));
    template.update("INSERT INTO usr_oguser VALUES (?,?,?,?,?, ?,?,?,?,?, ?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "Test101", "PW", "TestUser101", "Europe/London", "email101@email.com");
    user.setUniqueId(UniqueId.of("DbUsr", "102", "0"));
    user.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("G", "H")));
    user.setUserId("Test102");
    user.setName("TestUser102");
    user.setTimeZone(ZoneId.of("Europe/Paris"));
    template.update("INSERT INTO usr_oguser VALUES (?,?,?,?,?, ?,?,?,?,?, ?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "Test102", "PW", "TestUser102", "Europe/Paris", "email102@email.com");
    user.setUniqueId(UniqueId.of("DbUsr", "201", "0"));
    user.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("C", "D"), ExternalId.of("E", "F")));
    user.setUserId("Test201");
    user.setName("TestUser201");
    user.setTimeZone(ZoneId.of("Asia/Tokyo"));
    template.update("INSERT INTO usr_oguser VALUES (?,?,?,?,?, ?,?,?,?,?, ?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP,
        "Test201", "PW", "TestUser201", "Asia/Tokyo", "email201@email.com");
    user.setUniqueId(UniqueId.of("DbUsr", "201", "1"));
    user.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("C", "D"), ExternalId.of("E", "F")));
    user.setUserId("Test202");
    user.setName("TestUser202");
    user.setTimeZone(ZoneId.of("Asia/Tokyo"));
    template.update("INSERT INTO usr_oguser VALUES (?,?,?,?,?, ?,?,?,?,?, ?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP,
        "Test202", "PW", "TestUser202", "Asia/Tokyo", "email202@email.com");
    _totalUsers = 3;
//  id bigint not null,
//  key_scheme varchar(255) not null,
//  key_value varchar(255) not null,
    template.update("INSERT INTO usr_idkey VALUES (?,?,?)",
        1, "A", "B");
    template.update("INSERT INTO usr_idkey VALUES (?,?,?)",
        2, "C", "D");
    template.update("INSERT INTO usr_idkey VALUES (?,?,?)",
        3, "E", "F");
    template.update("INSERT INTO usr_idkey VALUES (?,?,?)",
        4, "G", "H");
//  user_id bigint not null,
//  idkey_id bigint not null,
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        101, 1);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        101, 2);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        101, 3);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        102, 1);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        102, 2);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        102, 4);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        201, 2);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        201, 3);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        202, 2);
    template.update("INSERT INTO usr_oguser2idkey VALUES (?,?)",
        202, 3);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

    _prtMaster.setClock(Clock.fixed(_now.toInstant(), ZoneOffset.UTC));
    _version1Instant = _now.toInstant().minusSeconds(100);
    _version2Instant = _now.toInstant().minusSeconds(50);
    s_logger.debug("test data now:   {}", _version1Instant);
    s_logger.debug("test data later: {}", _version2Instant);
    final JdbcOperations template = _prtMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO prt_portfolio VALUES (?,?,?,?,?, ?,?,?)",
        101, 101, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestPortfolio101", 25);
    template.update("INSERT INTO prt_portfolio VALUES (?,?,?,?,?, ?,?,?)",
        102, 102, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestPortfolio102", 25);
    template.update("INSERT INTO prt_portfolio VALUES (?,?,?,?,?, ?,?,?)",
        201, 201, toSqlTimestamp(_version1Instant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestPortfolio201", 25);
    template.update("INSERT INTO prt_portfolio VALUES (?,?,?,?,?, ?,?,?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestPortfolio202", 25);
    template.update("INSERT INTO prt_portfolio VALUES (?,?,?,?,?, ?,?,?)",
        301, 301, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1Instant), MAX_SQL_TIMESTAMP, "TestPortfolio301", 75);
    _visiblePortfolios = 3;
    _totalPortfolios = 4;
   
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        111, 111, 101, 101, null, null, 0, 1, 6, "TestNode111");
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        112, 112, 101, 101, 111, 111, 1, 2, 5, "TestNode112");
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        113, 113, 101, 101, 112, 112, 2, 3, 4, "TestNode113");
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        121, 121, 102, 102, null, null, 0, 1, 2, "TestNode121");
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        211, 211, 201, 201, null, null, 0, 1, 2, "TestNode211");
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        212, 211, 202, 201, null, null, 0, 1, 2, "TestNode212");
    template.update("INSERT INTO prt_node VALUES (?,?,?,?,?, ?,?,?,?,?)",
        311, 311, 301, 301, null, null, 0, 1, 2, "TestNode311");
   
    template.update("INSERT INTO prt_position VALUES (?,?,?)",
        112, "DbPos", "500");
    template.update("INSERT INTO prt_position VALUES (?,?,?)",
        113, "DbPos", "501");
    template.update("INSERT INTO prt_position VALUES (?,?,?)",
        113, "DbPos", "502");
    template.update("INSERT INTO prt_position VALUES (?,?,?)",
        211, "DbPos", "500");
    template.update("INSERT INTO prt_position VALUES (?,?,?)",
        212, "DbPos", "500");
    template.update("INSERT INTO prt_position VALUES (?,?,?)",
        311, "DbPos", "500");
   
    template.update("INSERT INTO prt_portfolio_attribute VALUES (?,?,?,?,?)",
        10, 101, 101, "K101a", "V101a");
    template.update("INSERT INTO prt_portfolio_attribute VALUES (?,?,?,?,?)",
        11, 101, 101, "K101b", "V101b");
    template.update("INSERT INTO prt_portfolio_attribute VALUES (?,?,?,?,?)",
        12, 102, 102"K102a", "V102a");
    template.update("INSERT INTO prt_portfolio_attribute VALUES (?,?,?,?,?)",
        13, 102, 102, "K102b", "V102b");
   
    _totalPositions = 6;
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

  private void addExternalIds() {
    FudgeMsgEnvelope env = s_fudgeContext.toFudgeMsg(ExternalId.of("A", "B"));
    byte[] bytes = s_fudgeContext.toByteArray(env.getMessage());
    String cls = ExternalId.class.getName();
    LobHandler lobHandler = new DefaultLobHandler();
    final JdbcOperations template = _cfgMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        101, 101, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, "TestConfig101", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        102, 102, toSqlTimestamp(_version1bInstant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1bInstant), MAX_SQL_TIMESTAMP, "TestConfig102", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        201, 201, toSqlTimestamp(_version1cInstant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1cInstant), MAX_SQL_TIMESTAMP, "TestConfig201", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        202, 201, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestConfig202", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    _totalExternalIds = 3;
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

  private void addExternalIdBundles() {
    FudgeMsgEnvelope env = s_fudgeContext.toFudgeMsg(ExternalIdBundle.of(ExternalId.of("C", "D"), ExternalId.of("E", "F")));
    byte[] bytes = s_fudgeContext.toByteArray(env.getMessage());
    String cls = ExternalIdBundle.class.getName();
    LobHandler lobHandler = new DefaultLobHandler();
    final JdbcOperations template = _cfgMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        301, 301, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, "TestConfig301", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        302, 302, toSqlTimestamp(_version1bInstant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1bInstant), MAX_SQL_TIMESTAMP, "TestConfig302", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        401, 401, toSqlTimestamp(_version1cInstant), toSqlTimestamp(_version2Instant), toSqlTimestamp(_version1cInstant), MAX_SQL_TIMESTAMP, "TestConfig401", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        402, 401, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version2Instant), MAX_SQL_TIMESTAMP, "TestConfig402", cls,
        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    _totalBundles = 3;
  }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations

            Util.runScript(url, template.getJdbcOperations(), null);
        } else {
            DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
            NamedParameterJdbcTemplate template = new NamedParameterJdbcTemplate(transactionManager.getDataSource());
            TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
            final JdbcOperations jdbcOperations = template.getJdbcOperations();
            transactionTemplate.execute(new TransactionCallback<Object>() {

                @Override
                public Object doInTransaction(TransactionStatus ts) {
                    try {
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.