HSQLDB数据库服务器的{Hibernate配置文件

时间:2015-07-14 09:20:24

标签: hibernate web-services configuration hsqldb configuration-files

我是hibernate编程的新手,我不知道如何为HSQLDB数据库服务器编写hibernate配置文件。服务器位于本地主机上。

  • 用户名是:michael
  • 密码是:jane $%12#

1 个答案:

答案 0 :(得分:0)

试试这个:

<?xml version='1.0' encoding='utf-8'?>
<!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="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
    <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
    <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost/</property>
    <property name="hibernate.connection.username">michael</property>
    <property name="hibernate.connection.password">jane$%12#</property>    
    <property name="show_sql">true</property>
    <property name="current_session_context_class">thread</property>
    <mapping resource="yourclassname.hbm.xml"/>
  </session-factory>
</hibernate-configuration>