要以Class.forName("java.util.List")的形式
用Class.forName("List")会出错的

解决方案 »

  1.   

    确定这个Reg的class文件已经在web-inf/class或者lib里面了吗?这个Reg没有package吗?
    既然是ClassNotFoundException异常,那肯定是class文件不在运行环境classpath搜索路径里面了,仔细检查一下。
      

  2.   

    也就是说Class.forName()参数要类的全路经名称, haroyy(天平) 已经给你举了例子了。
      

  3.   

    谢谢各位兄弟,上属问题解决了,就是路径不全的问题,但是catch(Exception e){
                      throw new ServletException("bb:"+e.getMessage());
                  }
    这里抛出了异常,由这个导致的service.execute(request,response,context);
    错误是javax.servlet.ServletException: Exception:[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]第 1 行: ')' 附近有语法错误。
    com.wh.logic.Controller.doPost(Controller.java:67)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)请问是什么原因啊
      

  4.   

    这是有关db的servlet
    package com.wh.db;/**
     * Created by IntelliJ IDEA.
     * User: Administrator
     * Date: 2004-11-22
     * Time: 9:02:51
     * To change this template use File | Settings | File Templates.
     */
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class TraderConnectionPool extends HttpServlet {    public void init(ServletConfig config)
            throws ServletException{
            super.init(config);
            
            ConnectionPool pool=new ConnectionPool();
            try{
                pool.setDriver("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                pool.setUrl("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=trader");
                pool.setSize(100);
                pool.setUsername("trader");
                pool.setPassword("111111");
                pool.initializePool();
                ServletContext context=getServletContext();
                context.setAttribute("TRADER_POOL",pool);
                System.err.println("ADDED TRADER_POOL");
                
                          
            }
            catch(Exception e){
                System.err.println(e.getMessage());
            }
        }    
        
        
        public void doGet(HttpServletRequest request,HttpServletResponse response)throws 
                ServletException,IOException{        response.setContentType("text/html");
            PrintWriter out=response.getWriter();
            out.println("This Servlet does not service requests!");
            out.close();
        }
        public void detroy(){    ServletContext context=getServletContext();
         ConnectionPool pool= (ConnectionPool)context.getAttribute("TRADER_POOL");
           if(pool !=null){
               pool.emptyPool();
               context.removeAttribute("TRADER_POOL");
                      }
            else{           System.err.println("Could not get a reference to Pool!");       }
        }}
      

  5.   

    Your Reg Service's Sql?
      

  6.   

    先检查你的SQL语句部分能否正常执行