🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19033

Netscape applet security request

#19033
From: Max Polk
Date: Mon, 16 Mar 1998 00:00
55 lines
2148 bytes
I wish to make a call to netscape's security manager to ask the user 
permission to connect to a database on a different host than the 
applet source.  The only problem is that the scope of the permission 
exists from the point the call is made to the end of the current block 
of code.

The problem I have is that JBuilder places initialization of all the 
database stuff in instance data members outside of any method, as in:

public class MyClass
{
     DatabaseThing db = new DatabaseThing ("parameter", etc.);
     // actually connects to data source above, and gets initial data

     public MyClass ()
     {
          // etc.
     }

     public SomeMethod ()
     {
          // etc.
     }

     // etc.
}

How can I get into the scope of the DatabaseThing object?  In Java it 
appears that instance data is initialized prior to the constructor, 
right?  And yet I have to make the security permission call in the 
same block of code as the database activity is occurring.

I can't place it in the constructor, or in SomeMethod, or in the 
DatabaseThing constructor, or DatabaseThing initializer, since these 
aren't in the right scope.

How can I make a function call to netscape's security manager and 
ensure that all database activity occurs following the call in the 
same block of code, as in:

     somethingSomewhere ()
     {
          // security manager call here

          // all database activity here

          // program ends
     }

I can't use main since it appears that in Java, you fall off the end 
of main just as the program begins, and something in AWT takes control 
of the reference to the object main is in until you exit.

Help!  Any ideas?
Technical Details
Message-ID: <MPG.f77b08fecf36c8e98969c@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,4fb6ec4e5106c50f,start
X-Google-Attributes: gidf74b3,public
From: polk@sprintmail.com (Max Polk)
Subject: Netscape applet security request
Date: 1998/03/16
Message-ID: <MPG.f77b08fecf36c8e98969c@forums.borland.com>
X-Deja-AN: 334758305
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language