Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Socket Permissions  RSS feed

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using an applet and JDBC to access a database, and have successfully connected from my own machine which is the applet host.
This has been achieved by running oracle connection manager on the database host and setting up the necessary socket permissions on my own machine.
The problem I now have is that I want to deploy my applet from my machine, using ms personal web server, allowing another client to access the database via the applet hosted on my machine.
Unfortunately when an atempt is made to connect via the applet I get the error
java.security.AccessControlException:access denied(java.net.SocketPermission {database host} resolve)
Since the client is required to be able to use any machine on the internet, it is not really practical for each client machine to have a policy file set up, and I think though I may be wrong here that similar concerns make signed applets a problem because I believe they require the client machine to have a file of trusted applets (again I am not sure of this).
I would be very grateful if anyone could tell me how to get round this problem, or indeed if it is not possible for a connection to be made to another machine than the one from which the applet has been loaded
Thanks, Garry
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It comes from the definition of the applets that they can access the resources of the system on which they are created. if u are connecting to some database u are using the socket on the system .
so if u deploy the applet the applet will try to access the socket on that system .
so the solution what i can suggest is that don't give the database access directly to the clients. create a mediator between the applet and the database. your applet will communicate with that mediator and that will in turns fetch the database for applet.

------------------
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!