Establishing a Connection Through a Firewall

Another constraint that you may have to deal with when accessing a remote database is the use of firewalls. Firewalls allow only desirable connections between networks. This means that under normal circumstances, a firewall will prevent your applet from connecting to a database located on the other side of the firewall. The solution to this problem is to use a firewall that supports Net8. Additionally, you need to use yet another special form of the Net8 connection string.

Configuring a Firewall for Net8

Firewalls use a set of rules to determine which clients can connect through them. These rules are based on a client’s hostname, DNS alias, or IP address. A firewall goes through several steps to determine whether to allow an applet to connect and compare a client’s hostname against its set of rules. If a match is not found, the firewall extracts the IP address of a client and compares it with the rules. Since an applet has restricted access to the local system, the JDBC Thin driver cannot get the name of its host to pass in its connection request. You must, therefore, configure a firewall to allow connections from the applet’s IP address.

Warning

You must also never allow the hostname _ _jdbc_ _ to be used in a firewall’s set of rules. This literal has been coded into Net8-compatible firewalls to force the lookup of the IP address. If you inadvertently add this hostname to a firewall’s set of rules, any Oracle JDBC Thin driver will be able ...

Get Java Programming with Oracle JDBC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.