Reputation: 1216
I am new in Oracle Database. I have successfully done these:
Now I want to connect to HR schema through JDBC from IntelliJ IDEA 14. Unfortunately I cannot connect though I have installed JDBC drivers. I have read the reference here but it does not work. I am getting the following error:
Connection to Oracle - HR@localhost failed
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
...
For better demonstration, a screenshot is attached. Notice that I cannot define the service name (in this case "pdborcl") because there is no text field for this in Data Sources and Drivers window. Also notice that I can still connect to HR schema through SQL*PLUS after the error.
How to resolve this issue? Or, is it an IntelliJ IDEA bug or a JDBC bug?
Upvotes: 0
Views: 1571
Reputation: 14651
You should be using "pdborcl" in the Database field. That is your service name, HR is just a schema in it.
Upvotes: 2