aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/MessagesQueries.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-01-15 13:14:11 +0300
committerGravatar Vitaly Takmazov2016-01-15 13:14:11 +0300
commit1ef890d21db2ed9aeefc37b71ff82d0f59df8516 (patch)
treea6e78892b7306c1763a86db2633635ef5af2cd3a /src/main/java/com/juick/server/MessagesQueries.java
parent9bd8a41c0db5a1027a184facfca8d0152945c078 (diff)
housekeeping
Diffstat (limited to 'src/main/java/com/juick/server/MessagesQueries.java')
-rw-r--r--src/main/java/com/juick/server/MessagesQueries.java74
1 files changed, 36 insertions, 38 deletions
diff --git a/src/main/java/com/juick/server/MessagesQueries.java b/src/main/java/com/juick/server/MessagesQueries.java
index a8605d3a..cff8caff 100644
--- a/src/main/java/com/juick/server/MessagesQueries.java
+++ b/src/main/java/com/juick/server/MessagesQueries.java
@@ -17,7 +17,6 @@
*/
package com.juick.server;
-import com.juick.Message;
import org.springframework.jdbc.core.JdbcTemplate;
import java.sql.Connection;
@@ -31,7 +30,6 @@ import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.springframework.jdbc.core.RowMapper;
/**
*
@@ -39,7 +37,7 @@ import org.springframework.jdbc.core.RowMapper;
*/
public class MessagesQueries {
- private static final Logger logger = Logger.getLogger(MessagesQueries.class.getName());
+ private static final Logger LOGGER = Logger.getLogger(MessagesQueries.class.getName());
public static int createMessage(Connection sql, int uid, String txt, String attachment, List<com.juick.Tag> tags) {
int mid = 0;
@@ -60,7 +58,7 @@ public class MessagesQueries {
mid = rs.getInt(1);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}
@@ -82,7 +80,7 @@ public class MessagesQueries {
stmt = sql.prepareStatement("INSERT INTO messages_tags(message_id,tag_id) VALUES " + tagsIDs);
stmt.executeUpdate();
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}
@@ -98,7 +96,7 @@ public class MessagesQueries {
stmt.setString(3, txt);
stmt.executeUpdate();
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}
@@ -127,7 +125,7 @@ public class MessagesQueries {
ridnew = 0;
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}
@@ -175,7 +173,7 @@ public class MessagesQueries {
privacy = rs.getInt(2);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -198,7 +196,7 @@ public class MessagesQueries {
ret = rs.getInt(1) == 1;
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -219,7 +217,7 @@ public class MessagesQueries {
ret = rs.getInt(1) == 1;
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -264,7 +262,7 @@ public class MessagesQueries {
msg.Hidden = rs.getBoolean(13);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -285,7 +283,7 @@ public class MessagesQueries {
msg.Text = rs.getString(3);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -316,7 +314,7 @@ public class MessagesQueries {
msg.Text = rs.getString(6);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -339,7 +337,7 @@ public class MessagesQueries {
user.UName = rs.getString(2);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -365,7 +363,7 @@ public class MessagesQueries {
tags.add(t);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -387,7 +385,7 @@ public class MessagesQueries {
tids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -409,7 +407,7 @@ public class MessagesQueries {
users.add(rs.getString(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -457,7 +455,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -492,7 +490,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -521,7 +519,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -550,7 +548,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -614,7 +612,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -641,7 +639,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -669,7 +667,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -696,7 +694,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -723,7 +721,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -751,7 +749,7 @@ public class MessagesQueries {
mids0.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -766,7 +764,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -795,7 +793,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -824,7 +822,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -851,7 +849,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -878,7 +876,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -907,7 +905,7 @@ public class MessagesQueries {
mids0.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -922,7 +920,7 @@ public class MessagesQueries {
mids.add(rs.getInt(1));
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -1001,7 +999,7 @@ public class MessagesQueries {
replies.add(msg);
}
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(rs, stmt);
}
@@ -1027,7 +1025,7 @@ public class MessagesQueries {
}
ret = stmt.executeUpdate() > 0;
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}
@@ -1038,7 +1036,7 @@ public class MessagesQueries {
stmt.setInt(1, mid);
stmt.executeUpdate();
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}
@@ -1056,7 +1054,7 @@ public class MessagesQueries {
stmt.setInt(1, mid);
ret = stmt.executeUpdate() > 0;
} catch (SQLException e) {
- logger.log(Level.SEVERE, "sql exception", e);
+ LOGGER.log(Level.SEVERE, "sql exception", e);
} finally {
Utils.finishSQL(null, stmt);
}