用于eclipse的Hibernate配置文件

时间:2015-10-20 06:39:33

标签: xml hibernate

我正在尝试这个例子 http://www.java2blog.com/2013/01/hibernate-hello-world-example-in-eclipse.html

以下是我的配置文件

b

但我得到以下错误:

<?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="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="connection.driver_class">org.postgresql.Driver</property>
    <property name="connection.url">jdbc:postgresql://localhost:5432/UserInfo</property>
    <property name="connection.username">root</property>
    <property name="connection.password">mysql@4535</property>

    <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>

    <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
    <property name="current_session_context_class">thread</property>
    <property name="hibernate.show_sql">false</property>
  </session-factory>

</hibernate-configuration>

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:-1)

您可能没有在 Eclipse 中添加所需的库。