Skip to content

Commit

Permalink
DAOCondition v.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewaaa committed Dec 27, 2023
1 parent 21e029a commit 8eba4fe
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package model.DAO;

import model.entity.Condition;
import model.entity.User;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class DAODisease {
public class DAOCondition {

private Condition getConditionFromResultSet(ResultSet resultSet) throws SQLException {
Condition condition = new Condition();

condition.setIdCondition(resultSet.getInt("ID"));
condition.setDisorderName(resultSet.getString("Name_Disorder")); //probabilmente nomi attrivuti sbagliati
condition.setDisorderDescription(resultSet.getString("Disorder_Description")); //probabilmente nomi attrivuti sbagliati
condition.setIdCondition(resultSet.getInt("ID_condition"));
condition.setDisorderName(resultSet.getString("DisorderName "));
condition.setDisorderDescription(resultSet.getString("DisorderDescription "));
return condition;
}

Expand All @@ -29,7 +28,7 @@ public Condition getConditionByID(int id) {
connection = DAOConnection.getConnection();
String query = null;

query = "SELECT * FROM condition WHERE ID = ?";
query = "SELECT * FROM condition WHERE ID_condition = ?";


preparedStatement = connection.prepareStatement(query);
Expand All @@ -56,5 +55,4 @@ public Condition getConditionByID(int id) {
}
return null; // or you may throw an exception here
}

}

0 comments on commit 8eba4fe

Please sign in to comment.