我的页面源代码如下,请各位帮我加一个分页显示和奇偶数行不通颜色显示我不能实现谢谢
<%@ include file="head.jsp"%>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="java.util.Date"%>
<jsp:useBean id="workM" scope="page" class="Show.DBconn" />
<%!
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("gb2312");
String temp=new String(temp_t,"ISO8859-1");
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%
String key=request.getParameter("keyword");
key=getStr(key);
%>
<html>
<head>
<LINK href="mycss.css" rel=stylesheet type=text/css>
<title>Untitled</title>
</head>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=1000 align="center">
<TBODY>
<tr><td align="left" height=25> 当前位置:查询投诉情况 -> <a href="http://localhost:8080/examples/jsp/INDEX.JSP">首页</a> </td>
</tr>
</TBODY></TABLE>
<table align="center" border="0" width="640" cellspacing="0" cellpadding="0" height="355">
<tr>
<td width="5" height="100%"></td>
<td width="1" height="100%" bgcolor="#3399ff"></td>
<td width="10" height="100%"></td>
<td width="600" height="331" valign="top" background="images/bg1.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" width="100%" height="20" bgcolor="#3399ff"> <font color="#ffffff">站内搜索 -> 关键字:<b><font color="Red"><%=key%></font></b></font>
<a href="http://localhost:8080/examples/jsp/INDEX.JSP">返 回</a></td>
</tr>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" height="20" bgcolor="#3399ff"><font color="Red">投诉类别</font>
</td>
<td width="15%" height="20" bgcolor="#3399ff"> <font color="Red">投诉时间</font>
</td>
<td width="15%" height="20" bgcolor="#3399ff"><font color="Red">投诉部门</font>
</td>
<td width="10%" height="20" bgcolor="#3399ff"> <font color="Red">处理情况</font>
</td>
<td width="10%" height="20" bgcolor="#3399ff"> <font color="Red">处理人</font>
</td>
<td width="10%" height="20" bgcolor="#3399ff"> <font color="Red">详情</font>
</td>
</tr>
<ul>
<%
String keyword,way,keyword1;
//java.util.Date start_date,end_date;
String strSQL;
keyword=request.getParameter("keyword");
keyword1=request.getParameter("keyword1");
//keyword=(keyword);
//keyword1=(keyword1);
way=request.getParameter("way");
strSQL="";
//////////////投诉类别********************
if(way.trim().equals("1")){
strSQL="SELECT * FROM data where";
strSQL=strSQL+" tousu_class = '"+keyword+"' order by tousu_date desc";
}
//////////////投宿部门********************
if(way.trim().equals("2")){
strSQL="SELECT * FROM data where";
strSQL=strSQL+" depart like '%"+keyword+"%' order by tousu_date desc";
}
//////////////投宿时间********************
if(way.trim().equals("3")){
strSQL="SELECT * FROM data where";
strSQL=strSQL+" tousu_date between #"+keyword+"# and #"+keyword1+"# order by tousu_date desc" ;
}
//////////////处理情况********************
if(way.trim().equals("4")){
strSQL="SELECT * FROM data where";
strSQL=strSQL+" handle like '%"+keyword+"%' order by tousu_date desc";
}
//////////////处理人********************
if(way.trim().equals("5")){
strSQL="SELECT * FROM data where";
strSQL=strSQL+" person like '%"+keyword+"%' order by tousu_date desc";
}
//////////////投宿情况描述********************
if(way.trim().equals("6")){
strSQL="SELECT * FROM data where";
strSQL=strSQL+" details like '%"+keyword+"%' order by tousu_date desc";
}
//out.println("strSQL");
// out.println("<ul>");
ResultSet RSa = workM.executeQuery(strSQL);
int searchnum;
searchnum=0;
while (RSa.next()) {
String tousu_class,depart,handle,details,person,tousu_date;
//java.util.Date tousu_date;
int id;
id=RSa.getInt("id");
tousu_class=getStr(RSa.getString("tousu_class"));
tousu_date=getStr(RSa.getString("tousu_date"));
//tousu_date=RSa.getDate("tousu_date");;
depart=getStr(RSa.getString("depart"));
handle=getStr(RSa.getString("handle"));
details=getStr(RSa.getString("details"));
//details=details.substring(2,10);
person=getStr(RSa.getString("person"));
out.println("<td> "+tousu_class+" </td>");
out.println("<td> "+tousu_date.substring(0,10)+" </td>");
out.println("<td> "+depart+" </td>");
out.println("<td> "+handle+" </td>");
out.println("<td> "+person+" </td>");
//out.println("<td> "+details+" </td>");
out.println("<td><a href=javascript:show('data.jsp?id="+id+"','详细资料',800,600)>详情</a></td>");
out.println("</tr>");
searchnum=searchnum+1;
}
//sout.println("strSQL");
RSa.close();
out.println("</ul>");
out.println("共搜索到<b><font color=Red>"+searchnum+"</font></b>条纪录");
%>
<script language="javascript">
function show(mylink,mytitle,width,height){
mailwin=window.open(mylink,mytitle,'top=60,left=50,width='+width+',height='+height+',scrollbars=yes');
}
</script>
</td>
<td width="1%"></td>
</tr>
</table>
</td>
</tr>
</table>
<%@ include file="footer.inc"%>
</html>
问题点数:0、回复次数:2Top
1 楼AllError(错误大全)回复于 2003-04-03 13:08:32 得分 0
开玩笑吧!工作可不小...
自己搞定吧....Top
2 楼AllError(错误大全)回复于 2003-04-03 13:10:42 得分 0
提示:
翻页的sql
select one,two,three from(select rownum as row_num ,one,two,three from table )where row_num between start_page to end_page.
数据库 oracleTop
相关问题
- 求Asp.NetPage控件分页的源代码
- 高分求分页源代码!(200分)
- 求Listview控件分页显示程序的源代码。
- 请告诉我一个类似百度的分页的源代码
- 还是老问题——有关记录集分页的,帮忙看看源代码,我实在找不出错误!!
- 小弟求一份关于struts的分页显示源代码,最好是mysql的!有分贡上。。。。。。谢了
- === 征集PHP下各种数据库的分页"方案"及"源代码"! 谢谢各位支持 ===
- datalist 的分页问题大家是怎么解决的阿,能有人给出源代码么,(VB)
- 源代码!源代码!
- 谁有36397发的(汤母猫5数据库连接池 + JavaBean + 分页技术 + JDBC3.0 + 大型数据库 )源代码,给发个!!




