Skip to content
Snippets Groups Projects
Commit 69ab6c5a authored by Maxime Gosselin's avatar Maxime Gosselin
Browse files

Ajout de la methode isCreatorOf dans DaoThread

parent 2e4581f4
No related branches found
No related tags found
No related merge requests found
...@@ -113,4 +113,17 @@ public class DaoThread { ...@@ -113,4 +113,17 @@ public class DaoThread {
} }
return res; return res;
} }
public boolean isCreatorOf(String creator, int idThread){
DS bdd = DS.getInstance();
try(Connection con = bdd.getConnection()) {
PreparedStatement ps = con.prepareStatement("SELECT * FROM threads WHERE id_thread = ? AND creator = ?");
ps.setInt(1, idThread);
ps.setString(2, creator);
ResultSet rs = ps.executeQuery();
return rs.next();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment