简体   繁体   English

Java 应用程序未使用正确的用户名/密码连接到 oracle 数据库

[英]Java application not connecting to oracle database with correct username/password

I have spring boot application which used ojdbc6 11.2.0.3 driver.我有使用 ojdbc6 11.2.0.3 驱动程序的 spring 引导应用程序。 Following are my spring data source properties以下是我的 spring 数据源属性

spring.datasource.username=abc
spring.datasource.password=abc
spring.datasource.url=jdbc:oracle:thin:@myhost:1521:orcl

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.physical-strategy= org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.generate-ddl=true

#spring.datasource.driver-class-name=oracle.jdbc.OracleDriver #spring.datasource.driver-class-name=oracle.jdbc.OracleDriver

This gives error java.sql.SQLException: ORA-01017: invalid username/password; logon denied这会产生错误java.sql.SQLException: ORA-01017: invalid username/password; logon denied java.sql.SQLException: ORA-01017: invalid username/password; logon denied

i'm 100% sure username/password correct.我 100% 确定用户名/密码正确。 Also db has SEC_CASE_SENSITIVE_LOGON=FALSE. db 也有 SEC_CASE_SENSITIVE_LOGON=FALSE。 I checked with both uppercase and lowercase username/password and still get error.我检查了大写和小写的用户名/密码,但仍然出现错误。 Simple java app with same driver connect to db fine.具有相同驱动程序的简单 java 应用程序可以很好地连接到数据库。

What would cause this?什么会导致这个? What direction should i investigate.我应该调查什么方向。 Is this could related to https://community.oracle.com/thread/2188514 .这可能与https://community.oracle.com/thread/2188514有关吗? My JDK is 14.0.1.我的 JDK 是 14.0.1。

If you are 100% sure the password is right, perhaps you are affected by the problem in the JIT如果您 100% 确定密码正确,那么您可能受到 JIT 问题的影响

Connection To Database From Oracle JVM Using Server Side Jdbc Thin Driver Throws Ora-01017使用服务器端 Jdbc 瘦驱动程序从 Oracle JVM 连接到数据库引发 Ora-01017

When the Java code is deployed to a pre-11g database the server-side JDBC/thin connection works fine.当 Java 代码部署到 11g 之前的数据库时,服务器端 JDBC/瘦连接工作正常。 After the Java code is deployed to a 11.2 database the server-side JDBC/thin connection fails with ORA-01017: invalid username/password;将 Java 代码部署到 11.2 数据库后,服务器端 JDBC/瘦连接失败并出现 ORA-01017:用户名/密码无效; logon denied.登录被拒绝。

You can try this workaround你可以试试这个解决方法

alter system set java_jit_enabled=FALSE;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM