In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how Hibernate connection pooling is configured. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
In Hibernate3.0, dbcp is no longer supported. The author of Hibernate clearly points out in Hibernate.org that dbcp has BUG in practice, and in some situations there are a lot of empty connections that cannot be released, so the support for dbcp is abandoned.
1. Hibernate connection pool: C3P0 configuration
Org.Hibernate.transaction.JDBCTransactionFactory 50 false thread true true org.Hibernate.dialect.Oracle9Dialect oracle.jdbc.driver.OracleDriver 0804 0804 jdbc:oracle:thin:@192.168.0.200:1521:orcl 2 2 5000 100 3000 2 false
2. Hibernate connection pool: use proxool
True org.Hibernate.dialect.MySQLDialect pool1 ProxoolConf.xml org.Hibernate.connection.ProxoolConnectionProvider.... ....
The 1.ProxoolConf.xml:xml file is placed in the same level directory and proxool-0.8.3.jar is required.
Pool1 jdbc:mysql://tpdb:3306/tpdb com.mysql.jdbc.Driver 90000 10 10 700 350 900000 14400000 true select sysdate () from dual
two。 The database name can be specified in this way
Jdbc:sqlserver://localhost:1433;DatabaseName=supermarket
3.URL can also pass parameters
Org.gjt.mm.mysql.Driver jdbc:mysql://localhost:3306/struts?useUnicode=true&characterEncoding=GBK
At present, the use of proxool is considered by most people to be a show.
4. Connection pool monitoring
1)。 Add the following paragraph to the web.xml
Proxool org.logicalcobwebs.proxool.admin.servlet.AdminServlet proxool/ Admin/proxool/
2). Http://localhost:8080/testHibernate/Admin/proxool
You can monitor the status of the connection pool!
Thank you for reading! This is the end of this article on "what is the configuration of Hibernate connection pool?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.