problem with accessing a database from an applet
hello friends ,
i have created a database in mysql.also i created an applet.when i checked it with appletviewer, it ran successfully by retrieving data from the database and displayed the data. but theproblem is that retrieval from the databse wont work when the applet is run in a web browser and also from the localhost.
plz help me in this issue.
# 2
Its been a long time since I worked with applets and I may not be correct in this:
From what I recall if you run the applet from an application on your desktop, it may be able to access the database. However, if you run it in a web page it will not access the database because of security reasons. The browser does not typically let web pages access the user's hard disk or other resources such as a database. Instead, requests from a browser web page for database data is sent back to the server which runs a servlet which actually gets data from the database.
If your building a web page, I suggest you display your data with html tables and html textfields and not use applets. We dont use applets because of various problems with them. I suggest for web pages, you may want to get a book on JSP pages and not use java Swing components.