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>jsp数据库删除操作代码

上一篇:python实现tea/xtea/xxtea加密算法


下一篇:linux之sed用法