showvote.jsp
上传用户:xjrzjk
上传日期:2022-07-31
资源大小:1585k
文件大小:2k
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*"%>
- <%@ page import="javax.sql.*"%>
- <%
- try{
- //数据库连接
- Class.forName("oracle.jdbc.driver.OracleDriver");
- String strUrl = "jdbc:oracle:thin:@slight:1521:LOCAL";
- String strUser = "eshop";
- String strPassword = "eshop";
- Connection con = DriverManager.getConnection(strUrl, strUser, strPassword);
- Statement st = con.createStatement();
- String sql = "select * from type";
- ResultSet rs = st.executeQuery(sql);
- %>
- <html>
- <head>
- <title>
- showvote
- </title>
- </head>
- <body bgcolor="#ffffff">
- <table width="100%" border="0" cellspacing="1" cellpadding="2">
- <tr>
- <td class="text1">
- <p align="left">
- <%
- if (rs.next()) out.println(rs.getString("type"));
- %>
- </td>
- </tr>
- <tr>
- <%
- rs.close();
- sql = "select id,note from vote order by id";
- rs = st.executeQuery(sql);
- %>
- <td class="text1">
- <form method="post" action="vote.jsp" target="_Blank">
- <p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
- <% while (rs.next()){
- %>
- <input type="radio" name="rb" value="<%=rs.getLong("id")%>">
- <%=rs.getString("note")%> </p>
- <p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
- <% }
- %>
- <br>
- <input type="submit" name="submit" value="提交" style=" BACKGROUND-COLOR: #cccccc" disabled>
- <input type="button" onClick="window.open('admin/votedetail.jsp')" value="查看" style=" BACKGROUND-COLOR: #cccccc" disabled>
- </p>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- }catch(Exception e){
- e.printStackTrace();
- }
- %>