This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to pass variable to Model/Business 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
Hello I am writing a code to validate the credentials of user that is username and user id from my data base and called chkValue(uid, uname) method

The action class code is like this:

here i am getting data from ActionForm class and want that data get authorization from chkValue() method from diff class where I can retrieve data using hibernate from the database
there are 2 main problem

  • how to pass these parameter to checkValue class
  • How to retrieve data using Hibernate and write the code for chkValue() method and return value so appropriate mapping can be called.

  •  
    Ranch Hand
    Posts: 55
    Mac Hibernate Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    Create a package named DAO. And create a class named CompareDao.java

    Below is the code for CompareDao.java


    Here is the code for HibernatePlugin.java

    and HibernateUtils.java

    Action class will be the same Action class mentioned by you. Just add the following line to your Action class:

    Hope it's clear to you now. If you have any confusions reply back to me.

    Also I have answered your previous queries.

    Regards,
    Sandy
    reply
      Bookmark Topic Watch Topic
    • New Topic