0
votes

I am getting this exception while trying to connect to Oracle database using oracle.jdbc.driver.OracleDriver version ojdbc14. I have verified multiple times that I am using correct username and password.

java.sql.SQLException: ORA-01017: invalid username/password; logon denied

I have accidentally removed registry folder ODBC located at HKEY_LOCAL_MACHINE\SOFTWARE\ODBC

Will this be causing issue? I have imported this folder from another windows 10 user.

3
Are you really still using Java 1.4?a_horse_with_no_name
I am inclined to believe Oracle more than you that the username and password are incorrect.a_horse_with_no_name
The ODBC registry settings have nothing to do with JDBC.a_horse_with_no_name
Sir how can i trace exact issue as I am able to connect successfully using sql developer but not from codebase. Is their any encryption process which might be creating trouble?Shahwaiz Malik
ojdbc14 means it is for Java 1.4, you may want to consider using a more recent version of the driver (eg ojdbc8 version 18.3 or 12.2.0.1)Mark Rotteveel

3 Answers

0
votes

The exception is clear.

Java.sql.SQLException: ORA-01017: invalid username/password; logon denied

This means without a doubt that the username and password are incorrect for the database that you are trying to connect to.

Verify that you are connecting to the right database (IP, service, etc), and try to login to that database using SqlPlus to verify that your details are correct.

And if you see that SqlPlus is also rejecting your login, contact the appropriate administrator that will fix your account issues.

0
votes

Take a look at this post:

ORA-01017 Invalid Username/Password when connecting to 11g database from 9i client

This error can happen when you use a driver that's older than the database. That's because passwords are stored in the database in what's called a verifier which is basically a hash of the password. In every release Oracle changes the hash function to make it more robust. In some cases older clients can no longer connect. The easiest solution is to upgrade your JDBC driver to the most recent one.

0
votes

This problem happens when you have not set your odbc14.jar file in proper way.

If you are executing program by cmd then Make sure that you have set path variable in environment variables of odbc14.jar. and restart your system and run program.

If you are working with eclipse then make sure to add odbc.jar file in your project by right click on project -> build path -> configure build path -> choose Libraries option -> add external JARs -> apply and close.

try it and will done.