Java/Hibernate/Hibernate HSQL
Версия от 18:01, 31 мая 2010; (обсуждение)
Get all dialect supported by Hibernate
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]);
}
}
}
Hibernate HSQL connection
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<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>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">2</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">create</property>-->
<mapping resource="Keyword.hbm.xml"/>
</session-factory>
</hibernate-configuration>