cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC connection through firewall

Paolo_22
Occasional Visitor

JDBC connection through firewall

I need to establish a JDBC connection from a Java application using JDBC Thin
driver to an Oracle DB passing through a firewall.
If the firewall rules are set to use IP authentication the connection works
fine, but if firewall rules are set to enable the communication only on port
1521 the connection doesn't work.
I have already read a document saying to place the parameter
"USE_SHARED_SOCKET = TRUE" in the Windows Registry of DB server, I tested it but without success.
The connection string I'm using is:
("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbho
stname)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=sid)))", user, password)

3 REPLIES
Tom Jackson
Valued Contributor

Re: JDBC connection through firewall

Hi Paolo:

Could the thin driver be causing a problem? The OCI driver is supposed to be more secure and have more capability. In fact I remember reading that you should not use the thin driver for production systems due to security reasons.

Tom
Indira Aramandla
Honored Contributor

Re: JDBC connection through firewall

After set the parameter
"USE_SHARED_SOCKET = TRUE" in the Windows Registry of DB server, did you Restart Oracle and the listener? You need to do this for the parameter to take effect or the listener will not run properly.

Make sure that the script is written in the right directory of the registry.

if there are more than 1 Oracle Home:
- the first version installed will always looks for the parameter in: HKEY_Local_machine\software\oracle, while the second version will looks in HKEY_Local_machine\software\oracle\home#
- 8i always looks in HKEY_Local_machine\software\oracle\home#
Never give up, Keep Trying
Rob Frisch
Occasional Visitor

Re: JDBC connection through firewall

In the connect string for the client, you also need to have (SERVER=DEDICATED). With USE_SHARED_SOCKET=TRUE on the server, this will allow two way communication over port 1521.