The network adapter could not establish the connection - Oracle 11g

后端 未结 2 1713
深忆病人
深忆病人 2020-12-01 17:27

I wrote a servlet program and I want it to connect to my Oracle database but its giving me an error. I am using Eclipse Helios, Tomcat 6.0.37, Oracle 11g (11.2.0.1.0), ojdbc

相关标签:
2条回答
  • 2020-12-01 18:09

    I had the similar issue. its resolved for me with a simple command.

    lsnrctl start
    

    The Network Adapter exception is caused because:

    1. The database host name or port number is wrong (OR)
    2. The database TNSListener has not been started. The TNSListener may be started with the lsnrctl utility.

    Try to start the listener using the command prompt:

    1. Click Start, type cmd in the search field, and when cmd shows up in the list of options, right click it and select ‘Run as Administrator’.
    2. At the Command Prompt window, type lsnrctl start without the quotes and press Enter.
    3. Type Exit and press Enter.

    Hope it helps.

    0 讨论(0)
  • 2020-12-01 18:12

    First check your listener is on or off. Go to net manager then Local -> service naming -> orcl. Then change your HOST NAME and put your PC name. Now go to LISTENER and change the HOST and put your PC name.

    0 讨论(0)
提交回复
热议问题