我使用dreamwear做的网上投票的例子其他的页面都调试的没有错误了 唯独主页面index.jsp出现了错误请各位帮帮我
解决方案 »
- 求助EXT的解释,如何运用?
- 使用resin碰到的一个非常奇怪的异常...寻求大家的意见!!!分不多,都给了
- 对-基于web的信息抽取的一些疑惑
- Catch里执行delete操作不成功
- 会 配置 Hibernate + Tomcat JNDI 的请进 , 关于 Session 工厂方面, 牛牛 们 快来啊 !!!
- 请教一下:怎么查sun.net.TelnetInputStream在jdk1.6中用什么代替的?
- 懂javaBean的高手进
- 请教JApplet的简单问题
- 关于oracle.sql.CLOB的问题,解决后一定给分,在线等待!
- spring mvc返回json问题
- hql分组查询的问题?望路过的朋友帮解决!
- 梅花雪展示问题,急...在线等,谢谢各位大哥
exception org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.index_jsp._jspService(index_jsp.java:161)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
sun.jdbc.odbc.JdbcOdbc.SQLGetDataInteger(JdbcOdbc.java:3811)
sun.jdbc.odbc.JdbcOdbcResultSet.getDataInteger(JdbcOdbcResultSet.java:5638)
sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:583)
sun.jdbc.odbc.JdbcOdbcResultSet.getObject(JdbcOdbcResultSet.java:1693)
sun.jdbc.odbc.JdbcOdbcResultSet.getObject(JdbcOdbcResultSet.java:1743)
org.apache.jsp.index_jsp._jspService(index_jsp.java:128)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="Connections/vote.jsp" %>
<%
Driver DriverrsVote = (Driver)Class.forName(MM_vote_DRIVER).newInstance();
Connection ConnrsVote = DriverManager.getConnection(MM_vote_STRING,MM_vote_USERNAME,MM_vote_PASSWORD);
PreparedStatement StatementrsVote = ConnrsVote.prepareStatement("SELECT * FROM vote");
ResultSet rsVote = StatementrsVote.executeQuery();
boolean rsVote_isEmpty = !rsVote.next();
boolean rsVote_hasData = !rsVote_isEmpty;
Object rsVote_data;
int rsVote_numRows = 0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网上投票系统首页</title>
<style type="text/css">
<!--
.STYLE4 {
font-family: "宋体";
font-size: 16px;
font-weight: bold;
}
-->
</style>
<script language="javascript">
function doCheck(){
var i;
var n=0;
for(i=0;i<form1.chkItem.length;i++)
if(form1.chkItem[i].checked)n++;
if(n==0){
alert("至少要选择一项才能投票!");
return false;
}
}
</script>
</head><body>
<form id="form1" name="form1" method="post" action="servlet/vote" onsubmit="return doCheck()">
<table width="278" border="1" align="center">
<caption align="top">
<span class="STYLE4">你最喜爱的旅游景点投票</span>
</caption>
<tr>
<th width="88" scope="col">编号</th>
<th width="174" scope="col">投票项目</th>
</tr>
<tr>
<th scope="row"><%=(((rsVote_data = rsVote.getObject("id"))==null || rsVote.wasNull())?"":rsVote_data)%></th>
<td><input name="chkItem" type="checkbox" id="chkItem" value="<%=rsVote_data %>" />
<%=(((rsVote_data = rsVote.getObject("item"))==null || rsVote.wasNull())?"":rsVote_data)%></td>
</tr>
</table>
</form>
<form id="form2" name="form2" method="post" action="">
<div align="center">
<input name="btnVote" type="submit" id="btnVote" value="投票" />
<input name="btnView" type="button" id="btnView" value="查看结果" onclick="javascript:window.location='result.jsp'" />
<input name="btnView" type="button" id="btnView" value="管理员登录" onclick="javascript:window.location='login.jsp'" />
</div>
</form></body>
</html>
<%
rsVote.close();
StatementrsVote.close();
ConnrsVote.close();
%>
在这句出错<th scope="row"><%=(((rsVote_data = rsVote.getObject("id"))==null || rsVote.wasNull())?"":rsVote_data)%></th>