Skip to content

Commit

Permalink
Merge pull request #611 from nihaomahenhaoba/master
Browse files Browse the repository at this point in the history
#6 #7 提交实验代码 #397
  • Loading branch information
zengsn authored Dec 1, 2016
2 parents 2cc7e85 + 3ee0070 commit f1317fb
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
11 changes: 10 additions & 1 deletion jweb/web/1414080902216/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
Expand Down Expand Up @@ -33,12 +34,20 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
</style>
</head>
<body>
<%
request.setAttribute("plan","12.01罗浮山班游");
%>
<div class="all">
<h2 align="center">聚会添加系统</h2>
<img src="juhui.jpg" alt="" width="100%"><br/><br/>
<div class="row">
<div class="col-xs-6 text"><button class="btn-info"><a href="1414080902216">添加聚会记录</a></button></div>
<div class="col-xs-6 text"><button class="btn-info"><a href="">查看聚会记录</a></button></div>
<ul>
<c:if test="${!empty plan}">
<li><c:out value="${plan}"/></li>
</c:if>
</ul>
</div>
</div>
</body>
Expand Down
47 changes: 47 additions & 0 deletions jweb/web/1414080902216/jilu.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<title>聚会记录</title>
</head>
<body>
<%
String driveName = "com.mysql.jdbc.Drive";
String userName = "root";
String userPwd = "123456";
String dbName = "meet";
String url1 = "jdbc:mysql://localhost:3306/meet";
String url2 = "?user=root&password=123456";
String url3 = "&useUnicode=true&characterEncoding=UTF-8";
String url = url1+url2+url3;
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(url);
String sql = "select *from meets";
PreparedStatement p = conn.prepareStatement(sql);
ResultSet r = p.executeQuery();
r.last();
%>
<p size="3" color="black" align="center">您现在的聚会有<%=r.getRow() %>个</p>
<table border="1" bgcolor="ccceee" width="500" align="center">
<tr bgcolor="CCCCCC" align="center">
<td>聚会</td><td>聚会时间</td><td>开始时间</td>
</tr>
<%r.beforeFirst();
while(r.next()){
%><tr align="center">
<td><%=r.getString("miid") %></td>
<td><%=r.getString("malltime") %></td>
<td><%=r.getString("mstarttime") %></td>
</tr>
<%} %>
</table>
<%if(r!=null){r.close();}
if(p!=null){p.close();}
if(conn!=null){conn.close();}
%>
</body>
</html>

0 comments on commit f1317fb

Please sign in to comment.