?? delete_do.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>刪除</title>
</head>
<body>
<%
String className="com.microsoft.sqlserver.jdbc.SQLServerDriver";
String url="jdbc:sqlserver://localhost:1433;DatabaseName = scm";
String user="sa";
String password="000000";
String id=request.getParameter("id");
try{
Class.forName(className);
Connection con=DriverManager.getConnection(url,user,password);
Statement stat=con.createStatement();
String sql="delete from t_order where id='"+id+"'";
stat.executeUpdate(sql);
sql="delete from t_orderitem where id='"+id+"'";
stat.executeUpdate(sql);
response.sendRedirect("db.jsp");
stat.close();
con.close();
}
catch(ClassNotFoundException e)
{out.println(e.toString());}
catch(SQLException e)
{out.println(e.toString());}
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -