diff options
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r-- | juick-server/src/main/java/com/juick/configuration/DataConfiguration.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java b/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java index 88fc00b3..9f733184 100644 --- a/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java +++ b/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java @@ -1,6 +1,7 @@ package com.juick.configuration; import org.apache.commons.dbcp2.BasicDataSource; +import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -13,7 +14,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.TransactionManagementConfigurer; import javax.annotation.Resource; -import javax.sql.DataSource; /** * Created by aalexeev on 11/11/16. @@ -26,8 +26,10 @@ public class DataConfiguration implements TransactionManagementConfigurer { @Resource private Environment env; + // NOTE: The close() method will be called automatically with default @Bean settings + // But Datasource interface has no close() method @Bean - public DataSource dataSource() { + public BasicDataSource dataSource() { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(env.getProperty("datasource_driver", "com.mysql.jdbc.Driver")); |