Database connection <required>:
<property name= "hibernate.connection.driver_class" >
Com.mysql.jdbc.Driver
</property>
<property name= "hibernate.connection.username" >root</property>
<property name= "hibernate.connection.password" >root</property>
<property name= "hibernate.connection.url" >
Jdbc:mysql://localhost:3306/db_name
</property>
Dialect <required>:
<!--database dialect: Specify the database to which you want to connect, or you cannot build the table-
<!--hibernate5.0 MySQL5--
<!--hibernate5.1 Mysql5innodbdialect--
<property name= "hibernate.dialect" >
Org.hibernate.dialect.MySQL5InnoDBDialect
</property>
SQL Display Method:
<!--whether to show SQL--
<property name= "hibernate.show_sql" >true</property>
<!--whether to format SQL--
<property name= "hibernate.format_sql" >true</property>
<!--If you need to maintain table structure--
<property name= "hibernate.hbm2ddl.auto" >update</property>
Update: The table is not created, and if the table has changed, the incremental modification
Based on the original table to modify, the original table data will not be deleted
Create: Deletes the old table every time, creating a new table
Re-creating the database table structure each time you reload hibernate may result in data loss
Create-drop: Create first, delete the table after the test is complete
Validate: Validation does not automatically generate tables, each time the database is started verifies that the tables and entities in the database are consistent, if inconsistent, error
mapping information <required>:
<!--mapping file--><mapping resource= "Com/roxy/hibernate/pojo/customer.hbm.xml"/>
Hibernate--hibernate.cfg.xml Configuration