Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-12514 error with JDBC thin client to Express 11.2

user1100820Nov 5 2017 — edited Nov 6 2017

1. SQLPLUS connects to the Express 11.2 'XE' service running on Windows 7 using 'sqlplus hr/hr@XE'.

Express 11.2, SQLPLUS and Java App all are running on the PROD10 Windows 7 workstation.

2. Java app using JDBC thin client receives the below error using this connect string: jdbc:oracle:thin:hr/hr@//PROD10:1521/xe:

Listener refused the connection with the following error:

ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

3. Using ojdbc6.jar type 4 driver with jdk1.60_27.

4. 'lsnrctl services' reports the below:

LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 05-NOV-2017 16:22:19

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

Services Summary...

Service "CLRExtProc" has 1 instance(s).

  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0

         LOCAL SERVER

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0

         LOCAL SERVER

Service "XEXDB" has 1 instance(s).

  Instance "xe", status READY, has 1 handler(s) for this service...

    Handler(s):

      "D000" established:0 refused:0 current:0 max:1022 state:ready

         DISPATCHER <machine: TIGER2, pid: 4188>

         (ADDRESS=(PROTOCOL=tcp)(HOST=TIGER2)(PORT=50085))

Service "xe" has 1 instance(s).

  Instance "xe", status READY, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

The command completed successfully

5. tnsnames.ora contains:

XE =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = TIGER2)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = XE)

    )

  )

ORCL =

(DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = TIGER2)(PORT = 1521))

   (CONNECT_DATA =

     (SID = ORCL)

   )

)

EXTPROC_CONNECTION_DATA =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

    )

    (CONNECT_DATA =

      (SID = PLSExtProc)

      (PRESENTATION = RO)

    )

  )

ORACLR_CONNECTION_DATA =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

    )

    (CONNECT_DATA =

      (SID = CLRExtProc)

      (PRESENTATION = RO)

    )

  )

6. listener.ora contains:

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)

      (PROGRAM = extproc)

    )

    (SID_DESC =

      (SID_NAME = CLRExtProc)

      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)

      (PROGRAM = extproc)

    )

  )

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

      (ADDRESS = (PROTOCOL = TCP)(HOST = TIGER2)(PORT = 1521))

    )

  )

DEFAULT_SERVICE_LISTENER = (XE)

This post has been answered by mNem on Nov 6 2017
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 4 2017
Added on Nov 5 2017
11 comments
8,435 views