File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes REG: Applet Database Connectivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "REG: Applet Database Connectivity" Watch "REG: Applet Database Connectivity" New topic
Author

REG: Applet Database Connectivity

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
hi,
i am trying to run the applet using appletviewer and getting the following error
java.security.AccessControlException:access denied(java.util.PropertyPermission oracle.net.wallet_location read)

I think this is due to the limited permissions assigned to the applet, so how and where to grant this permission can any body please say, will appreciate it.

Thanks and Regards
Adeeb
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42600
    
  65
See HowCanAnAppletReadFilesOnTheLocalFileSystem


Ping & DNS - my free Android networking tools app
adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Thanks for replying Ulf.
But i am unable to do that. After trying a lot also i face the same error. Here is that simple code can you please help me out of this.


Can you please do some changes necessary to get rid of that exception

Thanks and Regards
Adeeb
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42600
    
  65
What have you tried - applet signing or altering the local policy? How exactly did you go about it? TellTheDetails
adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
i hav tried signing the applet, by seeing the steps in another forum like

1. Create your code for the applet as usual.
It is not necessary to set any permissions or use security managers in
the code.

2. Install JDK 1.3
Path for use of the following commands: [jdk 1.3 path]\bin\
(commands are keytool, jar, jarsigner)
Password for the keystore is any password. Only Sun knows why...
perhaps ;-)

3. Generate key: keytool -genkey -keyalg rsa -alias tstkey
Enter keystore password: *******
What is your first and last name?
[Unknown]: Your Name
What is the name of your organizational unit?
[Unknown]: YourUnit
What is the name of your organization?
[Unknown]: YourOrg
What is the name of your City or Locality?
[Unknown]: YourCity
What is the name of your State or Province?
[Unknown]: YS
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=Your Name, OU=YourUnit, O=YourOrg, L=YourCity, ST=YS, C=US
correct?
[no]: yes

(wait...)

Enter key password for tstkey
(RETURN if same as keystore password):

(press [enter])

4. Export key: keytool -export -alias tstkey -file tstcert.crt

Enter keystore password: *******
Certificate stored in file tstcert.crt

5. Create JAR: jar cvf tst.jar tst.class
Add all classes used in your project by typing the classnames in the
same line.

added manifest
adding: tst.class(in = 849) (out= 536)(deflated 36%)

6. Verify JAR: jar tvf tst.jar

Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/
68 Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/MANIFEST.MF
849 Thu Jul 27 12:49:04 GMT+02:00 2000 tst.class

7. Sign JAR: jarsigner tst.jar tstkey
Enter Passphrase for keystore: *******

8. Verifiy Signing: jarsigner -verify -verbose -certs tst.jar

130 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/MANIFEST.MF
183 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/TSTKEY.SF
920 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/TSTKEY.RSA
Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/
smk 849 Thu Jul 27 12:49:04 GMT+02:00 2000 tst.class

X.509, CN=Your Name, OU=YourUnit, O=YourOrg, L=YourCity, ST=YS, C=US
(tstkey)

s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope

jar verified.

9. Create HTML-File for use of the Applet by the Sun Plugin 1.3
(recommended to use HTML Converter Version 1.3)

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42600
    
  65
And what happened when you did that? Which particular step did or do not work OK? TellTheDetails
Sourav Som
Greenhorn

Joined: Nov 13, 2008
Posts: 3
Hi

I am calling a signed applet from a html.
This applet calls a normal java class which have a call to the DB.

It is throwing an error..

AccessControlException..access denied(java.net.Socket exception 192.168...:port number, connect)
I have a policy file where I have grantedthe permission also.

Please help in this regard.

Thanks in Advance..<br />Sourav
 
jQuery in Action, 2nd edition
 
subject: REG: Applet Database Connectivity