This following paragraphs should explain the problem, even though you are
using servlets instead of applets.

The communication between an applet that uses the JDBC Thin driver and the
Oracle database happens on top of Java TCP/IP sockets.

In a JDK 1.0.2-based web browser, such as Netscape 3.0, an applet can open
sockets only to the host from which it was downloaded. For Oracle8 this
means that the applet can only connect to a database running on the same
host as the web server. If you want to connect to a database running on a
different host, then you must connect through the Oracle8 Connection
Manager. For more information, see "Using the Oracle8 Connection Manager".

In a JDK 1.1.1-based web browser, such as Netscape 4.0, an applet can
request socket connection privileges and connect to a database running on a
different host from the web server host. In Netscape 4.0 you perform this by
signing your applet (that is, writing a signed applet), then opening your
connection as follows:

netscape.security.PrivilegeManager.enablePrivilege

("UniversalConnect");

     connection = DriverManager.getConnection

("jdbc:oracle:thin:scott/tiger@dlsun511:1721:orcl");


Hope that helps!







----- Original Message -----
From: Jian Li <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 01, 1999 11:43 PM
Subject: off-topic: SQL query works well by servlet but failed by applet


> Hi, All,
>
> I searched the archives, found some solutions but still can not solve my
> problem.:-q
>
> I am using Apache 1.3.9, Solaris 5.7, JDK 2, JSDK1.2.1, Oracle 8.0.5.  I
> have a servlet doing query from a database on the other server, it works.
> But when I do test on applet with same driver, jdbc:oracle:thin, username,
> passwd, it failed.  The error message is:
>
> Exception
> occurrednetscape.security.AppletSecurityException:security.Couldn't
> connect to 'xxx.xxx.xxx.xxx'with origin from 'xxx.xxx.xxx.xxx'.
>
> I have tried numbered IP and named IP, set classpath to current directory,
> disable/enable java security in Netscape, but none of them works.
>
> Any idea?  Pls reply to me if it may bother others.  Thx in ad.
>
>
> Best Regards,
>
> Jian
>
> **********************************************
> Name:  Jian Li
> Addr:  2900 Kingstown Rd. Apt. 732
>        Kingston, RI 02881
> Tel:   401-782-8974(h)/874-4579(o)
> Email: [EMAIL PROTECTED][EMAIL PROTECTED]
> URL:   http://www.ele.uri.edu/~lijian
> **********************************************
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to