Package org.springframework.jdbc.core.simple

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


    {
        for (String dataSourceName : dataSourceNames)
        {
            contextService.setCurrentClient(dataSourceName);
            SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource);
            String name = jdbcTemplate.queryForObject("select name from db_name", String.class, Collections.EMPTY_MAP);
            assertThat(name, is(dataSourceName));
        }
    }
}
View Full Code Here


        strategy.recordMigration(DatabaseType.H2, connection, v1, new Date(), 768);
        connection.close();

        SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource);
        assertThat(jdbcTemplate.queryForInt("select count(*) from " + TABLE_NAME), is(1));
        assertThat(jdbcTemplate.queryForObject("select " + VERSION_COLUMN + " from " + TABLE_NAME, String.class), is(v1));

        connection = dataSource.getConnection();
        strategy.recordMigration(DatabaseType.H2, connection, v2, new Date(), 231);
        connection.close();

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.