We need to follow below steps to set this option : -Dsun.net.client.defaultConnectTimeout=5000) through Weblogic Admin Console.
To set this JVM options using the weblogic administration console:
1.In the Domain Structure pane, expand the Servers node.
2.Click the name of the server that you want to configure.
3.In the right pane, click Server Start.
4.Select Lock & Edit.
5.In the Arguments text box, provide the JVM option: enter the following option :
After inserting your options, click Save. Then click Activate Changes.
NOTE: Here 5000 is in miliseconds.
6.Restart the server so that the new settings are used.
By doing this you can also manage the failover time also like 3 attempts x 5 seconds = 15 sec will bringon the failover mechanism