数据库
首页 > 数据库> > jsp数据库删除操作代码

jsp数据库删除操作代码

作者:互联网

<%@page import="com.shxt.util.DBUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
    String tea_id =request.getParameter("tea_id");
    String sql ="delete from teacher where tea_id=?";
    int num =DBUtil.executeUpdate(sql,tea_id);
    if(num>0){
        System.out.print("删除成功");
        response.sendRedirect("index.jsp");
    }else{
        System.out.print("删除失败");
    }
%>
</body>
</html>

标签:String,删除,tea,数据库,System,num,jsp,id,out
来源: https://blog.csdn.net/qq_24091613/article/details/118630561