OK guy\gals lets get this straight now, the default sandbox security
model(JDK 1.0/JDK 1.1)
implemented by NAV/IE as per specification is , "An applet can only open a
socket connection to the host from where it came from.  By socket connection
I mean any socket level protocol like HTTP(HTTPUrlConnection), FTP TELNET,
RMI and last but not least JDBC( level 4).

Under JDK 1.1 an applet is allowed to break out of the sandbox and run as a
trusted applet if it has been *digitally signed* and placed in a jar archive
file for NAVIGATOR 3.0/4.0 and placed in a "MS CAB" cabinet file for
Internet Explorer 3.0/4.0.

Under Java2(AKA JDK 1.2) the security model has changed dramatically. Using
the Java Plugging
and security properties files for specific remote classes, it would be
possible for an applet
downloaded from any host to open sockets to any host , not just the host it
was downloaded from.

Cheers
Chris

Bennett Yip wrote:

> Hi, I read you problem in digest version. So I can't reply directly.
>
> I think the major problem is that you haven't download the JDBC driver
> to the client side!
> So the browser try to load the driver from the server side. However, the
> server try to find and load the driver from the server classpath.
>
> convert your html and load the postgresql JDBC driver to the client
> <applet code="sppform5.class" archive="postgresql.jar,spp5.jar"
> width=800 height=400>
>
> ^^^^^^^^^^
>
> And there is one limitation. It is the connection URL.
> For example:
> On the browser, your URL is http://localhost/~bennett/sppform5.html
> you can only connect your database with
> jdbc:postgresql://localhost/testdb
> or
> On the browser, your URL is
> http://192.XXX.XXX.XXX/~bennett/sppform5.html
> you can only connect your database with
> jdbc:postgresql://192.XXX.XXX.XXX/testdb
>
> This mean your web server and database server must be running on the
> same machine!
>
> If you want to separate the two server on two machine, you can't have
> JDBC connection directly with the database server over LAN/Internet.
> (especially via firewall)
>
> If I were you, I will use Applet-Servlet communication. I now use it for
> my final year project and it works fine.
> The Applet can use ObjectInputStream/ObjectOutputStream to receive/send
> pure java objects with the Servlet. And the Servlet communicate with the
> database server which is located on the same network. Therefore, most of
> the network problem can be solved. And also the
> postgresql.jar(jdbc6_4.jar) is very large(over 100KB) for Internet
> client. Using Applet-Servlet communication for your work, your clients
> don't need to download the JDBC driver.
>
> I use Linux as the server and every os which have Java Plug-in 1.2 as
> the client in my final year project.(cos I am using Swing. It make my
> applet more beautiful)
>
> Bennett.

Reply via email to