Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Contractors Search

 
bharat kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My assignment is Home Improvement Contractors,
In the DB interface the method for find is
// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. 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);
In the design i should have the JComboBox with the fields in database file to search for particular field or i should have a textfield for each field so that the user can search for the combination of fields.
If any one who had done this assignment earlier could suggest me the way they implemented.
Thank You,
Bharat.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bharat
Welcome to JavaRanch.
Please change your displayed name to match the JavaRanch naming policy. You should display your last name, and either your first name or the initial of your first name. You may change it here.
There has been at least one case in the past where people have failed their assignments, and a comment from the examiner was that the user did not provide JComboBoxes. I have not heard of any problems the other way though - people providing only JComboBoxes do not seem to have any problems. (I did the older assignment (Fly By Night Services) and only had JComboBoxes. My GUI got 100%.)
So I would definately recommend JComboBoxes.
Regards, Andrew
 
bharat kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Andrew,
thanks for your suggestion.
is it o.k the displayed name now.
One more question the original interface DB provided by sun does not have any methods for getting the list of contractors. i have seen many posts that we should not modify the original interface, now i am having one more interface called DBMain which extends DB, in my Data access file i am implementing DBMain.
But in instructions it says
Your data access class must be called "Data.java", must be in a package called "suncertify.data", and must implement the following interface:
Is that Data Access class should implement DB only.
Thank you,
Bharat.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bharat
is it o.k the displayed name now.

Perfect. Thank you.
Is that Data Access class should implement DB only.

This has been discussed several times, and the consensus seems to be that you:
  • Must implement all the methods in the interface.
  • Must not change the interface in any way.
  • May add methods to your Data class if you want to.
  • Alternatively you may add methods to a class that extends Data class.
  • Do not have to use all the methods of Data class in your GUI.
    Regards, Andrew
  •  
    Consider Paul's rocket mass heater.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic