aboutsummaryrefslogtreecommitdiff
path: root/juick-ws
diff options
context:
space:
mode:
Diffstat (limited to 'juick-ws')
-rw-r--r--juick-ws/build.gradle1
-rw-r--r--juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java7
2 files changed, 3 insertions, 5 deletions
diff --git a/juick-ws/build.gradle b/juick-ws/build.gradle
index 111c0d5d..a46f3b9f 100644
--- a/juick-ws/build.gradle
+++ b/juick-ws/build.gradle
@@ -16,6 +16,7 @@ dependencies {
compile "org.springframework:spring-websocket:${springFrameworkVersion}"
compile 'javax.inject:javax.inject:1'
compile 'org.apache.httpcomponents:httpclient:4.5.1'
+ compile 'org.apache.commons:commons-dbcp2:2.0'
testCompile 'junit:junit:4.12'
providedRuntime 'mysql:mysql-connector-java:5.1.39'
}
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);