I want to communicate to Oracle DB Server which sits outside my network via the proxy server. I can access the web application hosted on the same machine via Browser with p
Oracle JDBC (and any other JDBC connections to that extent) are not HTTP-based protocols, so the proxying has to be done at TCP layer.
For this reason, you can't use Squid Proxy for example (which only does proxying at HTTP layer), but there are many other proxying services that can work at TCP layer:
On the former there is a nice step by step guide how to setup JDBC proxying using NGINX https://kwjrnl.wordpress.com/2015/07/27/tcp-proxy-with-nginx-for-jdbc-connection/
If the proxy is only a HTTP proxy, then no. But if the proxy transfers TCP/IP trafic, then you can.
How to do that, look at How do I set the proxy to be used by the JVM or http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html