Hibernate.cfg.xml 配置记录
好记性不如烂笔头..
<hibernate-configuration><session-factory> <!-- Database connection settings (数据库 连接 配置) --> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:NEWERDRA</property> <property name="connection.username">sa</property> <property name="connection.password">sa</property> <!-- JDBC connection pool (use the built-in)(JDBC连接池 (使用内置的)) --> <property name="connection.pool_size">1</property> <!-- SQL dialect (SQL 方言)--> <property name="dialect">org.hibernate.dialect.Oracle9iDialect</property> <!-- Enable Hibernate's automatic session context management 启用Hibernate自动的会话上下文管理 --> <property name="current_session_context_class">thread</property> <!-- 设置事务的级别 --> <property name="hibernate.connection.isolation">2</property> <!-- Disable the second-level cache (禁用二级缓存) --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout 输出所有执行的SQL在控制台--> <property name="show_sql">true</property> <property name="hibernate.format_sql">true</property> <!-- Drop and re-create the database schema on startup 删除并重新创建数据库模式,再启动 --> <property name="hbm2ddl.auto">create</property> </session-factory>