Commit 79aa8098 by Jose Baez

Correccion filtro por aceptados

parent 028b969a
...@@ -73,32 +73,19 @@ import java.util.List; ...@@ -73,32 +73,19 @@ import java.util.List;
} }
public static void update(int id, String valor) { public static void update(int id, String valor) {
String v = valor; boolean v = valor.equals("0") ? false : true;
if (v == "1") {
try { try {
Connection con = DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps = con.prepareStatement("update postulante set aceptado= false " + PreparedStatement ps = con.prepareStatement("update postulante set aceptado= ? where id=?");
"where id=?"); ps.setBoolean(1, v);
ps.setInt(1, id); ps.setInt(2, id);
ps.executeUpdate(); ps.executeUpdate();
con.close(); con.close();
} }
catch (Exception ex) { catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
} else {
try {
Connection con = DataBase.getConnection();
PreparedStatement ps = con.prepareStatement("update postulante set aceptado= true " +
" where id=?");
ps.setInt(1, id);
ps.executeUpdate();
con.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment