I need to communicate with a database in my Applet program and am at the moment sending the data to a servlet via an IO Stream. Instead of using an IO Stream to send data to a servlet, performing a task, opening a new stream and sending the data back to the applet, is it possible to use an EJB to perform this task for me? i.e. Can I create an EJB in the applet to avoid me having to use IO Streams to send data? Thanks
Actually, it's not good practice for applets to do either database I/O or invoke EJBs. Both processes tend to fail because of intervening firewallss blocking the requests (plus the applet sandbox forbids jdbc in unsigned applets). The more effective way is to have the applet invoke JSPs and/or servlets to do the work and return results to the client. They can do all the EJB and jdbc access they like.
Customer surveys are for companies who didn't pay proper attention to begin with.
I think an applet talking to a session facade bean which then interacts with entity beans is an acceptable approach. So long as firewalls are not a concern. You may have to change the policy file on the client to make this work, however. So, it probably makes sense if you are deploying on an intranet. But, if firewalls are a concern then use either servlets or even webservices in between the applet and EJBs. I am considering the webservice approach for a future project. Steve
we can send the data from applet in the form of datapacket which implements hashtable() this datapacket will goto a servlet and that servlet will do the database related work and return the result in the form of a vector
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door