代码都贴出来拉。。就是为什么不循环呀?
每次都是就显示一个投票结果。。。。
是那的问题???第一回做。。。
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page language="java" import="java.sql.*"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>投票结果</title>
<% out.println("jsptoupiao");
try
{
Connection con=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:music","sa","");
PreparedStatement s= con.prepareStatement("select * from music where nume>0 order by nume desc");
ResultSet r=s.executeQuery();%>
<table border=2>
<%
while(r.next()){
%>
<tr>
<td><%=r.getString("musicname")%></td>
<td><img src=images/dot.gif height=13 width=<%=r.getString("nume")%>></td>
<td><%=r.getString("nume")%></td>
</tr>
<% }%>
</table><%
}
catch(Exception e)
{}
%>
</head>
<body>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
</body>
</html>
[此贴子已经被作者于2006-12-23 20:54:45编辑过]