本文整理汇总了Java中org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder类的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedDatabaseBuilder类的具体用法?Java EmbeddedDatabaseBuilder怎么用?Java EmbeddedDatabaseBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EmbeddedDatabaseBuilder类属于org.springframework.jdbc.datasource.embedded包,在下文中一共展示了EmbeddedDatabaseBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupEmbeddedDatabase
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
private static void setupEmbeddedDatabase() throws NamingException{
SimpleNamingContextBuilder builder = SimpleNamingContextBuilder
.emptyActivatedContextBuilder();
EmbeddedDatabaseBuilder dbBuilder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase db = dbBuilder
.setType(EmbeddedDatabaseType.DERBY)
.setName("usciitg")
.setScriptEncoding("UTF-8")
.ignoreFailedDrops(true)
.addScript("org/partners/usciitg_prep/terminology/jpa/create-db.sql")
.addScript("org/partners/usciitg_prep/terminology/jpa/insert-data.sql")
.build();
builder.bind(System.getProperty("usciitg.datasource"), db);
}
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:17,代码来源:FhirTerminologyProviderServiceIT.java
示例2: setupEmbeddedDatabase
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
private static void setupEmbeddedDatabase() throws NamingException{
SimpleNamingContextBuilder builder = SimpleNamingContextBuilder
.emptyActivatedContextBuilder();
EmbeddedDatabaseBuilder dbBuilder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase db = dbBuilder
.setType(EmbeddedDatabaseType.DERBY)
.setName("usciitg")
.setScriptEncoding("UTF-8")
.ignoreFailedDrops(true)
.addScript("org/partners/usciitg_prep/terminology/jpa/create-db.sql")
.addScript("org/partners/usciitg_prep/fhir/cql/insert-data.sql")
.build();
builder.bind(System.getProperty("usciitg.datasource"), db);
}
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:17,代码来源:JpaFhirTerminologyProviderIT.java
示例3: setupEmbeddedDatabase
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
private static void setupEmbeddedDatabase() throws NamingException{
SimpleNamingContextBuilder builder = SimpleNamingContextBuilder
.emptyActivatedContextBuilder();
EmbeddedDatabaseBuilder dbBuilder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase db = dbBuilder
.setType(EmbeddedDatabaseType.DERBY)
.setName("usciitg")
.setScriptEncoding("UTF-8")
.ignoreFailedDrops(true)
.addScript("org/partners/usciitg_prep/terminology/jpa/create-db.sql")
.addScript("org/partners/usciitg_prep/fhir/cql/insert-data.sql")
.addScript("org/partners/usciitg_prep/fhir/create-db.sql")
.addScript("org/partners/usciitg_prep/fhir/insert-data.sql")
.build();
builder.bind(System.getProperty("usciitg.datasource"), db);
}
示例4: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(EmbeddedDatabase.class)
public EmbeddedDatabase dataSource() {
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.H2) //
.setName("grpcmonitor")//
.addScript("mapper/create-db.sql")//
.build();
return db;
}
示例5: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
@Bean
public DataSource dataSource() {
EmbeddedDatabase db = new EmbeddedDatabaseBuilder()
.generateUniqueName(true)
.setType(EmbeddedDatabaseType.H2)
.setScriptEncoding("UTF-8")
.ignoreFailedDrops(true)
.addScript("classpath:me/chanjar/domain/foo-ddl.sql")
.build();
return db;
}
示例6: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.generateUniqueName(true)
.setType(EmbeddedDatabaseType.H2)
.setScriptEncoding("UTF-8")
.ignoreFailedDrops(true)
.addScript("classpath:me/chanjar/domain/foo-ddl.sql")
.build();
}
示例7: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
@Bean
DataSource dataSource() {
// @formatter:off
return new EmbeddedDatabaseBuilder()
.generateUniqueName(true)
.setType(EmbeddedDatabaseType.H2)
.addScript("schema-refresh-tokens.sql")
.build();
// @formatter:on
}
示例8: getDataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
@Override
@Bean(name = "dataSource")
public DataSource getDataSource() {
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase embeddedDb = builder
.setType(EmbeddedDatabaseType.DERBY)
.ignoreFailedDrops(true)
.addScript("sql/create_tables.sql")
.addScript("sql/insert_just_category_data.sql")
.build();
return embeddedDb;
}
示例9: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
/**
* Custom H2 implementation for our {@link EmbeddedDatabase}
* @return
*/
@Bean
public DataSource dataSource() {
// no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
return new EmbeddedDatabaseBuilder()
//Starting embedded database: url='jdbc:h2:mem:dataSource;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
.setName("dataSource")
// Lets not get upset as we are only debugging ;-)
.ignoreFailedDrops(true)
.continueOnError(true)
// DB Details:
.setType(EmbeddedDatabaseType.H2)
.addScript("/database/h2/calendar-schema.sql")
.addScript("/database/h2/calendar-data.sql")
// Authority tables
.addScript("/database/h2/calendar-authorities.sql")
.addScript("/database/h2/calendar-sha256.sql")
.build();
}
示例10: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
/**
* Custom H2 implementation for our {@link EmbeddedDatabase}
* @return
*/
@Bean
public DataSource dataSource() {
// no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
return new EmbeddedDatabaseBuilder()
//Starting embedded database: url='jdbc:h2:mem:dataSource;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
.setName("dataSource")
// Lets not get upset as we are only debugging ;-)
.ignoreFailedDrops(true)
.continueOnError(true)
// DB Details:
.setType(EmbeddedDatabaseType.H2)
.addScript("/database/h2/calendar-schema.sql")
.addScript("/database/h2/calendar-data.sql")
.addScript("/database/h2/security-schema.sql")
.addScript("/database/h2/security-users.sql")
.addScript("/database/h2/security-user-authorities.sql")
.build();
}
示例11: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
/**
* Custom H2 implementation for our {@link EmbeddedDatabase}
* @return
*/
@Bean
public DataSource dataSource() {
// no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
return new EmbeddedDatabaseBuilder()
//Starting embedded database: url='jdbc:h2:mem:dataSource;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
.setName("dataSource")
// Lets not get upset as we are only debugging ;-)
.ignoreFailedDrops(true)
.continueOnError(true)
// DB Details:
.setType(EmbeddedDatabaseType.H2)
.addScript("/database/h2/calendar-schema.sql")
.addScript("/database/h2/calendar-data.sql")
// Authority tables
.addScript("/database/h2/calendar-authorities.sql")
// .addScript("/database/h2/calendar-saltedsha256.sql")
.addScript("/database/h2/calendar-bcrypt.sql")
.build();
}
示例12: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
/**
* Custom H2 implementation for our {@link EmbeddedDatabase}
* @return
*/
@Bean
public DataSource dataSource() {
// no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
return new EmbeddedDatabaseBuilder()
//Starting embedded database: url='jdbc:h2:mem:dataSource;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
.setName("dataSource")
// Lets not get upset as we are only debugging ;-)
.ignoreFailedDrops(true)
.continueOnError(true)
// DB Details:
.setType(EmbeddedDatabaseType.H2)
.addScript("/database/h2/calendar-schema.sql")
.addScript("/database/h2/calendar-data.sql")
// Security SQL
.addScript("/database/h2/security-schema.sql")
.addScript("/database/h2/security-users.sql")
.addScript("/database/h2/security-groups-schema.sql")
.addScript("/database/h2/security-groups-mappings.sql")
.build();
}
示例13: dataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
/**
* Custom H2 implementation for our {@link EmbeddedDatabase}
* @return
*/
@Bean
public DataSource dataSource() {
// no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
return new EmbeddedDatabaseBuilder()
//Starting embedded database: url='jdbc:h2:mem:dataSource;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
.setName("dataSource")
// Lets not get upset as we are only debugging ;-)
.ignoreFailedDrops(true)
.continueOnError(true)
// DB Details:
.setType(EmbeddedDatabaseType.H2)
.addScript("/database/h2/calendar-schema.sql")
.addScript("/database/h2/calendar-data.sql")
// Authority tables
.addScript("/database/h2/calendar-authorities.sql")
.build();
}
示例14: h2DataSource
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
private static DataSource h2DataSource() {
synchronized (LOCK) {
if (dataSource == null) {
dataSource = new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.H2)
.addScript("net/iaeste/iws/persistence/h2/10-base-tables.sql")
.addScript("net/iaeste/iws/persistence/15-base-views.sql")
.addScript("net/iaeste/iws/persistence/19-base-data.sql")
.addScript("net/iaeste/iws/persistence/h2/30-exchange-tables.sql")
.addScript("net/iaeste/iws/persistence/35-exchange-views.sql")
.addScript("net/iaeste/iws/persistence/90-initial-test-data.sql")
.build();
}
return dataSource;
}
}
示例15: dataSourceProd
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; //导入依赖的package包/类
@Bean
public DataSource dataSourceProd() {
String databaseUrl = env.getProperty("database.url");
String databaseUsername = env.getProperty("database.username");
String databasePassword = env.getProperty("database.password");
if(databaseUrl == null || databaseUsername == null || databasePassword == null) {
logger.log(Level.ALL, "Using local H2 database");
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2).build();
}
logger.log(Level.ALL, "Using database " + databaseUrl);
return DataSourceBuilder.create()
.url(databaseUrl)
.username(databaseUsername)
.password(databasePassword)
.build();
}