Skip to content
Snippets Groups Projects
Commit ff0d49f3 authored by Charlie Darques's avatar Charlie Darques
Browse files

clean up

parent 25747570
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,6 @@ public class Following extends HttpServlet { ...@@ -30,7 +30,6 @@ public class Following extends HttpServlet {
List<MyThread> threadsFollowedByUser = null; List<MyThread> threadsFollowedByUser = null;
try { try {
System.out.println("dans le try");
threadsFollowedByUser = userDAO.getThreadsFollowedByUser(user); threadsFollowedByUser = userDAO.getThreadsFollowedByUser(user);
} }
catch (SQLException sqle) { catch (SQLException sqle) {
...@@ -52,7 +51,6 @@ public class Following extends HttpServlet { ...@@ -52,7 +51,6 @@ public class Following extends HttpServlet {
out.println("<h1>Threads followed</h1>"); out.println("<h1>Threads followed</h1>");
if (!threadsFollowedByUser.isEmpty()) { if (!threadsFollowedByUser.isEmpty()) {
System.out.println("dans les threads suivis");
for (MyThread t : threadsFollowedByUser) { for (MyThread t : threadsFollowedByUser) {
LocalDate followDate = null; LocalDate followDate = null;
try { try {
......
...@@ -190,15 +190,10 @@ public class UserDAO { ...@@ -190,15 +190,10 @@ public class UserDAO {
ps.setInt(1, user.getId()); ps.setInt(1, user.getId());
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
while(rs.next()){ while(rs.next()){
System.out.println("dans le while");
int threadId = rs.getInt(1); int threadId = rs.getInt(1);
System.out.println("id : " + threadId);
String threadname = threadDAO.getThreadById(threadId).getThreadName(); String threadname = threadDAO.getThreadById(threadId).getThreadName();
System.out.println("name : " + threadname);
threads.add(new MyThread(threadId, threadname)); threads.add(new MyThread(threadId, threadname));
System.out.println("thread ajouté aux suivis");
} }
System.out.println("après le while");
} }
catch (SQLException sqle) { catch (SQLException sqle) {
sqle.getStackTrace(); sqle.getStackTrace();
...@@ -218,7 +213,6 @@ public class UserDAO { ...@@ -218,7 +213,6 @@ public class UserDAO {
ps.setInt(1, user.getId()); ps.setInt(1, user.getId());
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
while(rs.next()){ while(rs.next()){
System.out.println("thread créé : " + rs.getString(2));
int threadId = rs.getInt(1); int threadId = rs.getInt(1);
String threadname = rs.getString(2); String threadname = rs.getString(2);
threads.add(new MyThread(threadId, threadname)); threads.add(new MyThread(threadId, threadname));
...@@ -273,13 +267,9 @@ public class UserDAO { ...@@ -273,13 +267,9 @@ public class UserDAO {
"""); """);
try { try {
ps.setInt(1, user.getId()); ps.setInt(1, user.getId());
System.out.println(user.getId());
ps.setInt(2, thread.getId()); ps.setInt(2, thread.getId());
System.out.println(thread.getId());
System.out.println(ps);
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
while (rs.next()) { while (rs.next()) {
System.out.println("dans le while");
followDate = rs.getDate(1).toLocalDate(); followDate = rs.getDate(1).toLocalDate();
System.out.println(followDate); System.out.println(followDate);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment