错误:在休眠逆向工程文件 (reveng.xml) 中配置表筛选器时"reading schema error: error calling driver#connect"



我在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>

这是如何我的数据库连接看起来像在Oracle SQL开发人员

在你的配置中,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>

最新更新