1.完成查询
<form action="/s4/news/admin.jsp" method="post">
标题:<input type="text" name="title"/>
<input type="submit" value="查询"/>
</form>
<ul class="classlist">
<%
//接收title
String title=request.getParameter("title");
if(title==null){
title="";//相当于查询全部
}
//破碎重组
title=new String(title.getBytes("iso-8859-1"),"utf-8");
//jdbc连接Oracle查询所有的新闻:id 新闻标题 作者
String CNAME="oracle.jdbc.driver.OracleDriver";
String URL="jdbc:oracle:thin:@localhost:1521:orcl";
//加载驱动
Class.forName(CNAME);
//创建连接
Connection con=DriverManager.getConnection(URL, "scott", "tiger");
//定义sql语句
String sql="select nid,ntitle,nauthor from news280 where ntitle like '%"+title+"%' order by nid desc";
//out.print(sql);
//获得执行对象
PreparedStatement ps=con.prepareStatement(sql);
//获得结果集
ResultSet rs=ps.executeQuery();
//循环遍历
while(rs.ne