当前位置:网站首页>配置druid数据源「建议收藏」
配置druid数据源「建议收藏」
2022-08-10 11:11:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
引用jar包:
dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.10</version>
</dependency><bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
destroy-method="close">
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT" />
<property name="username" value="root" />
<property name="password" value="123456" />
<property name="filters" value="stat" />
<property name="maxActive" value="20" />
<property name="initialSize" value="1" />
<property name="maxWait" value="60000" />
<property name="minIdle" value="1" />
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<property name="minEvictableIdleTimeMillis" value="300000" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<property name="poolPreparedStatements" value="true" />
<property name="maxOpenPreparedStatements" value="20" />
</bean>显示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>druid</param-value>
</init-param>
<init-param>
<param-name>loginPassword</param-name>
<param-value>druid</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DruidStatView</servlet-name>
<url-pattern>/druid/*</url-pattern>
</servlet-mapping>发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/105614.html原文链接:https://javaforall.cn
边栏推荐
- 力扣练习——59 从二叉搜索树到更大和树
- blocking non-blocking poll mechanism asynchronous
- flask-restplus接口地址404问题
- Do self-media monthly income tens of thousands?Several self-media tools that bloggers are using
- 从源码角度分析UUID的实现原理
- ViT结构详解(附pytorch代码)
- 实现内网穿透的最佳解决方案(无实名认证,完全免费)
- From the product dimension, why can't we fully trust Layer2?
- 建校仅11年就入选“双一流” ,这所高校是凭什么做到的?
- mpf6_Time Series Data_quandl_更正kernel PCA_AIC_BIC_trend_log_return_seasonal_decompose_sARIMAx_ADFull
猜你喜欢

中小规模网站架构

实现内网穿透的最佳解决方案(无实名认证,完全免费)

Nocalhost - 让云原生时代的开发更高效

mysql appears: ERROR 1524 (HY000): Plugin '123' is not loaded

Spss-多元回归案例实操

推荐6个自媒体领域,轻松易上手

Open Office XML 格式里如何描述多段具有不同字体设置的段落
![[Brave food, not afraid to write the linked list] The problem of the penultimate node of the linked list](/img/87/7ac0307de54f2defe8f72c554745cd.png)
[Brave food, not afraid to write the linked list] The problem of the penultimate node of the linked list

StoneDB Document Bug Hunting Season 1

从源码角度分析UUID的实现原理
随机推荐
孩子自律性不够?猿辅导:计划表要注意“留白”给孩子更多掌控感
HDU 4372:Count the Buildings (Stirling数)
怎么加入自媒体,了解这5种变现模式,让账号快速变现
10 个 Reduce 常用“奇技淫巧”
Analysis of the implementation principle of UUID from the perspective of source code
Emulate stm32 directly with proteus - the programmer can be completely discarded
使用.NET简单实现一个Redis的高性能克隆版(六)
Double.doubleToLongBits() method uses
三个绘图工具类详解Paint(画笔)Canvas(画布)Path(路径)
[Go WebSocket] 多房间的聊天室(一)思考篇
WeChat applet, global variables change in one place and the state in other places also changes.
LeetCode50天刷题计划(Day 16—— 两两交换链表中的节点(9.10-10.30)
2022年裁员潮,失业程序员何去何从?
蔚来-软件开发工程师一面记录
The brave rice rice, does not fear the brush list of 】 list has a ring
不止跑路,拯救误操作rm -rf /*的小伙儿
有哪些好用的性能测试工具推荐?性能测试报告收费标准
建校仅11年就入选“双一流” ,这所高校是凭什么做到的?
LeetCode 19. 删除链表的倒数第 N 个结点
HDU 6040 Hints of sd0061 (技巧)