Home > Web Front-end > JS Tutorial > Hibernate configuration

Hibernate configuration

php中世界最好的语言
Release: 2018-03-07 17:01:47
Original
1126 people have browsed it

This time I will bring you the configuration of Hibernate. What are the precautions for Hibernate configuration? The following is a practical case, let's take a look.

Database:

Mysql

Configuration file nameHibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration><!-- SessionFactory -->
    <session-factory>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/database</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="hibernate.connection.username">username</property>
        <property name="hibernate.connection.password">password</property>
        <property name="show_sql">true</property>
        <property name="hbm2ddl.auto">update</property>
        <mapping resource="com/troyforever/mvc/bean/Example.hbm.xml" />
    </session-factory></hibernate-configuration>
Copy after login

I believe you have mastered it after reading the case in this article For more exciting methods, please pay attention to php Chinese website

Other related articles!

Related reading:

Web.xml configuration

Spring’s MVC configuration

Hibernate mapping file detailed explanation

Spring configuration

The above is the detailed content of Hibernate configuration. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template