dependencie error popup corrections

table reload after deleting corrections
This commit is contained in:
Lukas Heiligenbrunner 2020-04-24 15:32:33 +02:00
parent a71c1a09a6
commit af9d5662b1
2 changed files with 6 additions and 8 deletions

View File

@ -168,17 +168,15 @@ public class JDBC {
*/ */
public int executeUpdate(String sql) throws SQLException { public int executeUpdate(String sql) throws SQLException {
try { try {
conn.isValid(5); conn.isValid(2);
PreparedStatement stmt = conn.prepareStatement(sql); PreparedStatement stmt = conn.prepareStatement(sql);
return stmt.executeUpdate(); return stmt.executeUpdate();
} catch (SQLNonTransientConnectionException ee) { } catch (SQLNonTransientConnectionException ee) {
if (logintodb(usernamec, passwordc, dbnamec, ipc, portc)) { if (logintodb(usernamec, passwordc, dbnamec, ipc, portc)) {
return this.executeUpdate(sql); return this.executeUpdate(sql);
} else { } else {
throw new SQLException(); throw new SQLNonTransientConnectionException();
} }
} catch (SQLException e) {
throw new SQLException();
} }
} }

View File

@ -269,7 +269,7 @@ class Dashboard {
} }
$(".delbtn").click(function (event) { $(".delbtn").click(function (event) {
var id = event.target.getAttribute("dataid"); const id = event.target.getAttribute("dataid");
console.log("clicked btn data " + id); console.log("clicked btn data " + id);
$.post('/senddata/wastedata', 'action=deletecity&id=' + id, function (data) { $.post('/senddata/wastedata', 'action=deletecity&id=' + id, function (data) {
console.log(data); console.log(data);
@ -283,12 +283,12 @@ class Dashboard {
console.log('Popup closed. ') console.log('Popup closed. ')
}); });
reloadtable(); _this.reloadtable();
} else if (data.status === "dependenciesnotdeleted") { } else if (data.status === "dependenciesnotdeleted") {
Swal.fire({ Swal.fire({
icon: "warning", icon: "warning",
title: 'This city is a dependency of a date', title: 'This city is a dependency of a date',
html: 'Do you want do delete it anyway with all dependencies?', html: 'Please delete all dependencies first!',
}).then((result) => { }).then((result) => {
console.log('Popup closed. ') console.log('Popup closed. ')
@ -353,7 +353,7 @@ class Dashboard {
console.log('Popup closed. ') console.log('Popup closed. ')
}); });
reloadDateTable(); _this.reloadDateTable();
} else if (data.status == "dependenciesnotdeleted") { } else if (data.status == "dependenciesnotdeleted") {
Swal.fire({ Swal.fire({
icon: "warning", icon: "warning",