首页 > 解决方案 > 在 Mac osx 上将 Java 应用程序与 Oracle 连接

问题描述

我能够在 Mac osx 上通过 VirtualBox 和 SQLDeveloper 运行 Oracle DB。但问题是,在将 Java App 与 Oracle DB 连接时出现错误。

"java.sql.SQLException: ORA-28040: No matching authentication protocol"

我的配置文件就像

<?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>
       <property name = "hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
      <!-- hibernate is optional in key names  -->
          <property name = "hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
             
      <!-- Assume test is the database name -->
      <property name = "hibernate.connection.url">jdbc:oracle:thin:@localhost:1521/orcl</property>
      <property name = "hibernate.connection.username">hr</property>
      <property name = "hibernate.connection.password">oracle</property>
         
      <!-- List of XML mapping files -->
      <mapping resource = "com/visionforth/entity/Student.hbm.xml"/>
   </session-factory>
</hibernate-configuration>

并创建了如下图所示的逻辑连接

在此处输入图像描述

请帮助如何解决问题。

标签: javahibernateoracle19c

解决方案


推荐阅读