aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/http/www/User.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-06-27 10:33:52 +0300
committerGravatar Vitaly Takmazov2016-06-27 10:33:52 +0300
commit53fb0b3e0e790df007a198deef21c115ed236b3e (patch)
tree7dcf33649f36b64d8240bf9a48242c7e5ceed24b /src/main/java/com/juick/http/www/User.java
parent83a3c5f721411bc463fea4c209e6fc2537c50417 (diff)
merge with spring-jdbc
Diffstat (limited to 'src/main/java/com/juick/http/www/User.java')
-rw-r--r--src/main/java/com/juick/http/www/User.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/main/java/com/juick/http/www/User.java b/src/main/java/com/juick/http/www/User.java
index 84d1ad9a..a4fdcf21 100644
--- a/src/main/java/com/juick/http/www/User.java
+++ b/src/main/java/com/juick/http/www/User.java
@@ -20,21 +20,18 @@ package com.juick.http.www;
import com.juick.server.MessagesQueries;
import com.juick.server.TagQueries;
import com.juick.server.UserQueries;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import javax.servlet.ServletException;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
/**
*
@@ -42,7 +39,7 @@ import javax.servlet.http.HttpServletResponse;
*/
public class User {
- protected void doGetBlog(Connection sql, Connection sqlSearch, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
+ protected void doGetBlog(JdbcTemplate sql, JdbcTemplate sqlSearch, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
List<Integer> mids;
@@ -158,7 +155,7 @@ public class User {
}
}
- protected void doGetTags(Connection sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
+ protected void doGetTags(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor == null) {
@@ -181,7 +178,7 @@ public class User {
}
}
- protected void doGetFriends(Connection sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
+ protected void doGetFriends(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor == null) {
@@ -227,7 +224,7 @@ public class User {
}
}
- protected void doGetReaders(Connection sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
+ protected void doGetReaders(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor == null) {
@@ -285,7 +282,7 @@ public class User {
}
}
- public static void pageUserColumn(PrintWriter out, Connection sql, com.juick.User user, com.juick.User visitor) {
+ public static void pageUserColumn(PrintWriter out, JdbcTemplate sql, com.juick.User user, com.juick.User visitor) {
out.println("<aside id=\"column\">");
out.println(" <div id=\"ctitle\"><a href=\"./\"><img src=\"//i.juick.com/as/" + user.getUID() + ".png\" alt=\"\"/>" + user.getUName() + "</a></div>");
if (visitor != null && visitor.getUID() > 0 && visitor.getUID() != user.getUID()) {
@@ -342,7 +339,7 @@ public class User {
out.println("</aside>");
}
- public static String pageUserTags(Connection sql, com.juick.User user, com.juick.User visitor, int cnt) {
+ public static String pageUserTags(JdbcTemplate sql, com.juick.User user, com.juick.User visitor, int cnt) {
com.juick.Tag tags[] = null;
int maxUsageCnt = 0;