arnobpl
arnobpl

Reputation: 1216

How to connect to Oracle Database 12c HR schema from IntelliJ IDEA 14

I am new in Oracle Database. I have successfully done these:

  1. Installed and configured Oracle Database 12c in Windows 10 VMware virtual machine.
  2. Connected to HR schema from SQL*PLUS, SQL Developer, Navicat.
  3. Created a ASP.NET web application project and connected to HR schema from Visual Studio 2015.

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?

IntelliJ IDEA Oracle Database HR schema connection failure

Upvotes: 0

Views: 1571

Answers (1)

Gergely Bacso
Gergely Bacso

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

Related Questions