Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read a text file from within an applet?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to get Data from a text file to show in an applet .
what will be the syntax for that ..?

I also want to read data from database and write to text file whenever data in database changes.How it can be done by Java(Syntactically)

The reason for reading via a text file and not directly from database is "to save time from a querry processing each time an applet loads" is it justified?

Please give answers of my above 3 questions
Thanks in advance





 
There are very good examples of file i/o in Java for Students.

One proviso... an applet CANNOT read/write files on your local machine. This is to prevent rogue applets from destroying your hard drive. You need a free-standing Java application for that. Applets CAN read files off the internet, and (I need to test this myself) write them as well.

Assuming that the text file can be easily kept up to date (i.e. automated maintenance), and that the number of records in the text file is a small fraction of those in the database, I would think that reading a flat text file would be faster than running a query each time.

Rose/Miros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top