diff options
Diffstat (limited to 'src/main/java/com/juick/api/Main.java')
-rw-r--r-- | src/main/java/com/juick/api/Main.java | 16 |
1 files changed, 8 insertions, 8 deletions
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); |