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

Viewed 506

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

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.

1 Answers

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;
Related