Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
kecheng1.jsp
Package: JSP02.rar [view]
Upload User: top0756
Upload Date: 2022-08-11
Package Size: 6501k
Code Size: 4k
Category:
Jsp/Servlet
Development Platform:
VBScript
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*" %>
- <%@ page language="java" %>
- <%@ page import="java.util.*" %>
- <%@ page import="proj112.*" %>
- <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
- <html>
- <head>
- <style type="TEXT/CSS">
- A:LINK{COLOR:blue;FONT-SIZE:11PT;TEXT-DECORATION:NONE}
- A:VISITED{COLOR:blue;FONT-SIZE:11PT;TEXT-DECORATION:NONE}
- A:HOVER{COLOR:red;FONT-SIZE:11PT;TEXT-DECORATION:UNDERLINE}</STYLE>
- <title>
- kecheng1
- </title>
- </head>
- <body bgcolor="#ffffff"><br>
- 姓名: <font color="#0033FF"><%=session.getAttribute("stu_name") %> </font> 学号: <font color="#0033FF"><%=session.getAttribute("id") %></font><br>
- <hr><br>
- <%
- int PageSize = 6;
- int Page = 1;
- int totalPage = 1;
- int totalrecord = 0;
- String id = "";
- String sql = null;
- ResultSet rs = null;
- //算出总行数
- sql = "SELECT count(*) as recordcount FROM kecheng";
- rs = a.executeQuery(sql);
- if (rs.next()) totalrecord = rs.getInt("recordcount");
- //输出记录
- sql = "SELECT * FROM kecheng";
- rs = a.executeQuery(sql);
- %>
- <form action="kecheng2.jsp" method="POST" name="form3">
- <p align="center">
- <table width="100%" cellspacing="0" cellpadding="4" rules="all" bordercolor="#CC9966" border="1" id="dg_rxkb" style="background-color:White;border-color:#CC9966;border-width:1px;border-style:None;width:100%;border-collapse:collapse;">
- <tr align=middle>
- <td colspan="7" bgcolor="#9dcaf4"><font color="red">所有课程信息</font></td>
- </tr>
- <tr>
- <td align="center"><font color="#6633CC">选课</font></td>
- <td align="center"><font color="#6633CC">课程号</font></td>
- <td align="center"><font color="#6633CC">课程名</font></td>
- <td align="center"><font color="#6633CC">任课教师</font></td>
- <td align="center"><font color="#6633CC">星期几</font></td>
- <td align="center"><font color="#6633CC">时间</font></td>
- <td align="center"><font color="#6633CC">上课教室</font></td>
- </tr>
- <%
- if(totalrecord % PageSize ==0)// 如果是当前页码的整数倍
- totalPage = totalrecord / PageSize;
- else // 如果最后还空余一页
- totalPage = (int) Math.floor( totalrecord / PageSize ) + 1;
- if(totalPage == 0) totalPage = 1;
- if(request.getParameter("Page")==null || request.getParameter("Page").equals(""))
- Page = 1;
- else
- try {
- Page = Integer.parseInt(request.getParameter("Page"));
- }
- catch(java.lang.NumberFormatException e){
- // 捕获用户从浏览器地址拦直接输入Page=sdfsdfsdf所造成的异常
- Page = 1;
- }
- if(Page < 1) Page = 1;
- if(Page > totalPage) Page = totalPage;
- rs.absolute((Page-1) * PageSize + 1); %>
- <%
- for(int iPage=1; iPage<=PageSize; iPage++) { %>
- <div align="right"></div> </td>
- </tr>
- <tr>
- <td align="center"><a href="kecheng2.jsp?id2=<%=rs.getString(1)%>" >添加</a></td>
- <td align="center"><%=rs.getString(1)%></td>
- <td align="center"><%=rs.getString(2)%></td>
- <td align="center"><%=rs.getString(3)%></td>
- <td align="center"><%=rs.getString(4)%></td>
- <td align="center"><%=rs.getString(5)%></td>
- <td align="center"><%=rs.getString(6)%></td>
- </tr>
- <% if(!rs.next()) break;
- }
- %>
- </table>
- </form>
- <FORM Action="kecheng1.jsp" Method="GET">
- <%
- if(Page != 1) {
- out.print(" <A HREF=kecheng1.jsp?Page=1> 第一页 </A>");
- out.print(" <A HREF=kecheng1.jsp?Page=" + (Page-1) + "> 上一页 </A>");
- }
- if(Page != totalPage) {
- out.print(" <A HREF=kecheng1.jsp?Page=" + (Page+1) + "> 下一页 </A>");
- out.print(" <A HREF=kecheng1.jsp?Page=" + totalPage + "> 最后一页 </A>");
- }
- %>
- 输入页数:<input TYPE="TEXT" Name="Page" SIZE="3">
- 页数:<font COLOR="Red"><%=Page%>/<%=totalPage%></font>
- <INPUT TYPE="submit" value="提交">
- </FORM>
- </body>
- </html>