Hibernate连接Oracle 10g之hibernate.cfg.xml

Hibernate连接Oracle 10g之hibernate.cfg.xml

  1. <?xml version='1.0' encoding='utf-8'?>  
  2. <!DOCTYPE hibernate-configuration PUBLIC  
  3.         "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  
  4.         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">  
  5. <hibernate-configuration>  
  6.     <session-factory>  
  7.         <!-- Database connection settings -->  
  8.         <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>  
  9.         <property name="connection.url">jdbc:oracle:thin:@localhost:1521:ORCL</property>  
  10.         <property name="connection.username">scott</property>  
  11.         <property name="connection.password">7788966</property>  
  12.         <!-- JDBC connection pool (use the built-in) -->  
  13.         <property name="connection.pool_size">1</property>  
  14.         <!-- SQL dialect -->  
  15.         <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>  
  16.         <!-- Enable Hibernate's automatic session context management -->  
  17.         <property name="current_session_context_class">thread</property>  
  18.         <!-- Disable the second-level cache  -->  
  19.         <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>  
  20.         <!-- Echo all executed SQL to stdout -->  
  21.         <property name="show_sql">true</property>  
  22.         <!-- Drop and re-create the database schema on startup -->  
  23.         <property name="hbm2ddl.auto">create</property>  
  24.         <mapping resource="vo/Student.hbm.xml"/>  
  25.     </session-factory>  
  26. </hibernate-configuration>  

相关推荐