| @@ -1,5 +1,6 @@ | |||||
| package de.uniluebeck.mi.projmi6.db; | package de.uniluebeck.mi.projmi6.db; | ||||
| import de.uniluebeck.mi.projmi6.model.Fall; | |||||
| import de.uniluebeck.mi.projmi6.model.Patient; | import de.uniluebeck.mi.projmi6.model.Patient; | ||||
| import de.uniluebeck.mi.projmi6.model.Station; | import de.uniluebeck.mi.projmi6.model.Station; | ||||
| @@ -21,6 +22,7 @@ public class DBHandler { | |||||
| "`Geburtsdatum`=?, `Geburtsname`=?, `Geschlecht`=?, `KassenID`=?, `LetzterBearbeiter`=?, `Nachname`=?, " + | "`Geburtsdatum`=?, `Geburtsname`=?, `Geschlecht`=?, `KassenID`=?, `LetzterBearbeiter`=?, `Nachname`=?, " + | ||||
| "`Ort`=?, `PLZ`=?, `Strasse`=?, `Telefon`=?, `Versichertennummer`=?, `Vorname`=? WHERE `ID`=?"; | "`Ort`=?, `PLZ`=?, `Strasse`=?, `Telefon`=?, `Versichertennummer`=?, `Vorname`=? WHERE `ID`=?"; | ||||
| private static final String SELECT_ALL_STATIONEN = "SELECT * FROM `stammstation`"; | private static final String SELECT_ALL_STATIONEN = "SELECT * FROM `stammstation`"; | ||||
| private static final String SELECT_ALL_FAELLE = "SELECT * FROM `fall`"; | |||||
| public static List<Patient> getAllPatients() throws SQLException { | public static List<Patient> getAllPatients() throws SQLException { | ||||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | Statement statement = MySqlConnFactory.getConnection().createStatement(); | ||||
| @@ -93,5 +95,25 @@ public class DBHandler { | |||||
| return station; | return station; | ||||
| } | } | ||||
| public static List<Fall> getAllFaelle() throws SQLException { | |||||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | |||||
| ResultSet rs = statement.executeQuery(SELECT_ALL_FAELLE); | |||||
| List<Fall> faelle = new ArrayList<>(); | |||||
| while (rs.next()) { | |||||
| faelle.add(getFall(rs)); | |||||
| } | |||||
| return faelle; | |||||
| } | |||||
| private static Fall getFall(ResultSet rs) { | |||||
| Fall fall = new Fall(); | |||||
| fall.set | |||||
| return fall; | |||||
| } | |||||
| } | } | ||||