zoukankan      html  css  js  c++  java
  • 德鲁伊的配置

    (可以使用德鲁伊的高级配置:Druid的监控((数据,访问,并发。。。等)(localhost:8080/项目名/druid))
     
    --------------------------------------applicationContext.xml文件配置(连接池)------------------------------------------------------------
     
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
            <property name="url" value="${url}" />
            <property name="username" value="${username}" />
            <property name="password" value="${password}" />
            <!-- 配置监控统计拦截的filters -->
            <property name="filters" value="wall" />
            <property name="initialSize" value="5" />
            <property name="maxActive" value="100" />
            <property name="minIdle" value="10" />
            <property name="maxWait" value="60000" />
            <property name="validationQuery" value="SELECT 'x'" />
            <property name="testOnBorrow" value="true" />
            <property name="testOnReturn" value="true" />
            <property name="testWhileIdle" value="true" />
            <property name="timeBetweenEvictionRunsMillis" value="60000" />
            <property name="minEvictableIdleTimeMillis" value="300000" />
            <property name="removeAbandoned" value="true" />
            <property name="removeAbandonedTimeout" value="1800" />
            <property name="logAbandoned" value="true" />
        </bean>
    

      

     
     
    ------------------------------------------------WEB.xml文件配置-------------------------------------------------------
     
     
      
    <filter>
            <filter-name>DruidWebStatFilter</filter-name>
            <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
            <init-param>
                <param-name>exclusions</param-name>
                <param-value>/static/*,*.ico,/druid/*</param-value>
            </init-param>
            <init-param>
                <param-name>sessionStatEnable</param-name>
                <param-value>false</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>DruidWebStatFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
     
        <!-- druid监控 -->
        <servlet>
            <servlet-name>DruidStatView</servlet-name>
            <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
            <init-param>
                <!-- 用户名 -->
                <param-name>loginUsername</param-name>
                <param-value>lxm</param-value>
            </init-param>
            <init-param>
                <!-- 密码 -->
                <param-name>loginPassword</param-name>
                <param-value>lxm</param-value>
            </init-param>
        </servlet>
        <servlet-mapping>
            <servlet-name>DruidStatView</servlet-name>
            <url-pattern>/druid/*</url-pattern>
        </servlet-mapping>
    

      

     
     

     
  • 相关阅读:
    linux系统中对SSD硬盘优化的方法
    正则
    自己写的博客上线啦
    create-react-app部署到GitHub Pages时报错:Failed to get remote。origin.url
    使用react-redux开发的简单步骤
    使用redux开发的简单步骤
    使用combineReducers注意事项
    在前端页面展示Markdown文件
    React Router V4.0学习笔记
    为什么React事件处理函数必须使用Function.bind()绑定this?
  • 原文地址:https://www.cnblogs.com/coisini/p/9715601.html
Copyright © 2011-2022 走看看