From 093a022955d547e6f94a4204a193c0e7296c11b2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 16 Jan 2016 14:13:11 +0300 Subject: drop unneeded dependency --- src/main/java/com/juick/api/Main.java | 16 ++++++++-------- src/test/java/com/juick/tests/JsonTests.java | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/api/Main.java b/src/main/java/com/juick/api/Main.java index 71f7f2d7..4233c45d 100644 --- a/src/main/java/com/juick/api/Main.java +++ b/src/main/java/com/juick/api/Main.java @@ -20,9 +20,15 @@ package com.juick.api; import com.juick.xmpp.JID; import com.juick.xmpp.Stream; import com.juick.xmpp.StreamComponent; -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; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; @@ -31,12 +37,6 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; -import javax.servlet.ServletException; -import javax.servlet.annotation.MultipartConfig; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; /** * @@ -65,7 +65,7 @@ public class Main extends HttpServlet implements Stream.StreamListener { Class.forName(driverClassName); sql = DriverManager.getConnection("jdbc:mysql://localhost/juick?autoReconnect=true&user=" + conf.getProperty("mysql_username", "") + "&password=" + conf.getProperty("mysql_password", "")); sqlSearch = DriverManager.getConnection("jdbc:mysql://127.0.0.1:9306/juick?autoReconnect=true&characterEncoding=utf8&maxAllowedPacket=512000&relaxAutoCommit=true&user=root&password="); - BasicDataSource dataSource = new BasicDataSource(); + DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setUrl(sql.getMetaData().getURL()); dataSource.setDriverClassName(driverClassName); jdbc = new JdbcTemplate(dataSource); diff --git a/src/test/java/com/juick/tests/JsonTests.java b/src/test/java/com/juick/tests/JsonTests.java index 496dea24..795b3429 100644 --- a/src/test/java/com/juick/tests/JsonTests.java +++ b/src/test/java/com/juick/tests/JsonTests.java @@ -5,6 +5,8 @@ import com.juick.server.MessagesQueries; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.datasource.DriverManagerDataSource; import java.io.FileInputStream; import java.io.IOException; @@ -12,8 +14,6 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.Properties; -import org.apache.commons.dbcp2.BasicDataSource; -import org.springframework.jdbc.core.JdbcTemplate; public class JsonTests { @@ -23,7 +23,7 @@ public class JsonTests { Properties conf = new Properties(); try { conf.load(new FileInputStream("/etc/juick/api.conf")); - BasicDataSource dataSource = new BasicDataSource(); + DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("com.mysql.jdbc.Driver"); dataSource.setUrl("jdbc:mysql://localhost/juick?autoReconnect=true&user=" + conf.getProperty("mysql_username", "") -- cgit v1.2.3