我是tomcat5.1的,可是初步来
为什么??

解决方案 »

  1.   

    要用Tomcat连接池, 先要看看DBCP  有了没。
      

  2.   

    Tomcat的配置默认用DBCP, 可惜tomcat3.x 4.x DBCP并没装, 5.x不止到
      

  3.   

    我的也是TOMCAT 5.0也出不来为什么,DBCP是什么
      

  4.   

    啊?Tomcat5出不来么?我还没用Tomcat5呢,我再试试。
      

  5.   

    我刚刚在Tomcat5下也测试了一下,可以呀。你们报的什么错误?
      

  6.   

    CoolAbu(阿卜-Never Stop(★★★★)) 
    應該寫詳細點,
    多做點測試。
      

  7.   

    在tomcat4。1下,我怎么找不到“admin”这个文件阿???怎么会这样???
      

  8.   

    tomcat 5出不来呀,能不能解释一下.
      

  9.   

    楼主您好,我是在tomcat5.0中试了一下怎么不好试,提示错误为
    javax.servlet.ServletException: Name jdbc is not bound in this Context
      

  10.   

    to zhangjie1981() ( )
    你的那些配置信息也是下面这样写的么?
    JNDI Name:  jdbc/mssql   //你的名字也是这样写的么?
    Data Source URL: jdbc:microsoft:sqlserver://192.168.0.52:1433;databaseName=abu
    JDBC Driver Class:com.microsoft.jdbc.sqlserver.SQLServerDriver
    User Name:abu
    Password: abu
    Max. Active Connections: 4
    Max. Active Connections: 2
    Max. Wait for Connection: 5000
    Validation Query://可以不填
      

  11.   

    To  pengfeitian(飞天寻欢) 不是admin文件,是Tomcat文件中conf文件夹下tomcat-users.xml文件,你用记事本打开它,里面有admin的用户名和密码,默认的admin的密码好像为空。
      

  12.   

    To dwxq(dawei)能把你的错误信息贴出来么?
      

  13.   

    To  Leemaasn(呆鸟一号)收到,可惜这里不能贴图,要不然,我抓几个图贴出来。To All
    希望大家有条件都试试,我这里试了好几台机子了,都是好着的
      

  14.   

    to: CoolAbu(阿卜-Never Stop(★★★★)) 
    当然配置文件我是不可能弄错的
      

  15.   

    to:CoolAbu(阿卜-Never Stop(★★★★)) 下面是出错提示信息exception javax.servlet.ServletException: Name jdbc is not bound in this Context
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:456)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause javax.servlet.jsp.JspException: Name jdbc is not bound in this Context
    com.hawk.news.NewsInfoHandler.doStartTag(NewsInfoHandler.java:135)
    org.apache.jsp.index_jsp._jspx_meth_new_NewsInfo_0(index_jsp.java:478)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:118)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      

  16.   

    另外我也试了用直连的方式(在tomcat5.0)中也是出错,请您帮看看,就是在创建statement对象出错数据库的连接代码:
    try{
           Class.forName(this.ConnDriver);
           this.conn = DriverManager.getConnection(this.ConnUrl);
         }catch(Exception e){
           System.out.println(e.getMessage().toString());
         }创建statement的代码:
     Connection conn  = db.getconn();
     Statement stmt = conn.createStatement();
      

  17.   

    我是这样配置的在:sqlserver2000+tomcat5.0.14+win200server下JNDI Name:  jdbc/sqlserver 
    Data Source URL: jdbc:microsoft:sqlserver://192.168.202.151:1433;DatabaseName=lx
    JDBC Driver Class:com.microsoft.jdbc.sqlserver.SQLServerDriver
    User Name:sa
    Password:  
    Max. Active Connections: 4
    Max. Active Connections: 2
    Max. Wait for Connection: 5000
    Validation Query://可以不填
    点击Commit Changes后重新启动tomcat
    建立test1.jsp,输入内容如下:
    <%@ page import="javax.sql.*"%>
    <%@ page import="javax.naming.*"%><% 
       DataSource ds = null;
       try{
       InitialContext ctx=new InitialContext();
       ds=(DataSource)ctx.lookup("java:comp/env/jdbc/sqlserver ");
       Connection conn = ds.getConnection();
       Statement stmt = conn.createStatement();
       String strSql = "select * from users";
       ResultSet rs = stmt.executeQuery(strSql);
       while(rs.next()){
          System.out.println(rs.getString(1));                 
         }
       }
       catch(Exception ex){
       ex.printStackTrace();
       }
    %>
    报错如下:
    C:\tomcat\work\Catalina\localhost\test\org\apache\jsp\test1_jsp.java:51: cannot resolve symbol
    symbol  : class Connection 
    location: class org.apache.jsp.test1_jsp
       Connection conn = ds.getConnection();
    不知我如上配置是否正确.请指教,我是新手,有低级错误,不要笑我.
      

  18.   

    TO: CoolAbu(阿卜-Never Stop(★★★★)) 可以發到文檔中心啊。那裏可以貼圖。
    有問題可以在這邊討論。。不是很好?
      

  19.   

    To zhangjie1981() 
    你的直连也出错的话,可能是你的驱动没有放好位置或者MSSQL实例名的原因,你先把直接连的弄好,才能配置连接池的。你搜搜这里的帖子,有关于讲连不上MSSQL的解决方法的。Connection conn  = db.getconn();
    Statement stmt = conn.createStatement();//可能是没有取到连接,所以创建Statement时报错。
      

  20.   

    To dwxq(dawei我少写了一个引用的包
    加上下面这个。
    <%@ page import="java.sql.*"%>
      

  21.   

    <%@ page import="javax.sql.*"%>
    <%@ page import="javax.naming.*"%>
    这两个找不到,我装的是j2se版的,不是j2ee版的,是不是这个原因?
      

  22.   

    To Leemaasn(呆鸟一号) 好想法,我去找找文档中心。
      

  23.   

    感谢Leemaasn(呆鸟一号)  ;)我已经把带图片的贴到下面这个地方,大家有兴趣可以看看。http://www.csdn.net/Develop/read_article.asp?id=25942
      

  24.   

    To  YKwelldone(若有所思)你的JDK版本是多少?那两个包在1.4版以后都有的。
      

  25.   

    http://www.csdn.net/Develop/read_article.asp?id=25942这篇文章不能流览这篇文章还没有审批通过,请稍后……
    (说明:推荐给《程序员》杂志的文章只有没被采用,或者已经在杂志上发表了,才会审批通过。)