8

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 proxy settings. Can a simple Java program establish JDBC Connection thru the proxy server?

*To provide an example will be better *

Regards.

2 Answers 2

6

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

Sign up to request clarification or add additional context in comments.

Comments

2

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:

  • nginx proxy
  • haproxy

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/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.