谁用过 Tomcat 进来!(0分)

  • 主题发起人 主题发起人 总有爱
  • 开始时间 开始时间

总有爱

Unregistered / Unconfirmed
GUEST, unregistred user!
我在JSP 中调用一个Bean 连接数据库, 出现如下错误,什么原因
(高手帮帮忙!)
javax.servlet.ServletException: [Microsoft][ODBC Paradox Driver]非法的描述器索引
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp.CallPageCt_jsp._jspService(CallPageCt_jsp.java:196)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)

 
检查一下连接数据库的语法
 
数据库连接没有问题,我用别的JSP去调用则正确.
急啊!怎么没有人帮忙啊?
 
把你的jsp的代码贴出来。看看
 
以下是JSP代码:
<%@ page import="java.sql.*"%>
<%@ page import="java.lang.*"%>
<%@ page import="javax.servlet.http.*" %>
<%@ page contentType="text/html;charset=gb2312" %>
<jsp:useBean id="PageCount" scope="page" class="pagecontrol.PageCt" />
<jsp:useBean id="sqlbean" scope="page" class="pagecontrol.Data" />
<html>
<head>
<TITLE>²âÊÔ</TITLE>
<STYLE>
body,table{font-size:9pt}
A:link {
COLOR: #000084; TEXT-DECORATION: none
}
A:visited {
COLOR: #000084; TEXT-DECORATION: none
}
A:hover {
COLOR: black; TEXT-DECORATION: underline
}
.ourfont {
FONT-SIZE: 9pt
}
</STYLE>
</head>
<body bgcolor=#eff3ff>
<center>
<font color=#000084><h3>Test for Test</h3></font>
<hr width=600 color=#b5dbff>
<br>

<%
ResultSet rs0 = sqlbean.executeQuery("select count(*) from employee" );
rs0.next();
long data_num=rs0.getLong(1);
long Current_Page = 0;
String currentpage=(String)request.getParameter("currentpage");
if (currentpage != null && !currentpage.equals(""))
{
Current_Page = Integer.parseInt(request.getParameter("currentpage"));
}
String Query_Page=(String)request.getParameter("Query_Page");
if (Query_Page!=null && !Query_Page.equals(""))
{
Current_Page = Integer.parseInt(request.getParameter("Query_Page"))-1;
}
PageCount.Init(Current_Page,data_num);
long l_start = PageCount.getStart();
long l_end = PageCount.getEnd();
//²éѯ¼Ç¼
ResultSet rs = sqlbean.executeQuery("select * from employee " );
long i=0;
while((i<l_start) && rs.next())
{
i++;
}
//Êä³ö²éѯ½á¹û
long j=0;
while(rs.next() && (i<l_end))
{
j=i+1;
String col2 = rs.getString(2);
String col3 = rs.getString(3);
String col4 = rs.getString(4);
String col5 = rs.getString(5);
String col6 = rs.getString(6);
String col7 = rs.getString(7);
String col8 = rs.getString(8);
//´òÓ¡ËùÏÔʾµÄÊý¾Ý
out.println("<table border=0 width=600>");
out.println("<tr><td colspan=2><font color=#000084>" + j + "¡¢"+(col2==null?"":col2)+"</font></td></tr><tr><td colspan=2>´ð°¸£º"+(col3==null?"":col3)+"</td></tr>");
out.println("<tr><td>  Ñ¡Ïî1£º"+(col4==null?"":col4)+"</td><td>  Ñ¡Ïî2£º"+(col5==null?"":col5)+"</td></tr>");
out.println("<tr><td>  Ñ¡Ïî3£º"+(col6==null?"":col6)+"</td><td>  Ñ¡Ïî4£º"+(col7==null?"":col7)+"</td></tr>");
if (col8!=null && !col8.equals(""))
{
out.println("<tr><td colspan=2>±¸×¢£º"+col8+"</td></tr>");
}
out.println("</table><br>");
i++;
}
%>
<table width=600>
<tr bgcolor=#b5dbff>
<form method=GET action=index.jsp>
<td width=80 align=center valign=bottom>¹² <%=PageCount.getTotalnum()%> Ìõ</td>
<td width=80 align=center valign=bottom><%=PageCount.getCurpage()+1%>/<%=PageCount.getTotalpage()%> Ò³</td>
<td width=120 align=center>²é¿´µÚ <input type=text name=Query_Page size=3> Ò³</td>
<td width=50 align=center valign=bottom><a href=index.jsp?currentpage=<%=PageCount.getPrepage()%>>ÉÏÒ³</a></td>
<td width=50 align=center valign=bottom><a href=index.jsp?currentpage=<%=PageCount.getNextpage()%>>ÏÂÒ³</a>
</td>
</tr>
</table>
<br><br><br>
<table cellspacing=20>
<tr>
<td colspan=3 align=center><input type=submit value=²éѯ></td>
</tr>
</form>
</table>
<br><br>
<a href="insert.jsp">Ìí¼Ó</a>
<center>
</body>
</html>
以下是PageCt.java 代码
//PageCt.java ·ÖÒ³µÄÀà
/*
*** @version ***********
*** Created on 2001Äê6ÔÂ25ÈÕ, ÏÂÎç14:41
**************************************
*/
package pagecontrol;
import java.sql.*;
import java.util.*;

public class PageCt
{
private long l_start; //¿ªÊ¼¼Í¼
private long l_end; //½áÊø¼Í¼
private long l_curpage; //µ±Ç°Ò³Êý
private long l_totalnum;//×ܼǼÊý
private int int_num=5; //ÿҳ10Ìõ
private long l_totalpage; //×ܵÄÒ³Êý


public void Init(long currentpage,long totalnum){
l_curpage = currentpage;
l_totalnum = totalnum;
if (currentpage>=0){
if (currentpage>=(long)Math.ceil((double)l_totalnum/(double)int_num))
l_curpage = (long)Math.floor((double)l_totalnum/(double)int_num);
else
l_curpage = currentpage;
}
else{
l_curpage = 0;
}
l_start = l_curpage * int_num;
l_end = l_start + int_num;
if (l_end > l_totalnum)
l_end = l_totalnum;
l_totalpage = (long)Math.ceil((double)l_totalnum/(double)int_num);
}

public long getCurpage(){
return l_curpage;
}

public long getPrepage(){
if (l_curpage-1>=0)
return l_curpage-1;
else
return 0;
}

public long getNextpage(){
if (l_curpage+1<=l_totalpage)
return l_curpage+1;
else
return l_totalpage;
}

public long getTotalnum() {
return l_totalnum;
}

public long getTotalpage() {
return l_totalpage;
}
public long getStart(){
return l_start;
}

public long getEnd(){
return l_end;
}
}


 
我全是把bean加到叶面里
<%@ page import="java.net.*,java.util.*,java.text.*,java.sql.*,java.lang.*,DBstep.iDBManager2000.*"%>

然后使用new来初试化。
 
后退
顶部