Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC using Applets

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to insert data in a databse table
thru an applet but it gives security manager exception
but when i try do same thing thru java application no such exception is thrown can anyone tell what is the role
of this security manager.Does it only implement security check
on applet ?
 
Fred Abbot
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
since the applet is going onto diffrnet systems the security manager doesnt allow certain things do be done as technically you can delete someone elses harddrive send viruses etc...
where as in a stand alone application you do not have these problems
 
Harish Kashyap
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi gaurav,
The system will not allow any applet to access data from any other data resource although it may be present on your system.
This feature was introduced into JDK1.2 .
Anyway, I have the solution to your problem.
Do as i say--
1. Open the command prompt.
2. type policytool and press enter.
you should get an applet opened. Read everything carefully.
it will say something like " ....not found in.... directory"
remember this file name and path.
3. press "add policy" button.
4. set "all permission" and addthis line to the textfield on top
"file://....class" (name of your applet)
then press "done".
5.open file menu and save the policy as the file name .java.policy wherever it asks to store.
now you can run your applet.
if you did it successfully and correctly it will run perfectly.
o.k.
let me know your progress.
bye
Harish

------------------
 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Harish
It has cleared my doubts

[This message has been edited by Gaurav Chikara (edited June 14, 2000).]
 
AnandGattu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
you can do in another way also.
you send the information from an applet to a normal application
or servlet thru I/O streams.from there you can connect to database.
hope it will also help u while programming Applet to Servlet communications.
from
Anand
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic