Java Code Examples for org.springframework.jdbc.datasource.SingleConnectionDataSource#setUrl()

The following examples show how to use org.springframework.jdbc.datasource.SingleConnectionDataSource#setUrl() . 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: SqliteDbService.java    From ecs-sync with Apache License 2.0 5 votes vote down vote up
@Override
protected JdbcTemplate createJdbcTemplate() {
    SingleConnectionDataSource ds = new SingleConnectionDataSource();
    ds.setUrl(JDBC_URL_BASE + getDbFile());
    ds.setSuppressClose(true);
    return new JdbcTemplate(ds);
}
 
Example 2
Source File: Utils.java    From jql with MIT License 4 votes vote down vote up
public static SingleConnectionDataSource getDataSourceFrom(String databaseFile) {
    SingleConnectionDataSource dataSource = new SingleConnectionDataSource();
    dataSource.setDriverClassName("org.sqlite.JDBC");
    dataSource.setUrl("jdbc:sqlite:" + databaseFile);
    return dataSource;
}