Created
April 28, 2020 06:18
-
-
Save CheolhoJeon/4d0e760b18385a8320329f038e8bbf3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package config; | |
import org.apache.tomcat.jdbc.pool.DataSource; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
@Configuration | |
@Profile("dev") | |
public class DsDevConfig { | |
@Bean(destroyMethod = "close") | |
public DataSource dataSource() { | |
DataSource ds = new DataSource(); | |
ds.setDriverClassName("org.postgresql.Driver"); | |
ds.setUrl("jdbc:postgresql://localhost:5432/spring5fs"); | |
ds.setUsername("charlie"); | |
ds.setPassword("charlie123"); | |
ds.setInitialSize(2); | |
ds.setMaxActive(10); | |
ds.setTestWhileIdle(true); | |
ds.setMinEvictableIdleTimeMillis(60000 * 3); | |
ds.setTimeBetweenEvictionRunsMillis(10 * 1000); | |
return ds; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment