Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2003
    Location
    New Jersey
    Posts
    3

    Unanswered: CachedRowSetImpl Error

    Hi,
    I am working on displaying 10 rows per page and i am using CachedRowSetImpl
    I am getting this error.Pl let me know if any body can help in finding the error..

    ----------------------------------------------------
    java.sql.SQLException: Invalid persistence provider generated

    org.apache.jasper.JasperException: Invalid persistence provider generated
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:254)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:534)


    root cause


    Thanks
    Sagar
    ----------------------------------
    Here goes the my File


    <%@ page import="java.util.*, java.io.*,java.sql.*,com.sun.rowset.CachedRowSetIm pl" %>

    <html>
    <head>
    <title>Physician Details Page</title>
    </head>

    <body bgcolor="#ffffee" text="blue">
    <form target="_top" name=viewForm action="<%= request.getContextPath()%>/protected/dbtool_frameset.jsp" method="post">
    <%! int numPages = 0; %>
    <%
    String columnName = "";
    int count = 0;
    int totalCols = 0;
    int increment = 1;
    ResultSetMetaData resultSetMetaData=null;

    //String numRowsString = (String) session.getAttribute("numRowsString");
    int numRows =10; //Integer.parseInt(numRowsString);
    //String startIndexString = request.getParameter("startIndex");
    int startIndex = 0;//Integer.parseInt(startIndexString);
    CachedRowSetImpl cache = new CachedRowSetImpl();

    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Driver loaded...");
    //CachedRowSet cache = new CachedRowSet();


    System.out.println("cache..");
    cache.setReadOnly(true);
    cache.setUrl("jdbcdbc:faxDetails");
    cache.setUsername("AtlantisUpdate");
    cache.setPassword("Evenor");
    cache.setCommand("SELECT firstname FROM PhysicianDetail where lastname='wood'");
    cache.execute();
    resultSetMetaData = cache.getMetaData();
    totalCols = resultSetMetaData.getColumnCount();
    %>
    <table border=1 align=center width="100%">
    <tr>
    <%
    for(int j=1; j<=totalCols; j++) {
    columnName = (String) resultSetMetaData.getColumnName(j);
    %><td>
    <b><% out.print(columnName); %></b>
    </td>
    <%}%>
    </tr>
    <%
    numPages = numRows / 10;
    int remain = numRows % 10;

    if(startIndex + 10 < numRows) {
    increment = startIndex + 10;
    }else{
    increment = startIndex + remain;
    }


    cache.absolute(startIndex);

    for(count = startIndex; count < increment; count++) {
    %><tr><%
    for(int i=1; i<=totalCols; i++) {
    %><td><% out.println(cache.getString(i)); %></td><%
    } // end for
    %></tr><%
    cache.next();
    } // end for
    %>
    </table>
    <br>
    <br>
    <%

    %>
    <table width = "100%">
    <tr>
    Displaying Records:
    <% if(startIndex + 10 < numRows){%>
    <%= " " + startIndex %> - <%= increment - 1 %>
    <%}else{%>
    <%= " " + startIndex %> - <%= numRows %>
    <%}%>

    <%if(startIndex != 1) {%>
    <a href="<%=request.getContextPath()%>sun.jsp?startIn dex=<%=startIndex-10%>">Previous</a>
    <%}%>

    <%increment += 10;%>
    <%if(startIndex + 10 <= numRows){%>
    <a href="<%=request.getContextPath()%>sun.jsp?startIn dex=<%=startIndex+10%>">Next</a>
    <%}%>
    </tr>
    </table>
    <%
    }catch(Exception exc){
    out.println(exc.toString());
    } // end try-catch
    %>

    </form>
    </body>
    </html>
    Last edited by sagarprathap; 01-26-04 at 15:05.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •