Informix JDBC Driver Programmer's Guide
Chapter 3: Troubleshooting
Contents
Index
Browser Security Issues
When you use the
JDBC
API
in a Java applet, you can only connect to the computer that is running the Web server that originally delivered the applet. This limitation, along with other security limitations, is often referred to as Java's
sandbox
.
The
JDBC
API
code in the applet must reference the same computer as the Web server in the
URL
passed to the
DriverManager.getConnection()
method. Any attempt to connect to an Informix database or database server on a computer different from the computer that delivered the applet causes a security exception and results in an
SQLE
xception
error similar to the following message:
Attempt to connect to database server (production) failed.
This security limitation is imposed by the browser used to view the Java applet. The exception does not occur if you use the JavaSoft
appletviewer
command to view the Java applet.
Informix recommends the following two strategies for handling this browser-imposed security limitation; the best strategy depends on how you are planning to use your Java applet:
Put the Informix database server and the Web server on the same computer.
This is a good solution for intranet use, since putting the database server and Web server on the same computer is not necessarily a security risk. This strategy, however, might be too risky for Internet use.
Use a multi-tier approach, such as
RMI
(Remote Method Invocation) or
CORBA
(Common Object Request Broker Architecture).
In this strategy, the middle-