aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server/UserQueries.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-10-31 14:05:00 +0700
committerGravatar Ugnich Anton2013-10-31 14:05:00 +0700
commit73407176f75e66bd47f08046496e0a301217a010 (patch)
tree0e68d1e7787da38a92671fc4dec298ec02fc9f82 /src/com/juick/server/UserQueries.java
parent76e1829a199d0deb9c582951a9c7a09170a005f7 (diff)
SQLHelpers.executeInt
Diffstat (limited to 'src/com/juick/server/UserQueries.java')
-rw-r--r--src/com/juick/server/UserQueries.java23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/com/juick/server/UserQueries.java b/src/com/juick/server/UserQueries.java
index e56accdb..f127cbca 100644
--- a/src/com/juick/server/UserQueries.java
+++ b/src/com/juick/server/UserQueries.java
@@ -54,27 +54,8 @@ public class UserQueries {
Utils.finishSQL(rs, stmt);
}
- PreparedStatement stmt2 = null;
- try {
- stmt2 = sql.prepareStatement("INSERT INTO useroptions(user_id) VALUES (?)");
- stmt2.setInt(1, uid);
- stmt2.executeUpdate();
- } catch (SQLException e) {
- System.err.println(e);
- } finally {
- Utils.finishSQL(null, stmt);
- }
-
- PreparedStatement stmt3 = null;
- try {
- stmt3 = sql.prepareStatement("INSERT INTO subscr_users(user_id,suser_id) VALUES (2,?)");
- stmt3.setInt(1, uid);
- stmt3.executeUpdate();
- } catch (SQLException e) {
- System.err.println(e);
- } finally {
- Utils.finishSQL(null, stmt);
- }
+ SQLHelpers.executeInt(sql, "INSERT INTO useroptions(user_id) VALUES (?)", uid);
+ SQLHelpers.executeInt(sql, "INSERT INTO subscr_users(user_id,suser_id) VALUES (2,?)", uid);
return uid;
}