In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
I haven't updated the technical blog for a long time, and this blog will be re-launched for the technical record after practice.
Next, let's introduce how to configure an druid data source.
First of all, to introduce the dependency of druid in pom.xml, you should add version. I uniformly define version in parent, and I recommend using a stable version in the central repository.
Com.alibaba druid
Then, the general data source is configured in the context of spring, and the configuration file format is as follows:
Load property configuration file
Next, configure the property file. The druid data source supports password protection. Generate password protection using the following command
Java-cp druid-1.0.16.jar com.alibaba.druid.filter.config.ConfigTools you_password
Jdbc.driver=com.mysql.jdbc.Driverjdbc.jdbcUrl=jdbc:mysql://10.10.5.204:3306/v3?useUnicode=true&characterEncoding=utf-8jdbc.username=rootjdbc.publickey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOMUL6IbPTQkUcWoZSVROIEcgTAArcLP2rtNFaahm38PYqWVE92apcMqt0YxzTVSilGgUwIul9f5ZhvzpWGap4sCAwEAAQ==jdbc.password=kBJz+ij4HbnU4caQ6iJIBJtEDBHKXZoUsSSbhOSHzY0tRrMNOWcPZV/EIrlvAn+4lHQv7FfvhL6Z0CiUNY0ZmQ==jdbc.maxActive=8
Finally, to configure the monitoring page, configure the monitoring page in web.xml
DruidStatView com.alibaba.druid.support.http.StatViewServlet resetEnable false loginUsername genilex loginPassword 123456 DruidStatView / druid/*
The above druid data sources are configured.
The following tests can be done to verify the success of the configuration.
There are also some frequently asked questions, please refer to the official wiki
Https://github.com/alibaba/druid/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.