Posted By

Uzbekjon on 10/10/08


Tagged

java xml Hibernate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Hibernate XML Configuration file


 / Published in: XML
 

Hibernate xml configuration file "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.  
  6. <hibernate-configuration>
  7. <session-factory>
  8. <!-- SQL dialect -->
  9. <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
  10.  
  11. <!-- Database connection settings -->
  12. <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
  13. <property name="connection.url">jdbc:hsqldb:data/music</property>
  14. <property name="connection.username">sa</property>
  15. <property name="connection.password"></property>
  16. <property name="connection.shutdown">true</property>
  17.  
  18. <!-- JDBC connection pool (use the built-in one) -->
  19. <property name="connection.pool_size">1</property>
  20.  
  21. <!-- Enable Hibernate's automatic session context management -->
  22. <property name="current_session_context_class">thread</property>
  23.  
  24. <!-- Disable the second-level cache -->
  25. <property
  26. name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
  27.  
  28. <!-- disable batching so HSQLDB will propagate errors correctly. -->
  29. <property name="jdbc.batch_size">0</property>
  30.  
  31. <!-- Echo all executed SQL to stdout -->
  32. <property name="show_sql">true</property>
  33.  
  34. <!-- List all the mapping documents we're using -->
  35. <mapping resource="com/oreilly/hh/data/Track.hbm.xml"/>
  36. </session-factory>
  37. </hibernate-configuration>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: mieszkaniec on March 19, 2009

for all the beginners in Hibernate ,

here you can find a nice video with step by step tutorial how to set up the environment In Hibernate

http://hibernatetutorial.com/Hibernate-tutorial-how-to-set-up-basic-Hibernate-development-environment.html

You need to login to post a comment.