Tomcat默认用的是DBCP
DBCP是没有这个“数据库重启后自动恢复”这个特性的,毕竟是free的嘛。用别的数据库链接池试一试呗。
weblogic的   有这个特性

解决方案 »

  1.   

    <!-- The JDBC connection url for connecting to your MySQL dB.
                 The autoReconnect=true argument to the url makes sure that the
                 mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
                 connection.  mysqld by default closes idle connections after 8 hours.
                 -->
            <parameter>
                <name>url</name>
                <value>jdbc:mysql://localhost/business?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8</value>
            </parameter>
      

  2.   

    autoReconnect=true这样就可以了??
    在SQLSERVER和ORACLE中可以这样用吗?
    值得测试一下
      

  3.   

    Tomcat版本?如果是5.0,可能没有办法了,它的BUG吧。换一下5.5版,没问题的。