예제 #1
0
 public static void removeModerator(int userID) {
   DatabaseManager dbMan;
   try {
     dbMan = DatabaseManager.getInstance();
     dbMan.removeModerator(userID);
   } catch (SQLException e) {
     e.printStackTrace();
   } catch (ClassNotFoundException e) {
     e.printStackTrace();
   }
 }
예제 #2
0
 public static boolean isPostOwner(int userID, int postID) {
   DatabaseManager dbMan;
   try {
     dbMan = DatabaseManager.getInstance();
     ResultSet result = dbMan.isPostOwner(userID, postID);
     if (result.next()) {
       return true;
     }
     return false;
   } catch (ClassNotFoundException e) {
     e.printStackTrace();
   } catch (SQLException e) {
     e.printStackTrace();
   }
   return false;
 }
예제 #3
0
 public static boolean isLocked(int eventID) {
   DatabaseManager dbMan;
   try {
     dbMan = DatabaseManager.getInstance();
     ResultSet result = dbMan.isLocked(eventID);
     while (result.next()) {
       int isLocked = Integer.parseInt(result.getString("E.isLocked"));
       if (isLocked == 0) {
         return false;
       }
       return true;
     }
     return true;
   } catch (ClassNotFoundException e) {
     e.printStackTrace();
   } catch (SQLException e) {
     e.printStackTrace();
   }
   return false;
 }