<!DOCTYPE hibernate-configuration Public "-//hibernate/hibernate configuration DTD 3.0//en" "Http://hibernate.sour Ceforge.net/hibernate-configuration-3.0.dtd "><hibernate-configuration> <session-factory> < Propertyname= "Hibernate.dialect">Org.hibernate.dialect.MySQLDialect</ Property> < Propertyname= "Hibernate.connection.driver_class">Com.mysql.jdbc.Driver</ Property> < Propertyname= "Hibernate.connection.url">Jdbc:mysql://localhost:3306/bookdb</ Property> < Propertyname= "Hibernate.connection.username">Root</ Property> < Propertyname= "Hibernate.connection.password"></ Property> < Propertyname= "Hibernate.show_sql">True</ Property> < Propertyname= "Hibernate.format_sql">True</ Property> < Propertyname= "Hibernate.hbm2ddl.auto">Update</ Property> <MappingResource= "Entity/book.hbm.xml"/> </session-factory></hibernate-configuration>
Example code: Hibernate.cfg.xml