-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.jsp
33 lines (26 loc) · 1.06 KB
/
delete.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<%@page import="javax.swing.JOptionPane"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<%@ include file="head.jsp" %>
<body class="container my-3">
<%
String no_rekening = request.getParameter("d");
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://localhost:3306/koperasi";
Connection conn = DriverManager.getConnection(url, "root", "");
Statement statement = conn.createStatement();
statement.executeUpdate("DELETE FROM nasabah WHERE no_rekening='"+no_rekening+"'");
response.sendRedirect("index.jsp");
} catch (Exception e) {
e.printStackTrace();
}
%>
</body>
</html>