This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet and Database

 
liliana punkt
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to use an Applet to communicate with my database. I don't want to this with a signed applet. Maybe with a servlet, that calls my applet? Is this O.K. concerning Security?
liliana
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi liliana,
i would not prefer writing JDBC connection code in the applet due to following things,
1. client machine will have to have the JDBC driver we are using (we can include that in the JAR file for the applet but that might grow big you know and applet will take time to get downloaded and eat the up client side JVM memory)
2. if the database host is diffirent than the applet host machine then we have to provide permissions on client machine in java.policy file for the socket connection etc...
i think the <applet>+<some other entity on the server side>+<data transfer mechanism> between applet and the sever side entity solutions works fine.
e.g. we can have following things,
1. applet,
2. servlet (or JSP or ASP or something) to communicate data with the applet
3. XML is our data transfer protocol btween applet/servlet
applet sends data to be dumped in the database in XML format to a servlet then servlet communicates with the database to perform operations and it works the similar way for database data requests from the applet...
i hope you got the point i am trying to make...
if you use this servlet or something then the only security issue would come if you are passing critical data between applet and servlet (but that would be there even if you put JDBC connection in the applet, right?)...
others, please throw more light on the security issue in any mechanism we adopt to have applet communicating with the database...i'm not much experienced in these security things...
regards
maulin
 
liliana punkt
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi maulin,
thanks for your reply. I would like to try your recommedation with a servlet.
1. client would connect to my servlet
2. servlet generates the applet via call of a HMTL-page which in turn calls the applet via applet tags.
3.my applet communicates with the servlet via XML-Protocol.
Ad 3) I'm not familiar with this. How does this communication function?
liliana
 
liliana punkt
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi maulin,
thanks for your reply. I would like to try your recommedation with a servlet.
1. client would connect to my servlet
2. servlet generates the applet via call of a
HMTL-page which in turn calls the applet via
applet tags.
3. my applet communicates with the servlet via
XML-Protocol.
Ad 3) I'm not familiar with this. How does this communication function?
liliana
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic