Layer7 API Management

Expand all | Collapse all

JDBC connection error

Jump to Best Answer
  • 1.  JDBC connection error

    Posted 05-23-2017 03:39 AM

    Hi All,


      I am not able to establish connection with Oracle 10g while doing JDBC test am getting below error, can you please help to get it fixed.



    Testing failed:invalid connection properties setting.

    [l7tech]Oracle JDBC Driver] Error establishing socket to host and port: Reason:No route to host



    My connection details are like below:

    Driver Class:

    JDBC URL : jdbc:l7tech:oracle://;ServiceName=XE

    username= system





    1)Oracle server is running on windows machine.

    2)Am not able to ping my windows machine(where Oracle is running) from my gateway appliance, but I can able to ping from my windows machine to gateway appliance. So what network settings might be wrong here?


    We are using NAT network adapter for gateway appliance.



    Thanks in advance....


  • 2.  Re: JDBC connection error
    Best Answer

    Posted 05-23-2017 08:53 AM

    Hello ,


    You can ping from Windows to the gateway but u cant ping from Gateway to Windows Machine. That only means that gateway is open which is replying to your ping request but as Windows is not able to reply the gateway ping request, there is something blocking the gateway request in the Windows. 


    Please first check that if any firewall is blocking your ping request in the Windows Machine. 
    Ping using only the IP. If you need to ping using the hostname then do Map the IP  to the hostname in the Windows Machine by going into the c: /Windows/system32/drivers/etc/hosts.


    While Connecting to the user which is 'system' in your case. You need to run a grant all permission script for the user 'SYSTEM' with the machine IP you're accessing the DATABASE.

    Please check the JDBC URL ur entering I guess it should be in below format



    Please Correct me if I am Wrong.



    Thanks !!!

  • 3.  Re: JDBC connection error

    Posted 06-07-2017 05:41 PM

    Make sure your DNS on Gateway is correctly configured. Make sure Firewall is not blocking ping and tcp port 1521 to and from Gateway.


    Next is to see if an explicit entry in the hosts file will solve the issue. Log into Gateway linux machine and get to root command line. Next type "Vi /etc/hosts" and add the <IP> <hostname> on a new line and save and exit the file (:wq). (EX: Then try to test your JDBC connection again or you could also issue a ping from Gateway to your Windows machine.


    If still having an issue then you may need to add some Static IP Routes to the routing table in standard linux manner or refer to our documenation below:

    Adding Static Routes
    Modification of Static Routes will require that the administrator connect to the root shell to add additional configuration. The steps below will outline what is required to enable this.

    1) Connect to the Gateway using either Console, ILOM or SSH as the ssgconfig user account

    2) From the ssgconfig menu, select option "3) Use a privileged shell (root)"

    3) At the root prompt add a new file /etc/sysconfig/static-routes

       any net <NETWORK> netmask <NETMASK> gw <GATEWAY> <DEV>

        any net netmask gw eth0
        any net netmask gw eth0

    4) (An alternative method) At the root prompt add a new file /etc/sysconfig/network-scripts/route-ethX with X representing the interface value. For every interface a file needs to created that associates static routes with the interface.There are 2 syntaxes that can be used.
    a) Legacy mechanism defines the GATEWAY, NETMASK and ADDRESS for each route explicitly.




    b) Modern mechanism uses CIDR notation to denote the subnet. (Recommended)

     <network/cidr> via <gateway>

    Example: via via

    5) Once all the static routes are in place, reboot the Gateway to ensure that all routes are properly established.