⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 booksdelete.jsp

📁 jsp图书管理系统
💻 JSP
字号:
<%@ page contentType = "text/html; charset =GBK" %>
<%@ page language = "java" import = "java.sql.*" %>

  <%   
          request.setCharacterEncoding("GBK");   
          response.setCharacterEncoding("GBK");   
  %>   

<html>

<head>

<title>Delete books</title>
</head>

<body>

<table border="0" width="1035" id="table1" height="345">
	<tr>
		<td width="238" rowspan="2">
		<img border="0" src="../images/Snap1.jpg" width="238" height="78"> </td>
		<td width="652" height="59" colspan="5"></td>
		<td width="130" height="59">
      <TABLE cellSpacing=0 cellPadding=3 border=0 valign="top" id="table2" width="6">
        <TBODY>
        <TR>
          <TD class=globalLinks vAlign=center noWrap align=right>
            &nbsp; </TD></TR></TBODY></TABLE>
		</td>
	</tr>
	<tr>
		<td width="159" height="27"></td>
		<td width="75" height="27" align="center" bgcolor="#008080"></td>
		<td width="95" height="27" align="center" bgcolor="#C0C0C0"></td>
		<td width="86" height="27" align="center" bgcolor="#C0C0C0"></td>
		<td width="221" height="27"></td>
		<td width="130" height="27"></td>
	</tr>
	<tr>
		<td width="1025" colspan="7" height="32" align="center" bgcolor="#008080"></td>
	</tr>
	<tr>
		<td width="1025" colspan="7" height="67"></td>
	</tr>
	<tr>
		<td width="1025" colspan="7">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 id="table5">
  <TBODY>
  <TR height=30><TD bgColor=#eeeecc><b><font face="华文隶书" size="6">B</font></b><font face="华文隶书" size="6"><b>ook 
	Delete Result:</b></font></TD></TR></TBODY></TABLE></td>
	</tr>
	<tr>
		<td width="1025" colspan="7" align="center"><CENTER>
	<TABLE align=middle class=tableBackground border=0 id="table6" width="793">
  <TBODY>
  <TR>
    <TD>
	<p align="center">
   </TD></TR>
  <TR>
  
     <TD vAlign=center align=middle height="57">
<%
	String n1 = request.getParameter("bookID");

	out.println(" DELETE "+"<BR>");

	out.println("Book ID     : "+n1+"<BR>");

   %>

   
   <%
	String mySqlDriver = "com.mysql.jdbc.Driver";
	String url ="jdbc:mysql://localhost:3306/library?user=root&password=123456&useUnicode=true&characterEncoding=gbk";
	Connection conn;

	try{
	Class.forName(mySqlDriver);
	}
	catch(Exception e){
	out.println("Driver Error");
	}

	conn = DriverManager.getConnection(url);
	if(conn==null){
	out.println("get Conn erroe");
	}
	
	Statement stm = conn.createStatement();
	int re = 0;


try{
	re = stm.executeUpdate("DELETE FROM books WHERE bookID = '"+n1+"'");
	}
	  catch(Exception e)
{




  
 

        out.println("<tr vAlign=center align=middle  bgcolor = #ffff00> <TD Align=center align=middle>ERROR!</TD>");

}

    
	if(re ==0) out.println("<tr vAlign=center align=middle  bgcolor = #ffff00> <TD Align=center align=middle> The successful line:"+re+"</TD>");
	else {
	      out.println("<tr vAlign=center align=middle bgcolor = #00ff00> <TD Align=center align=middle>DELETE BOOK SUCCESS!</TD>");
		  out.println("<tr vAlign=center align=middle bgcolor = #00ff00> <TD Align=center align=middle> The successful line:"+re+"</TD>");
  }


	
%>
	</tr>



<%

stm.close();
conn.close();

%>	
   
</TABLE></CENTER><table><td>
		<p></td>
		</tr>
	<tr>
		<td width="1025" colspan="7" align="center"> <font face="Courier New">
		<a href="books.htm">GO BACK BOOK OPERATE AGAIN</a></font><p>Library</td>
		</tr>
	<tr>
		<td width="1025" colspan="7" align="center"></td>
		</tr>
	<tr>
		<td width="1025" colspan="7" align="center"><FONT size=1>&copy; 2007.5-2007.6 142042 All rights 
      reserved.</FONT></td>
		</tr>
</table>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -