📄
字号:
001<%@ page errorPage="ErrPage.jsp"
002 import="Java.util.Date, Java.sql.*"
003 contentType="text/html;charset=gb2312"%>
004<JSP:useBean id="pool" scope="application" class="com.PoolBean"/>
005 <!--利用JAVABEAN连接数据库-->
006<%
007String strLoginUser = (String)session.getAttribute("LoginUser");
008if (strLoginUser == null || strLoginUser.length() == 0)
009 response.sendRedirect("Login.jsp");
010%>
011<HTML>
012<HEAD>
013<LINK REL="stylesheet" HREF="littleproject.css" TYPE="text/css">
014<TITLE>记录的分页显示</TITLE>
015</HEAD>
016<BODY bgcolor=LightBlue>
017<%
18try{
019 String meeting_title="";
020 String meeting_touchman="";
021 String meeting_touchtel="";
022 String meeting_touchaddress="";
023 String meeting_remark="";
024 String meeting_touchemail="";
025 String num = request.getParameter("num");
026 if (pool.getConnectionSize() == 0)
027 {
028 pool.initializePool();
029 }
030 Connection con = null;
031 Statement stmt = null;
032 ResultSet rs=null;
033 con = pool.getConnection();
034 stmt= con.createStatement();
035 //建立Statement对象, 并设置记录指标类型为可前后移动
036 String sql=null;
037 //利用For循环配合PageSize属性输出一页中的记录
038 sql="select title,touch_man,touch_tel,touch_address,remark,
039 touch_email from meeting where num="+num;
040 rs = stmt.executeQuery(sql);
041 if(rs.next())
042 {
043 meeting_title=rs.getString("title");
044 meeting_touchman=rs.getString("touch_man");
045 meeting_touchtel=rs.getString("touch_tel");
046 meeting_touchaddress=rs.getString("touch_address");
047 meeting_remark=rs.getString("remark");
048 meeting_touchemail=rs.getString("touch_email");
049 }
050%>
051<center>
052<TABLE border=1 bordercolor=RoyalBlue bgcolor=LightBlue width=700>
053 <tr>
054 <td colspan="2" align="center">
055 <font size="6pt" face="隶书"><%=meeting_title%>简要情况</font>
056 </td>
057 </tr>
058</TABLE>
059<TABLE border=0 width=700>
060 <tr>
061 <td align="center"><%=meeting_remark%></td>
062 </tr>
063 <tr>
064 <td width="700" align="right">
065 <font color="red">联系人:</font><%=meeting_touchman%>
066 </td>
067 </tr>
068 <tr>
069 <td width="700" align="right">
070 <font color="red">通信地址:</font><%=meeting_touchaddress%>
071 </td>
072 </tr>
073 <tr>
074 <td width="700" align="right">
075 <font color="red">联系电话:</font><%=meeting_touchtel%>
076 </td>
077 </tr>
078 <tr>
079 <td width="700" align="right">
080 <font color="red">邮箱地址:</font><%=meeting_touchemail%>
081 </td>
082 </tr>
083</TABLE>
084<%
085boolean join_meeting=false;
086String user_name="";
087if (strLoginUser != null && strLoginUser.length() != 0)
088{
089 sql="select name from user where code ='"+strLoginUser+"'";
090 rs = stmt.executeQuery(sql);
091 if(rs.next())
092 {
093 user_name=rs.getString("name");
094 }
095}
096else
097{
098 response.sendRedirect("Login.jsp");
099}
100sql="select name from meetingperson where num ="+num+" and name='"+user_name+"'";
101rs = stmt.executeQuery(sql);
102if(rs.next())
103{
104 join_meeting=true;
105}
106%>
107<TABLE width=700>
108 <tr>
109 <td align="center">
110<%
111if(join_meeting)
112{
113%>
114 <font color=red><b>我是会议成员</b></font>
115
116 <a href="checkout_meeting.jsp?num=<%=num%>&title=<%=meeting_title%>">
117 我退出会议</a>
118<%
119}
120else
121{
122%>
123 <a href="checkin_meeting.jsp?num=<%=num%>&title=<%=meeting_title%>">
124 我要参加会议</a>
125
126 <font color=red><b>我还没有参加此会议</b></font>
127<%
128}
129%>
130
131 <a href="default.jsp">返回首页</a>
132 </td>
133 </tr>
134</TABLE>
135</CENTER>
136<%
137 if (rs != null) rs.close();
138 pool.releaseConnection(con);
139}
140catch(Exception e)
141{
142 System.out.println("Exception: " + e.getMessage());
143}
144%>
145</BODY>
146</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -