use of org.springframework.jdbc.datasource.DriverManagerDataSource in project buffer-slayer by tramchamploo.
the class BatchJdbcTemplateTest method init.
@BeforeClass
public static void init() {
dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("org.h2.Driver");
dataSource.setUrl("jdbc:h2:~/test");
}
use of org.springframework.jdbc.datasource.DriverManagerDataSource in project iaf by ibissource.
the class URLDataSourceFactory method createDataSource.
protected DataSource createDataSource(String product, String url, String userId, String password, boolean testPeek, String implClassname) throws Exception {
DriverManagerDataSource dataSource = new DriverManagerDataSource(url, userId, password);
Properties properties = new Properties();
properties.setProperty(PRODUCT_KEY, product);
properties.setProperty(TEST_PEEK_KEY, "" + testPeek);
dataSource.setConnectionProperties(properties);
return dataSource;
}
use of org.springframework.jdbc.datasource.DriverManagerDataSource in project tutorials by eugenp.
the class SpringConfig method dataSource.
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("org.sqlite.JDBC");
dataSource.setUrl("jdbc:sqlite:repository.sqlite");
return dataSource;
}
use of org.springframework.jdbc.datasource.DriverManagerDataSource in project tutorials by eugenp.
the class MySQLAutoconfiguration method dataSource2.
@Bean(name = "dataSource")
@ConditionalOnProperty(name = "usemysql", havingValue = "custom")
@ConditionalOnMissingBean
public DataSource dataSource2() {
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl(env.getProperty("mysql.url"));
dataSource.setUsername(env.getProperty("mysql.user") != null ? env.getProperty("mysql.user") : "");
dataSource.setPassword(env.getProperty("mysql.pass") != null ? env.getProperty("mysql.pass") : "");
return dataSource;
}
use of org.springframework.jdbc.datasource.DriverManagerDataSource in project tutorials by eugenp.
the class PersistenceConfig method dataSource.
@Bean
public DataSource dataSource() {
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(env.getProperty("jdbc.driverClassName"));
dataSource.setUrl(env.getProperty("jdbc.url"));
dataSource.setUsername(env.getProperty("jdbc.user"));
dataSource.setPassword(env.getProperty("jdbc.pass"));
return dataSource;
}
Aggregations