0

I have used the exact same Driver Name, Connection URL , User Name and Password for connecting to my Oracle 11g Express edition database running on my local(same) machine from 2 codes.

  1. Simple Java code to connect to DB and read values from a table.

    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con=DriverManager.getConnection(
         "jdbc:oracle:thin:@localhost:1521:xe",
         "SYSTEM","Platz@123"
    );
    
  2. In Hibernate persistence.xml

    enter image description here

The Simple java connection works as expected, However Hibernate gives me the error "java.sql.SQLException: ORA-01017: invalid username/password; logon denied".

Does this has to do anything with the oracle installation configurations on my machine? Or if it is something else.

Could you please provide and explanation and the way out.

schtever
  • 3,210
  • 16
  • 25
Mayank Madhav
  • 429
  • 1
  • 7
  • 19
  • maybe helpful or related [giving correct username& password, get ORA-01017: invalid username/password; logon denied](https://stackoverflow.com/questions/11266280/giving-correct-username-password-get-ora-01017-invalid-username-password-log) – chickity china chinese chicken Mar 02 '18 at 19:21

1 Answers1

1

I believe the standard JPA property name for the user name is:

javax.persistence.jdbc.user

Not:

javax.persistence.jdbc.username
schtever
  • 3,210
  • 16
  • 25
  • Thanks @schtever . That was silly. Though I was wondering why a thing like this cannot be checked and informed by hibernate itself, saying "javax.persistence.jdbc.username" is not a valid property – Mayank Madhav Mar 09 '18 at 06:15