Java Code Examples for org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder#create()

The following examples show how to use org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataSourceConfiguration.java    From md_blockchain with Apache License 2.0 5 votes vote down vote up
@Bean(destroyMethod = "", name = "EmbeddeddataSource")
public DataSource dataSource() {
    DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
    dataSourceBuilder.driverClassName("org.sqlite.JDBC");
    dataSourceBuilder.url("jdbc:sqlite:" + dbName);
    dataSourceBuilder.type(SQLiteDataSource.class);
    return dataSourceBuilder.build();
}
 
Example 2
Source File: DBConfig.java    From MonitorClient with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
    dataSourceBuilder.driverClassName("org.sqlite.JDBC");
    dataSourceBuilder.url("jdbc:sqlite:config/config.db");
    return dataSourceBuilder.build();
}
 
Example 3
Source File: DBConfig.java    From MonitorClient with Apache License 2.0 5 votes vote down vote up
/**
 * 索引数据库配置
 * @data 2017年3月11日
 * @param indexPath 数据库存储位置
 * @return
 */
public DataSource indexDataSource(String indexPath) {
    DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
    dataSourceBuilder.driverClassName("org.sqlite.JDBC");
    dataSourceBuilder.url("jdbc:sqlite:"+indexPath);
    return dataSourceBuilder.build();
}
 
Example 4
Source File: JpaConfig.java    From WebIDE-Backend with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Bean
public DataSource dataSource() {
    DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
    dataSourceBuilder.driverClassName(driverClassName);
    dataSourceBuilder.url(url);
    dataSourceBuilder.type(HikariDataSource.class);
    return dataSourceBuilder.build();
}