I'm trying to set up pooling with SQLServerDataSource
if i understand this answer
https://stackoverflow.com/a/25573035/1262568
public DataSource dataSource() {
DataSourceBuilder factory = DataSourceBuilder
.create(this.properties.getClassLoader())
.driverClassName(this.properties.getDriverClassName())
.url(this.properties.getUrl())
.username(this.properties.getUsername())
.password(this.properties.getPassword());
return factory.build();
}
Geting connection from a DataSource
created in that way will return pooled connection using one of the available connection pools.
But what if instead DataSourceBuilder
i want to use SQLServerDataSource
Will it also automatically use one of the available connection pool?
public DataSource dataSource() {
SQLServerDataSource sqlServerDataSource = new SQLServerDataSource();
sqlServerDataSource.setUser(UserName);
sqlServerDataSource.setPassword(Password);
sqlServerDataSource.setURL(Url);
return sqlServerDataSource;
}