【发布时间】:2015-04-24 20:13:08
【问题描述】:
我是使用休眠的新手,所以当我尝试连接到 Oracle 数据库时遇到问题。我正在一步一步地遵循this 教程,但是在Creating the Hibernate Reverse Engineering File 中的here 在oracle 驱动程序尝试建立连接时出现了一些错误。这是确切的错误:
这是我的 hibernate.cfg.xml:
<?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.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
<property name="hibernate.connection.username">hotel</property>
<property name="hibernate.connection.password">hotel</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
</session-factory>
</hibernate-configuration>
也许我需要在某个地方设置 jdbc oracle 驱动程序,但我不知道确切的位置。知道可能出了什么问题吗?
提前致谢!!
【问题讨论】:
标签: java spring oracle hibernate netbeans