use of cn.taketoday.jdbc.datasource.SimpleDriverDataSource in project today-framework by TAKETODAY.
the class H2SequenceMaxValueIncrementerTests method incrementsSequenceWithExplicitH2CompatibilityMode.
/**
* Tests that the incrementer works when using all supported H2 <em>compatibility modes</em>.
*/
@ParameterizedTest
@EnumSource(Mode.ModeEnum.class)
void incrementsSequenceWithExplicitH2CompatibilityMode(Mode.ModeEnum mode) {
String connectionUrl = String.format("jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false;MODE=%s", UUID.randomUUID().toString(), mode);
DataSource dataSource = new SimpleDriverDataSource(new org.h2.Driver(), connectionUrl, "sa", "");
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.execute("CREATE SEQUENCE SEQ");
assertIncrements(dataSource);
jdbcTemplate.execute("SHUTDOWN");
}
use of cn.taketoday.jdbc.datasource.SimpleDriverDataSource in project today-infrastructure by TAKETODAY.
the class H2SequenceMaxValueIncrementerTests method incrementsSequenceWithExplicitH2CompatibilityMode.
/**
* Tests that the incrementer works when using all supported H2 <em>compatibility modes</em>.
*/
@ParameterizedTest
@EnumSource(Mode.ModeEnum.class)
void incrementsSequenceWithExplicitH2CompatibilityMode(Mode.ModeEnum mode) {
String connectionUrl = String.format("jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false;MODE=%s", UUID.randomUUID().toString(), mode);
DataSource dataSource = new SimpleDriverDataSource(new org.h2.Driver(), connectionUrl, "sa", "");
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.execute("CREATE SEQUENCE SEQ");
assertIncrements(dataSource);
jdbcTemplate.execute("SHUTDOWN");
}
Aggregations