overkail
overkail

Reputation: 85

Oracle JDBC cannot connect as sysdba user

I've a problem with connecting to the database as the sysdba user. When executing the same code but under oracle 12c everything seems to be working correctly, and I am able to connect as sysdba user, but when trying to execute the same code under oracle 19c there is an ORA-01017 exception thrown. I checked an I have correctly created the orapwd file. When I changed thin to oci it works but I'd like still use the thin.

OracleDataSource ods = new OracleDataSource();
Properties properties = new Properties();
properties.put("user", "sys");
properties.put("password", "password");
properties.put("internal_logon", "sysdba");

ods.setConnectionProperties(properties);
ods.setURL('here is my URL which works when OCI used instead of THIN');
ods.getConnection(); // when Oracle 12c is okay, oracle 19c thrown ORA exception.

I tried to use user "sys as sydba" but the result was the same ORA-01017. Does anyone have any idea what's may be wrong? I am running ojdbc8:19.3.0.0

Upvotes: 3

Views: 949

Answers (1)

Reddi
Reddi

Reputation: 743

Please check your password file that's being created. If you're using the ignorecase parameter it's still works under Oracle 12c but it does not under Oracle 19c. If you're creating the password file with this parameter there will no exception and the file will be created successfully but it won't be working correctly. The solution might be recreating this file without this parameter. I believe it should help.

Upvotes: 1

Related Questions