Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jdbc applet works from command line but not on web page...

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Im pretty new at java, and im trying to create an applet that connects to a database on a remote machine. So far, I have been able to connect to the database if i invoke the appletviewer from the command line like this:
C:\java>appletviewer protocols.html
where protocols.html looks like this:
<title>Protocol Database</title>
<APPLET CODE=JdbcApplet2 codebase="." archive="" width="400" height="175">

and JdbcApplet2 is the applet code that connects to the database. I found out that to envoke the applet from the command line, i had to have a file in the same directory called DbaApplPol.txt that has the following lines in it:
grant {
permission "developer", "resolve";
"", "connect,resolve";
grant {
permission java.lang.RuntimePermission
permission java.util.PropertyPermission
"file.encoding", "read";
to grant the applet permission to access the database. This combination of JdbcApplet2 code, DbaApplPol.tx, and invoking the applet from the command line works, and does exactly what it is supposed to do. however, when i load up the web page by itself (not from the command line, just double-click on the icon from my C:\java\protocols.html), the applet does not work. I believe it is because the applet when loaded in the web page cant utilize the DbaApplPol.txt permissions file. So if this is the case, how can I get the browser to recognize the permissions set up in the DbaApplPol.txt file? Or is there some other way people do this?

First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic