<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver.class">com.mysql.jdbc.Driver</property></span>
// test前面的///默认就是用 地址为本机 端口号默认3306
<property name="connection.url">jdbc:mysql:///test</property>
<property name="connection:username">root</property>
<property name="connection:password"> pwd</property>
<//dialect方言 指定hibernate连接哪种类型的数据库
<property name="dialecte">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate configuration>
hibernate的基本配置
在hibernate.cfg.xml里进行配置 这个文件一般都是自动生成的,我们通常xml配置文件用的会比较多一些,因为比较好操作计算机也能够较快的读取。