Re: Connect Socket problem - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: Connect Socket problem
Date
Msg-id 20030619090530.C19922@bacon
Whole thread Raw
In response to Connect Socket problem  ("Rodrigo F. Baroni" <rodrigobaroni@yahoo.com.br>)
List pgsql-jdbc
On 19/06/2003 06:44 Rodrigo F. Baroni wrote:
> Hello all,
>
>     Please, could someone help me ?!
>
>     I did a applet, using a jdbc driver to connect
> with postgres 7.3.1 in a RedHat linux 8.0. When I run
> it from my own machine to connect with the postgres in
> my  PC it works fine, but when I run the applet to
> connect to a remote server postgres, the driver
> returns the follow error (got at exception) :
>
> " Something unusual has occured to cause the driver to
> fail. Please report this exception: Exception:
> java.security.AccessControlException: access denied
> (java.net.SocketPermission XXX.XXX.XXX.XXX:5432
> connect, resolve) "
>
>   And the Sack Trace follows:
>
> "java.security.AccessControlContext.checkPermission(AccesscontrolContex.java:270)
> .... "
>
>
>    Does anybody have any suggestion ?!!

Its the Java security manager. By default, this will only allow an applet
to connect to its web server. You must either run postgres on the same
machine as the web server or edit the jre/lib/security/java.policy file on
your client PC to allow the applet to connect to your postgres machine.
There are ecellent tutorials on applets and security on Sun's Java web
site (http://java.sun.com).

HTH


--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: "Rodrigo F. Baroni"
Date:
Subject: Connect Socket problem
Next
From: Dave Cramer
Date:
Subject: Re: forName finds Driver but getConnection doesn't (AGAIN)