0
我想爲postreSQL使用hibernate,但它不起作用。 我把.xml放到'resources'文件夾中。休眠忽略我的方言
這裏是我的hibernate.cfg.xml:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/postgres</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.connection.password">123</property>
<!-- DB schema will be updated if needed -->
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<mapping class="ru.systemprom.example.testClass"/>
</session-factory>
</hibernate-configuration>
在起動我得到錯誤信息:
22:09:43,646 INFO [org.hibernate.cfg.SettingsFactory] Database ->
name : HSQL Database Engine
version : 1.8.0
major : 1
minor : 8
22:09:43,646 INFO [org.hibernate.cfg.SettingsFactory] Driver ->
name : HSQL Database Engine Driver
version : 1.8.0
major : 1
minor : 8
22:09:43,692 INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.HSQLDialect // !? i setted up posgresSQL dialect not hsql =(
22:09:43,719 INFO [org.hibernate.engine.jdbc.JdbcSupportLoader] Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
我想是因爲發生這個錯誤休眠不起作用。 它爲什麼忽略我的設置以及如何讓它工作?
注:我聽說Maven的需要一切從「資源」文件夾,所以我覺得這個問題是不是因爲它