aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S Database file 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 "B&S Database file" Watch "B&S Database file" New topic
Author

B&S Database file

preethy sekhar
Greenhorn

Joined: Aug 15, 2008
Posts: 17
Hi All,

name - location - specialties - size - rate - owner

1.Buonarotti & Company - Smallville - Air Conditioning, Painting, Painting - 10 - $40.00
2.Philharmonic Remodeling - Atlantis - Heating, Carpets, Carpets - 3 - $50.00
3.Buonarotti & Company - Bali Hai - Plumbing, Air Conditioning, Air Conditioning - 9 - $70.00

The specilaity of the particular contractor is repeated twice. Does this mean any thing special? Or Just I have to ignore this.

Sorry if it is going to be a very silly question.

Thanks,
Preethy Sekhar
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

No need to worry about it


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
preethy sekhar
Greenhorn

Joined: Aug 15, 2008
Posts: 17
Thanks a lot! and one more clarification.

"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"

As per the above statement, if the customer asks for the service say Air Conditioning, then the system should display all the records where this service is the only speciality and also the records where this service is one of the speciality of the contractor.

Then which means the customer books a contractor (whose speciality is Painting and Air Conditioning) for Air Conditioning service actually blocks the other customer who is in need of Painting. Say Painting is not the speciality of any other contractors, then for the other customer, display will be empty when he searches for Painting.

Please clarify me on this.

Thanks,
Preethy Sekhar
Thomas Thevis
Ranch Hand

Joined: Sep 02, 2008
Posts: 87
Hello Preethy,

I had issues with the same formulation as you. First of all, English ist not my first language. However, as I read it, you have to provide a search functionality in your GUI which allows to retrieve database records with given name and/or location. Additionally, it must be possible to load all database records into your JTable. There is no need to search for specialties, hourly rates or any other record entry.
Nevertheless, for meeting your database interface requirements, you will probably have to implement some sort of prefix search for all fields on the database server side. If you opt for implementing some kind of business layer in between, this will most likely be the place to convert the GUI's search request into a valid database search.

Thomas


SCJP 5.0, SCJD in progress
preethy sekhar
Greenhorn

Joined: Aug 15, 2008
Posts: 17
Hi,

Thanks for your replies.

"They take requests from home owners for a type of service, and offer the homeowner one or more contractors that can provide the required services"

According to this, I feel speciality field plays a role in this assignment.

"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"

I feel here the "data" mainly refers to the specialty field. (ie., type of service needed by the customer).

Suppose customer needs Painting service. And Painting service is provided by Contractors NameA, locA and NameB, locB. Then choosing any one of the contractors by specifying the name and location, in order to book.

Please confirm me whether my assumptions are right or not.

Thanks,
Preethy Sekhar
Thomas Thevis
Ranch Hand

Joined: Sep 02, 2008
Posts: 87
Hello again,

I think there are two challenging targets:
  • Improving usability, and on the other hand
  • keeping it simple ("A clear design, such as will be readiliy understood by junior programmers, will be preferred...").

  • I don't want to persuade you not to search for specialties, but in my understanding of the assignment, this is not a necessary feature. The CSRs are able to search for specialties in the provided JTable as well. If they wanted us to search for specialties, I would expect the "and/or" phrase would state "specialties" explicitly.

    One last thought:
    Suppose you have a similar assignment as me and you have to implement a prefix based search on the databse side. How do you convert your wanted specialty into a search query for your database. I think that is the really tough point where the simplicity restriction could be violated.

    Best Regards,
    Thomas
    preethy sekhar
    Greenhorn

    Joined: Aug 15, 2008
    Posts: 17
    Hi,

    Fine. Thanks for clarifying. Your reply was clear.

    I need another different clarification which is regarding find method.

    Condition:
    'A non-null value in criteria[n] matches any field value that begins with criteria[n]'. (For example, "Fred" matches "Fred" or "Freddy")
    public int[] find(String[] criteria);

    fred
    freddy
    fred & company
    Jefreddy

    Here if the field value begins with 'fred' and followed by any letters/words, then that would be identified.

    But if the field value has fred but not in the beginning of the field, then would the find method identifies this record?

    Hope also in this, I will be get clarified.

    Thanks,
    Preethy Sekhar
    Thomas Thevis
    Ranch Hand

    Joined: Sep 02, 2008
    Posts: 87
    Hi Preethy,

    But if the field value has fred but not in the beginning of the field, then would the find method identifies this record?

    No.
    'A non-null value in criteria[n] matches any field value that begins with criteria[n]'

    The semantics should be the same as in String.startsWith().

    Regards,
    Thomas
    preethy sekhar
    Greenhorn

    Joined: Aug 15, 2008
    Posts: 17
    Hi

    Thanks!

    Thanks for clearing my every doubts.

    when other doubts comes, I 'll ask you for sure.

    Thanks,
    Preethy Sekhar
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: B&S Database file