diff options
author | Vitaly Takmazov | 2016-07-20 15:12:34 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-20 15:12:34 +0300 |
commit | c19397fb6d4635120a1a8cdaef6d66f0b36e3c4b (patch) | |
tree | 8840145f5eeefcf72715c80d00c9898555c32b35 /juick-ws/src/main/java/com | |
parent | d5d21e26157f7a5821a68f53e043ad88b150fca3 (diff) |
DriverManagerDataSource -> BasicDataSource
Diffstat (limited to 'juick-ws/src/main/java/com')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index fbc6226b..d432b19c 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -2,17 +2,14 @@ package com.juick.ws.configuration; import com.juick.ws.WebsocketComponent; import com.juick.ws.XMPPConnection; +import org.apache.commons.dbcp2.BasicDataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DriverManagerDataSource; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.WebSocketConfigurer; @@ -45,7 +42,7 @@ public class WebsocketConfiguration extends WebMvcConfigurationSupport implement } @Bean JdbcTemplate jdbc() { - DriverManagerDataSource dataSource = new DriverManagerDataSource(); + BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(env.getProperty("datasource_driver", "com.mysql.jdbc.Driver")); dataSource.setUrl(env.getProperty("datasource_url")); return new JdbcTemplate(dataSource); |