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

📄 newsdelete.jsp

📁 基于JSP的公交查询系统,很好用的,适于学习,操作语句全在jsp页面里
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>删除新闻信息</title>
<style type="text/css">
<!--
body {
	background-image: url(../Picture/index-top_2.gif);
	margin-left: 100px;
}
.STYLE1 {
	font-size: 16px;
	font-weight: bold;
}
.STYLE2 {font-size: 16px; font-weight: bold; color: #0000CC; }
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #FF0000;
}
-->
</style></head>

<body>
<%  String title[]=new String[100];
    String newstype[]=new String[100];
    int type;
 
	int i=0;
    Connection con;
    String statement="";
	ResultSet result;
	
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	     }
		catch(ClassNotFoundException e){}
		 
	try{  
	      con=DriverManager.getConnection("jdbc:odbc:nbos","","");
	      Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); 
		  statement="select * from News order by NewsID DESC";
            // out.println("dsaf");
		  result=sql.executeQuery(statement);
              //  out.println("a");
		  while(result.next())
		     { 
               title[i]=result.getString("Title");
			   type=result.getInt("Type");
			   if(type==1)
                   newstype[i]="新闻快递";
                  else
                     newstype[i]="最新公告";       
			      i++;
                   //out.println(i);
			  }  
		    
		 %>
<table width="519" height="91" border="1">
  <tr>
    <td height="19" colspan="4" background="../Picture/topbg.gif" class="STYLE1"><div align="center">删除新闻信息</div></td>
  </tr>
  <tr>
    <td width="54" height="20" background="../Picture/l33.gif"><div align="center" class="STYLE1">编号</div></td>
    <td width="226" background="../Picture/l33.gif"><div align="center"><span class="STYLE1">要删除的新闻标题</span></div></td>
    <td width="92" background="../Picture/l33.gif"><div align="center"><span class="STYLE1">类型</span></div></td>
    <td width="119" background="../Picture/l33.gif"><div align="center"><strong class="STYLE1">是否删除</strong></div></td>
  </tr>
  
  <% for(int k=0;k<i;k++)
     { %>
	 <tr>
    <td height="22" background="../Picture/l33.gif"><div align="center"><%=k+1%></div></td>
    <td height="22" background="../Picture/l33.gif"><div align="center"><a href="../newscontent.jsp?title=<%=title[k]%>" target="blank"><%=title[k]%></a></div></td>
    <td height="22" background="../Picture/l33.gif"><div align="center"><%=newstype[k]%></div></td>
    <td height="22" background="../Picture/l33.gif"><div align="center" class="STYLE2"><a href="newsdeleteresult.jsp?title=<%=title[k]%>">删除</a></div></td>
  </tr><% }  %>
  <tr>
    <td height="17" colspan="4" background="../Picture/bottombg.gif">&nbsp;</td>
  </tr>
</table>
     <% result.close();
	  } catch(Exception e) {  }
	  %> 
</body>
</html>

⌨️ 快捷键说明

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