100分,求JSP查询数据库并显示结果的程序
1、页面有个能输入查询条件的输入框
2、按下search button后,去数据库查询
3、将结果以表格形式显示
希望各位高手给个可运行的程序,程序运行成功立即结贴给分。
------解决方案--------------------我写的是网上图书销售:
你看看是不是符合你的要求:structs写的:用的是SQL2000
<%@ page contentType= "text/html;charset=gbk "%>
<%@ taglib uri= "struts/html " prefix= "html " %>
<%@ taglib uri= "struts/bean " prefix= "bean " %>
<%@ taglib uri= "struts/logic " prefix= "logic " %>
<%@ page import= "java.util.*,com.ts.* "%>
<title> <bean:message key= "title "/> </title>
<table align=center >
<tr>
<td colspan=2 align= "center "> <h2> 欢迎加入EO购书站 </h2> </td>
</tr>
<tr>
<%int j=1;%>
<logic:iterate name= "pagelist " type= "com.ts.BookVO " scope= "request " id= "book ">
<%
++j;
if(j%2==0)
{
%>
</tr>
<tr>
<% }%>
<td>
<table width= "320 " align=center>
<tr >
<td rowspan=7 width= "120 ">
<a href=bookBig.do?id= <bean:write name= "book " property= "id "/> >
<img src=images/ <bean:write name= "book " property= "photo "/> width= "120 " height= "120 ">
</a>
</td>
<td>
</td>
</tr>
<tr >
<td>
图书名: <bean:write name= "book " property= "bookname "/>
</td>
</tr>
<tr>
<td>
作者: <bean:write name= "book " property= "master "/>
</td>
</tr>
<tr>
<td>
价格: <bean:write name= "book " property= "prise "/>
</td>
</tr>
<tr>
<td>
<a href=addSuccess.jsp> 购买: </a>
</td>
</tr>
<tr>
<td>
<a href=bookUpdate.do?id= <bean:write name= "book " property= "id "/> > 修改: </a>
</td>
</tr>
<tr>
<td>
<a href=bookDel.do?id= <bean:write name= "book " property= "id "/> > 删除: </a>
</td>
</tr>
<tr>
简介: <bean:write name= "book " property= "domo "/>
</tr>
</table>
</td>
</logic:iterate>
<script language= "JavaScript " type= "text/JavaScript ">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+ ".location= ' "+selObj.options[selObj.selectedIndex].value+ " ' ");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<tr> <td colspan=9>
<a href= 'bookList.do?currentpage=1 '> 首页 </a>
<%