File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Initial display the records in the Table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Initial display the records in the Table." Watch "Initial display the records in the Table." New topic
Author

Initial display the records in the Table.

Olena Golub
Ranch Hand

Joined: Jan 17, 2005
Posts: 113
Dear all,
I am trying to initially display the data from the database file in the Table. I work with my data with the help of Data Class. By initialisation I need one method to read all records from the database file and display this in the table. And this method that I need doesn�t exist in the DB interface.
To change the DB interface and the Data corresponding, I think, it not a good idea.
After I read the schema of the Database file I have a number of records and one method from the DB interface that displays only one record with the given record number:


Can I read all record from the Database in this way?:



This Method will be called from the Controller (MVC).
How do you think is it a good way to read all data? Do you have another idea about initial reading of the records from the database file and displaying this in the Table.
I am very thankful for your comments, advices and help!
Lena
[ February 26, 2005: Message edited by: Olena Golub ]

SCJP 1.4<br />SCJD 1.4 (in progress)
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Olena,

How about searching for all records? This is a method your interface already must contain. Then read all found records and show them in your table.

Frans.


SCJP 1.4, SCJD
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
Olena:

The Data class should only do I/O and caching. The actual business logic should be in some other class. Reading all records would be in that class. It would be like an Adapter from your Data layer.

This is a separate issue from the readAll method that you might implement to cache your records.
[ February 26, 2005: Message edited by: Anton Golovin ]

Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Initial display the records in the Table.