简体   繁体   中英

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

I have spring boot application which used ojdbc6 11.2.0.3 driver. Following are my spring data source properties

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

This gives error 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. Also db has 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.

What would cause this? What direction should i investigate. Is this could related to https://community.oracle.com/thread/2188514 . My JDK is 14.0.1.

If you are 100% sure the password is right, perhaps you are affected by the problem in the JIT

Connection To Database From Oracle JVM Using Server Side Jdbc Thin Driver Throws Ora-01017

When the Java code is deployed to a pre-11g database the server-side JDBC/thin connection works fine. After the Java code is deployed to a 11.2 database the server-side JDBC/thin connection fails with ORA-01017: invalid username/password; logon denied.

You can try this workaround

alter system set java_jit_enabled=FALSE;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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