aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes About Urly Bird 1.2.0 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 "About Urly Bird 1.2.0 " Watch "About Urly Bird 1.2.0 " New topic
Author

About Urly Bird 1.2.0

Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
I got urlybird assignment 1.2.0. can you please tell me which of following functions to be performed.

1. create new records
2. delete existing records
3. update existing record
4. find existing record based on criteria

should i perform all the above mentioned functionality. or some of these.


javascript:void(0);
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4388
    
    8

Hi Ammar. Welcome to the Ranch!

Doesn't the assignment tell you what the requirements are?
Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
Matthew Brown wrote:Hi Ammar. Welcome to the Ranch!

Doesn't the assignment tell you what the requirements are?



it contains an interface Db which has all these methods like create, delete, update, search etc

but in the description of user interface it says as follows

The User Interface

The user interface for this assignment must satisfy the following criteria:
It must be composed exclusively with components from the Java Foundation Classes (Swing components).
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
It must present search results in a JTable.
It must allow the user to book a selected record, updating the database file accordingly.
Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs.

now here i am confsed whether to implement all functions
or just search, book(update) only as described above.
Sarah Archer
Greenhorn

Joined: Jul 25, 2010
Posts: 19
My instructions contained the following text:

Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface ... interface DB


I interpreted this to mean that I had to implement all the methods in the interface irrespective of whether they are used by the GUI.

Dennis Grimbergen
Ranch Hand

Joined: Nov 04, 2009
Posts: 140

Ammar Shah wrote:

it contains an interface Db which has all these methods like create, delete, update, search etc

Create the required interface in the required package. You must implement this interface in your Data class.
Ammar Shah wrote:
but in the description of user interface it says as follows
....
....
now here i am confsed whether to implement all functions
or just search, book(update) only as described above.

You must implement all functions in your Data class. However, your GUI only uses limited funtionality (search and book). So your GUI only uses the read, find and update, lock and unlock methods, and not create and delete.
I hope this makes it a little more clear to you
Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Ammar Shah wrote:now here i am confsed whether to implement all functions


You only need to implement *must* requirements. They are the statements in your instructions that have *must* in them.

Ammar Shah wrote:or just search, book(update) only as described above.


Yes, you only need to implement search and book in your GUI.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

You could always try to submit your assignment and implement only the methods in the Data class which you use in your application. For the other methods you can throw an UnsupportedOperationException and give a good explanation why you did that. And then hope that the accessor agrees with that approach. From one side you are not violating the must requirement, because you have implemented the interface. On the other hand you take of course a big risk and might get failed for doing so. So if you want to be on the safe side: just implement every method from your interface and in your GUI provide only "find rooms" and "book room" functionality.

Good luck!


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
i have achieved following functionalities regarding this assignment successfully for client side.

1. Read
2. Update
3. Delete
4. Search
5. Lock
6. Unlock

all are working fine and i have tested them all quite carefully. there are certain issues which i am facing can you please help me to resolve these issues.

1. I have to get the deleted records no in an array so that i can utilize this array for further use. can any body suggest me how i can get an array containing record numbers for all deleted records in the db file.

i have written a function for this purpose but it returns my only 1st deleted record but not further record. can you please suggest some changes in code to achieve my functionality.

here is the code

[edit] do not post actual code snippets

2. Should same GUI class to be used for both client and server mode. i.e. the main gui for client and server should be same or there can be separate gui for client and server.

3. i am unable to get total no of records in the db file. can any body suggest me as how to get the total no of records in the database so that i can create a jtable rows equal to total no of records in the db file.



please help me in resolving these issues.

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

1/ Why would you need an array with all record numbers of deleted records in the 1st place? And why would you go with an array? Why not simply use an ArrayList for example and then convert it into an array if you really need an array.

2/ I tried to reuse as much as components of my GUI as possible. So my main application window is used in both the standalone client and network client (that's something you would expect because both applications are exactly the same). I have a panel with configuration settings which is shared in the server window and client config window.

3/ Why would you need the total number of records in the database? You do not need it at all.
Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
infact i need deleted records because when in reading records from db file my function get all records from file including deleted records too which are displayed in jtable. i want to get deleted records nos so that i could remove those record no from jtable.


and secondly i want to get the total no of records so that i can create jtable rows equal to total no of records. similarly when reading,searching records from database file i do not know to run loop upto how many times.
thats why i need total no of records so that i can utilize to determine the exact length of the loops in my program.



Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

That's weird logic you are implementing. Maybe you have to think a bit further about this.

A little hint: my find-method only returns valid records (so records which are not deleted). Why would you return deleted records from your find-method
Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
thanks alot for your logic . i got the understanding about deleted records.
now what about total no of records..............?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

Why do you want to know the total number of records? Do you want to display it in your application?
Ammar Shah
Greenhorn

Joined: Jul 15, 2011
Posts: 7
i wanted to know the exact no of records as my read function takes record no as argument and returns data against that record no which is to be displayed in the jtable.

so i have to use read function in loop like this

String arg[];
for(int k=0;k<32;k++){
arg=dbi.readData(k);
}

now from myself i have given the length of this loop 32 because i do not how many records are there in the db file. i assume that there are 32 records in db file.

i wanted to get the total no of records in db file so that i can use them in this loop.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

I would think your find-method returns the record numbers of the records you need to display in the JTable, doesn't it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About Urly Bird 1.2.0