Monday, June 27, 2016

What is dialect class in Hibernate?


  1. Dialect class is java class, which contains code to map between java language data type database data type.
  2. All Dialect classes extend the Dialect abstract class.
  3. Dialect is used to convert HQL statements to data base specific statements.
To connect to any database with hibernate, we need to specify the SQL dialect class in hibernate.cfg.xml

     Ex: To connect to oracle database we need to specify oracle dialect class in configuration xml as below.
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>

No comments:

Post a Comment