use of org.springframework.cloud.service.relational.DataSourceConfig in project spring-cloud-connectors by spring-cloud.
the class DatasourceConfigWithServiceConfig method dataSourceWithPoolAndConnectionConfig.
@Bean
public DataSource dataSourceWithPoolAndConnectionConfig() {
PoolConfig poolConfig = new PoolConfig(20, 200);
ConnectionConfig connectionConfig = new ConnectionConfig("sessionVariables=sql_mode='ANSI';characterEncoding=UTF-8");
DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig, basicDbcpConnectionPool());
return connectionFactory().dataSource("my-service", serviceConfig);
}
use of org.springframework.cloud.service.relational.DataSourceConfig in project spring-cloud-connectors by spring-cloud.
the class GenericServiceWithConnectorType method myServiceWithTypeWithServiceNameAndConfig.
@Bean
public DataSource myServiceWithTypeWithServiceNameAndConfig() {
PoolConfig poolConfig = new PoolConfig(20, 200);
ConnectionConfig connectionConfig = new ConnectionConfig("sessionVariables=sql_mode='ANSI';characterEncoding=UTF-8");
DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig);
return connectionFactory().service("my-service", DataSource.class, serviceConfig);
}
use of org.springframework.cloud.service.relational.DataSourceConfig in project spring-cloud-connectors by spring-cloud.
the class DatasourceConfigWithServiceConfig method dataSourceWithConnectionPropertiesConfig.
@Bean
public DataSource dataSourceWithConnectionPropertiesConfig() {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("driverClassName", "test.driver");
properties.put("validationQuery", "test validation query");
properties.put("testOnBorrow", false);
DataSourceConfig serviceConfig = new DataSourceConfig(null, null, basicDbcpConnectionPool(), properties);
return connectionFactory().dataSource("my-service", serviceConfig);
}
use of org.springframework.cloud.service.relational.DataSourceConfig in project spring-cloud-connectors by spring-cloud.
the class DatasourceConfigWithServiceConfig method dataSourceWithPoolConfig.
@Bean
public DataSource dataSourceWithPoolConfig() {
PoolConfig poolConfig = new PoolConfig(5, 30, 3000);
DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, null, basicDbcpConnectionPool());
return connectionFactory().dataSource("my-service", serviceConfig);
}
Aggregations