Skip to content
Snippets Groups Projects
Commit 6d1d3f60 authored by Yannis Devos's avatar Yannis Devos
Browse files

Correction probleme d'import avec Thread

parent 181ea2d3
Branches
No related tags found
No related merge requests found
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
......@@ -2,6 +2,7 @@ package dao;
import dto.Message;
import dto.User;
import dto.MyThread;
import java.sql.*;
import java.util.ArrayList;
......@@ -35,15 +36,15 @@ public class ThreadDAO {
return messages;
}
public Thread getThreadById(int threadID) throws SQLException {
Thread thread = new Thread();
public MyThread getThreadById(int threadID) throws SQLException {
MyThread thread = new MyThread(0, null);
PreparedStatement ps = this.con.prepareStatement("SELECT threadID, threadName FROM thread WHERE threadID = ?");
try {
ps.setInt(1, threadID);
ResultSet rs = ps.executeQuery();
if(rs.next()){
thread.setThreadID(rs.getInt(1));
thread.setName(rs.getString(2));
thread.setThreadName(rs.getString(2));
}
}
catch (SQLException sqle) {
......
package dto;
public class Thread {
public class MyThread {
private int threadID;
private String threadName;
// Constructor //
public Thread(int id, String name){
public MyThread(int id, String name){
this.threadID = id;
this.threadName = name;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment