Java/Hibernate/Hibernate HSQL

Материал из Java эксперт
Перейти к: навигация, поиск

Get all dialect supported by Hibernate

   <source lang="java">

import org.hibernate.dialect.Dialect;

public class GetClasses {

   public static void main(String[] args) {
       Class[] cs = Dialect.class.getClasses();
       for(int i=0;i<cs.length;i++){
           System.out.println(cs[i]);        
       }
   }

}

</source>
   
  
 
  



Hibernate HSQL connection

   <source lang="java">

<!DOCTYPE hibernate-configuration PUBLIC

 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

 <session-factory>
    
       <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
       <property name="connection.url">jdbc:hsqldb:mem:testdb</property>
       <property name="connection.username">sa</property>
       <property name="connection.password"></property>
       
       <property name="connection.pool_size">2</property>
       
       <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
       
       <property name="show_sql">true</property>
       
       <mapping resource="Keyword.hbm.xml"/>
 </session-factory>

</hibernate-configuration>


      </source>
   
  
 
  



Hibernate HSQL Development Environment