• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

update strategy

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did the find by Criteria. As name and the location are the fields to put the search on , so there are number of records returned and name and location are repeated in many records.

Now update starategy.

The user clicks one of the record which he wants , I'll store all the fields in an array and find the record by find method(not findByCriteria as this time we have more fields)

My question is here can I add another find method in Data.java, which is not mentioned in the DBAccess inteface, I think we can but just watned to be sure and want your opinion.

After finding the record I'll lock the record and do the find again and match with the old values to be sure that the record has not been changed.

The lock method will generate the Lock cookie with which I'll call the update method. What this lock cookie is for by the way. Are we suppose to store it somewhere other than calling the update(). Please comment

When the record is matched then I do the update or book it with CustomerID.

the last method would be to unlock.

Please suggest about my understanding

Any advice is appreciated

thanks

Uzma
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added another interface, MyDBAccess, that extends DBAccess, and had Data implement both of them. I add any additional functionality to MyDBAccess. Hope this helps. I am stuck on findByCriteria(String[] criteria) right now myself.
 
uzma ali
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

Didu have a separate method of find in your new interface. Let me know what your additional interface is doing.

Also if you need help in findByCriteria(), let me know

Thanks

uzma
 
My cellmate was this tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!