I have the above js and JSP code, I want to invoke procedureCall() while clicking on ok button on confirm window poopup (inside "if" statement). Is it possible and if yes, how it can be done?
<script type="text/javascript">
function confirmDelete() {
var answer = confirm("Are you sure you want to delete");
if (answer == true) {
return true;
} else {
return false;
}
}
</script>
JSP piece:
<%! public void procedureCall(int cId) {
String procedureCall = "{call NEW_PORTING_PRC.delete_album_metadata(cId)}";
try (CallableStatement cal = conn.prepareCall(procedureCall);) {
} catch (Exception e) {
e.printStackTrace();
}
%>