aboutsummaryrefslogtreecommitdiff
path: root/juick-api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-20 15:12:34 +0300
committerGravatar Vitaly Takmazov2016-07-20 15:12:34 +0300
commitc19397fb6d4635120a1a8cdaef6d66f0b36e3c4b (patch)
tree8840145f5eeefcf72715c80d00c9898555c32b35 /juick-api
parentd5d21e26157f7a5821a68f53e043ad88b150fca3 (diff)
DriverManagerDataSource -> BasicDataSource
Diffstat (limited to 'juick-api')
-rw-r--r--juick-api/build.gradle1
-rw-r--r--juick-api/src/main/java/com/juick/api/Main.java4
2 files changed, 3 insertions, 2 deletions
diff --git a/juick-api/build.gradle b/juick-api/build.gradle
index e1533883..4b8ce36a 100644
--- a/juick-api/build.gradle
+++ b/juick-api/build.gradle
@@ -26,6 +26,7 @@ dependencies {
compile 'com.github.pengrad:java-telegram-bot-api:2.1.1'
compile 'org.msbotframework4j:msbotframework4j-builder:0.1.4'
compile 'com.neovisionaries:nv-websocket-client:1.27'
+ compile 'org.apache.commons:commons-dbcp2:2.0'
providedRuntime 'mysql:mysql-connector-java:5.1.39'
}
compileJava.options.encoding = 'UTF-8'
diff --git a/juick-api/src/main/java/com/juick/api/Main.java b/juick-api/src/main/java/com/juick/api/Main.java
index 5a495ba2..676aab79 100644
--- a/juick-api/src/main/java/com/juick/api/Main.java
+++ b/juick-api/src/main/java/com/juick/api/Main.java
@@ -30,8 +30,8 @@ import com.juick.xmpp.StreamComponent;
import com.juick.xmpp.extensions.JuickMessage;
import com.juick.xmpp.extensions.Nickname;
import com.juick.xmpp.extensions.XOOB;
+import org.apache.commons.dbcp2.BasicDataSource;
import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
@@ -75,7 +75,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
LogManager.getLogManager().readConfiguration(getServletContext().getResourceAsStream("/WEB-INF/logging.properties"));
Properties conf = new Properties();
conf.load(getServletContext().getResourceAsStream("/WEB-INF/juick.conf"));
- DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(conf.getProperty("datasource_driver", "com.mysql.jdbc.Driver"));
dataSource.setUrl(conf.getProperty("datasource_url"));
jdbc = new JdbcTemplate(dataSource);