Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9141273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:37:25+00:00 2026-06-17T09:37:25+00:00

public Users loginUser(String username,String password) { Users user; org.hibernate.Transaction tx = session.beginTransaction(); Query q

  • 0
 public Users loginUser(String username,String password)
{
    Users user;
    org.hibernate.Transaction tx = session.beginTransaction();
    Query q = session.createQuery("from Users as users where Username ="+ username + " && Password = " +password);
    user = (Users) q.uniqueResult();
    return user;
}

I am trying to return the user who is trying to login but it gives me an error from the line which is calling the method above.

org.apache.jasper.JasperException: An exception occurred processing JSP page /loginlogout.jsp at line 21

stack trace:

Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:37:25+00:00Added an answer on June 17, 2026 at 9:37 am

    I think you can try below query:

    Query q = session.createQuery("from Users as users where users.Username=:username and users.Password=:password") ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have async methods that returns an objects public static IEnumerable<Users.User> GetUsers(IEnumerable<string> uids, Field
Hibernate doesn't delete my row: public boolean deleteVote(Login user, int pid){ Session session =
For Post model: public $belongsTo = array('Users.User') And for CakeDC-Users plugin's User model: public
I have multiple Users, each with a collection of Tasks. public class User {
I currently use LogonUser() to authenticate my user's username and password on my local
ParseError: /Users/JMiller/Projects/multisport-momentum/public/stylesheets/style.styl:15 11| color #031634 12| } 13| a { 14| color font.color >
I want to give my users the ability to choose how their public page
I'm designing a public facing website that needs to track the path of users
I'm trying to add a public API to my app to allow users to
I'm tring to build a public bathroom type of wall, where users can draw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.