aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/api/Utils.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-01-15 12:51:21 +0300
committerGravatar Vitaly Takmazov2016-01-15 12:51:21 +0300
commit690b3ea447a7a2434ecf1d210e5f5ef89ce27f04 (patch)
tree2e96768580044b2144b38e423f0fe20f73f522d8 /src/main/java/com/juick/api/Utils.java
parent5c207f65b0cafbaa0cbdae72a5a485cf7aa62556 (diff)
spring-jdbc WIP
Diffstat (limited to 'src/main/java/com/juick/api/Utils.java')
-rw-r--r--src/main/java/com/juick/api/Utils.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/juick/api/Utils.java b/src/main/java/com/juick/api/Utils.java
index 10e0cccb..db73fdaa 100644
--- a/src/main/java/com/juick/api/Utils.java
+++ b/src/main/java/com/juick/api/Utils.java
@@ -27,6 +27,7 @@ import java.util.ArrayList;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.springframework.jdbc.core.JdbcTemplate;
import sun.misc.BASE64Decoder;
/**
@@ -47,7 +48,7 @@ public class Utils {
return null;
}
- public static com.juick.User getVisitorUser(Connection sql, HttpServletRequest request) {
+ public static com.juick.User getVisitorUser(JdbcTemplate sql, HttpServletRequest request) {
String hash = getCookie(request, "hash");
if (hash != null) {
return com.juick.server.UserQueries.getUserByHash(sql, hash);
@@ -56,7 +57,7 @@ public class Utils {
}
}
- public static int getVisitorUID(Connection sql, HttpServletRequest request) {
+ public static int getVisitorUID(JdbcTemplate sql, HttpServletRequest request) {
Cookie cookies[] = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
@@ -84,7 +85,7 @@ public class Utils {
return 0;
}
- public static int getVisitorQueryStringUID(Connection sql, HttpServletRequest request) {
+ public static int getVisitorQueryStringUID(JdbcTemplate sql, HttpServletRequest request) {
String hash = request.getParameter("hash");
if (hash != null && hash.length() == 16) {
return com.juick.server.UserQueries.getUIDbyHash(sql, hash);