Forums Register Login

method doesnt work when invoked from applet!

+Pie Number of slices to send: Send
Hello

Let me tell you what I've done so far... I've got an applet class and a class that deals with database queries...(both combile without problem)



When i call the ItemDB.add() method from the applet, it doesnt work (nothing happens! & the item isnt added)...

can someone please suggest a solution?

thank you
Hannah
[ January 04, 2006: Message edited by: H Melua ]
+Pie Number of slices to send: Send
So I guess when you say "the code here works fine", what you really mean is: "the code here doesn't work fine"

It's hard to say what code you don't show us might or might not be doing. But the combination of applets and databases suggest two possible problems, both related to the restricted privileges of applets:
- the DB host is not accessible to the applet (because applets can only connect to the host where they were served from)
- the driver classes are not part of the applet (or use native libraries), and so the driver can't instantiate them

You can information on how to work around these issues here.

If it's neither of these, you can post the relevant code with an indication of where it fails to execute properly.
+Pie Number of slices to send: Send
it works because i tried it and it added a record to the database with no reported problems

i'll check your link and get back to you

here it is

thank you
Hannah
[ January 04, 2006: Message edited by: H Melua ]
+Pie Number of slices to send: Send
Ok i've seen the policy file, but what do i change in particuler?
[ January 04, 2006: Message edited by: H Melua ]
+Pie Number of slices to send: Send
Adding something like the following should do the trick:
+Pie Number of slices to send: Send
 

http://YOUR.SERVER.HERE


i dont know the value for this
+Pie Number of slices to send: Send
Something like "www.mycompany.com", or "localhost:8080", or whereever the applet is hosted.
[ January 04, 2006: Message edited by: Ulf Dittmer ]
+Pie Number of slices to send: Send
 

i dont know the value for this



in english, where do i find it?
thanks
+Pie Number of slices to send: Send
How do you access the applet if you don't know what server it's hosted on? How do you upload it?
[ January 04, 2006: Message edited by: Ulf Dittmer ]
+Pie Number of slices to send: Send
you see, i use BlueJ and by creating an applet class, i write click on the class object and choose "Run Applet", i get these options
(blueJ if u havnt tried it is an educational java tool supported by Sun, works differently to JBuilder and Jgrasp
http://images.apple.com/downloads/macosx/development_tools/images/bluej130_screen.jpg)

- Generate webpage only
- Run applet in appletviewer [thats what i choose]
- Run applet in web browser

!

in the appletviewer, there is an Applet menu>>>>Properties>>>>
- http Proxy server (with an empty field)
- http proxy port ('80')
- Class access (option- 'Restricted'/'Unrestricted')
(Command buttons 'Apply', 'Reset' & 'Cancel'

it was on restricted, but now i changed it, and i dont know if it will make any difference, because i'm still debugging my code, so i havnt checked!
[ January 04, 2006: Message edited by: H Melua ]
+Pie Number of slices to send: Send
In that case, if you run the applet locally in your browser, make a note of the URL you see there. It should be something like "file:///path/to/directory/index.html". Then you can use "file:///path/to/directory/-" instead of "http://YOUR.SERVER.HERE/PATH.TO.YOUR.APPLET.HERE/-". Just remember to add the proper policy for the server later.
+Pie Number of slices to send: Send
Moving to applet forum now that we are discussing policies.
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1089 times.
Similar Threads
addKeyListener() help needed plz
problem with executing javascript of the login button
applet loading forever...
extends Thread Vs Implements Runnable
Applet question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:23:30.