• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

About Urly Bird 1.2.0

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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);
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ammar. Welcome to the Ranch!

Doesn't the assignment tell you what the requirements are?
 
Ammar Shah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 159
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ammar Shah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks alot for your logic . i got the understanding about deleted records.
now what about total no of records..............?
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you want to know the total number of records? Do you want to display it in your application?
 
Ammar Shah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would think your find-method returns the record numbers of the records you need to display in the JTable, doesn't it?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic