Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Hibernate.cfg.xml

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to configure Hibernate.cfg.xml". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to configure Hibernate.cfg.xml.

The description file of Hibernate can be an properties properties file or an xml file. Let's talk about Hibernate.cfg.xml configuration. The configuration format is as follows:

1. Configure the data source

You can configure either JDBC or JNDI by Hibernate.cfg.xml. How to configure the data source is described in this section.

>

True

Net.sf.hibernate.dialect.MySQLDialect

fifty

Java:comp/env/jdbc/datasourcename

Net.sf.hibernate.

Connection.DatasourceConnectionProvider

Net.sf.hibernate.dialect.SQLServerDialect

>

2. C3p0 connection pool

C3p0 connection pool is the connection pool recommended by Hibernate. If you need to use this connection pool, you need to add the jar package of c3p0 to the classpath. An example configuration of c3p0 connection pooling is as follows:

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report