• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to retrieve the Data using Hibernate 3.6 and pass to Model class

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone I want to Develop a program where a user can visit a page say Registration page and there are fields in that page as userid, username when user press submit button then he will see Welcome page if credentials are correct if not then a error message is displayed if user is new then he will register himself and then page would have an additional field say confirm password and then will be displayed. I want to use Hibernate 3.6 with derby database to store userid and username.


Now I want to create this program using struts 1.3. For username and userid i want to use a database, now I am not able develop a model class where i can put my code that extracts the userid from the database and match it with userid field from ActionForm. I can enter the values in database but can not retrieve the userid from the database but If i retrieve the value then how I can pass the values from the Action class to model class for verification that is the user exists or not.

Kindly tell me how to Write a model class where I can perform these validation because I want to clean my Action class.


Thanks and Regards
Deepak Sharma
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A model class would simply be a POJO describing your user. It might contain fields like Id and userName (with corresponding getters and setters). This object in turn could be annotated so hiberate can map these fields to tables and columns. You might want to start with googling around for some tutorials. If you try something and run into problems people will help you but you have to do your due diligence first and at least attempt it.

 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic