hibernate中有两个常见的配置文件hibernate.cfg.xml和*.hbm.xml
下面分别详细介绍下这两个配置文件
一、hibernate.cfg.xml配置文件内容和详解
<hibernate-configuration>
<session-factory>
<!-- 配置数据库连接信息 -->
<!-- 数据库驱动 -->
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<!-- url -->
<property name="connection.url">jdbc:mysql:///hibernatetest</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<!-- 数据库方言 -->
<property name="dialect">
org.hibernate.dialect.MySQL5Dialect
</property>
<!-- 是否打