From c19397fb6d4635120a1a8cdaef6d66f0b36e3c4b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 20 Jul 2016 15:12:34 +0300 Subject: DriverManagerDataSource -> BasicDataSource --- .../java/com/juick/ws/configuration/WebsocketConfiguration.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'juick-ws/src/main/java/com') 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); -- cgit v1.2.3