错误:在Hibernate逆向工程文件(reveng.xml)中配置表过滤器时“读取模式错误:调用驱动程序#connect时出错”

时间:2016-08-09 10:17:22

标签: eclipse hibernate oracle11g

我在尝试在Java项目中配置Hibernate时遇到了一些问题。我正在寻找论坛,但我找不到任何解决方案。我是Hibernate的新手,你能帮我吗?提前谢谢。

这是我的hibernate.cfg.xml文件内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                     "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="ConexionHibernate">
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">hr</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:1521/xe</property>
<property name="hibernate.connection.username">hr</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
</session-factory>
</hibernate-configuration>

This is how my DataBase Connection looks like in Oracle SQL Developer

This is the error itself when i try configure the tables.

1 个答案:

答案 0 :(得分:1)

在你的配置中,jdbc驱动程序是为mysql设置的,连接url也不正确,对于oracle来说:

<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:xe</property>