*
The moose likes Applets and the fly likes Applet and Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet and Database" Watch "Applet and Database" New topic
Author

Applet and Database

liliana punkt
Greenhorn

Joined: Dec 23, 2002
Posts: 16
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

Joined: Nov 04, 2001
Posts: 1871
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

Joined: Dec 23, 2002
Posts: 16
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

Joined: Dec 23, 2002
Posts: 16
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
 
 
subject: Applet and Database
 
Similar Threads
my applet can't connect to database
database connection from applets
How to print from an applet
Design Question
passing values from servlet to Applet