Skip to content
Snippets Groups Projects
Commit fbb68636 authored by mjw11's avatar mjw11
Browse files

Change casing on DAO to match table casing

parent ae0270e2
No related branches found
No related tags found
1 merge request!22Merge UC92 into Master
...@@ -73,12 +73,12 @@ public class PatientDAO { ...@@ -73,12 +73,12 @@ public class PatientDAO {
PreparedStatement ps = null; PreparedStatement ps = null;
try { try {
conn = factory.getConnection(); conn = factory.getConnection();
ps = conn.prepareStatement("SELECT registered FROM patients WHERE MID=?"); ps = conn.prepareStatement("SELECT Registered FROM patients WHERE MID=?");
ps.setLong(1, mid); ps.setLong(1, mid);
ResultSet rs; ResultSet rs;
rs = ps.executeQuery(); rs = ps.executeQuery();
if (rs.next()) { if (rs.next()) {
Integer b = rs.getObject("registered") != null ? rs.getInt("registered") : null; Integer b = rs.getObject("Registered") != null ? rs.getInt("Registered") : null;
if (b == 1) { if (b == 1) {
return true; return true;
} else if (b == 0) { } else if (b == 0) {
...@@ -111,7 +111,7 @@ public class PatientDAO { ...@@ -111,7 +111,7 @@ public class PatientDAO {
PreparedStatement ps = null; PreparedStatement ps = null;
try { try {
conn = factory.getConnection(); conn = factory.getConnection();
ps = conn.prepareStatement("UPDATE PATIENTS SET registered = ? WHERE mid = ?"); ps = conn.prepareStatement("UPDATE patients SET Registered = ? WHERE mid = ?");
ps.setByte(1, 1); ps.setByte(1, 1);
ps.setLong(2, mid); ps.setLong(2, mid);
ps.executeUpdate(); ps.executeUpdate();
...@@ -139,7 +139,7 @@ public class PatientDAO { ...@@ -139,7 +139,7 @@ public class PatientDAO {
PreparedStatement ps = null; PreparedStatement ps = null;
try { try {
conn = factory.getConnection(); conn = factory.getConnection();
ps = conn.prepareStatement("UPDATE PATIENTS SET DateofDeactivation = ?, registered = ? WHERE mid = ?"); ps = conn.prepareStatement("UPDATE patients SET DateofDeactivation = ?, Registered = ? WHERE mid = ?");
Date date = new Date(Calendar.getInstance().getTime().getTime()); Date date = new Date(Calendar.getInstance().getTime().getTime());
ps.setDate(1, date); ps.setDate(1, date);
ps.setByte(2, 0); ps.setByte(2, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment