请参考这个 http://www.java2000.net/viewthread.jsp?tid=1906
不同的Tomcat版本,配置数据源的方法是不同的。哈哈!这个造成了许多人的困扰。

解决方案 »

  1.   

    这么快就有人回复了,看来论坛的作用还真不小啊!呵呵!
    我刚才又回想了一小,是不是common-dbcp.jar,common-pool.jar版本的问题,于是我就下载了最新版本的jar包,在commons-dbcp-1.2.2.tar.gz中的README文件中找到了下面的信息。
    Apache Jakarta Commons DBCP
    ===========================Welcome to the DBCP component of the Apache Jakarta Commons
    project (http://jakarta.apache.org/commons). DBCP uses Maven 1 (http://maven.apache.org) for build 
    process management. It is known to build with Maven 1.0.2,
    though other versions may also work. To build DBCP using Maven, type "maven" at a command line prompt
    from the top-level directory of the source distribution (the directory
    that contains the file named project.xml).DBCP can also be built using Ant from the build.xml file. 
    Locations of dependent jars for the Ant build need to be specified in 
    build.properties.  There is a build.properties.sample file included in the
    source distribution.The binary distribution was built using JDK 1.4.2_10. The Ant build includes
    conditional compilation to support building on JDK 1.3. This release of JDBC compiles with and supports JDK 1.3 (JDBC 2.0) and
    JDK 1.4-1.5 (JDBC 3.0). JDK 1.6 (JDBC 4.0) is not supported by this release. 

    See http://jakarta.apache.org/commons/dbcp/ for additional and 
    up-to-date information on Commons DBCP.
    原来是我的JDK版本高了,唉,真郁闷啊!
    ~~~~~都是版本不一致弄的~~~~~
      

  2.   

    <set-property property="user" value="root" /> 
    的 user 改成username试试,
    1.2版本里是这么写的