在 Hibernate 中大配置一般命名为 "HIbernate.cfg.xml"
Hibernate 配置文件主要用于配置数据库连接和 HIbernate 运行时所需要的各种特性。
- '1.0' encoding='utf-8'?>
- configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
- "connection.driver_class">oracle.jdbc.OracleDriver
- "connection.url">jdbc:oracle:thin:@localhost:1521:orcl
- "connection.username">szj
- "connection.password">szj
- "hibernate.dialect">org.hibernate.dialect.Oracle10gDialect
- "hibernate.show_sql">true
- "hibernate.format_sql">true
- "hibernate.hbm2ddl.auto">update
- "current_session_context_class">thread
- "cn/happy/entity/Student.hbm.xml"/>
来源: http://www.bubuko.com/infodetail-1994063.html