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

  • SEARCH
  • Home
  • 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 8685323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:32:20+00:00 2026-06-12T22:32:20+00:00

I want to retrieve a specific record from Data Base using Hibernate. What I

  • 0

I want to retrieve a specific record from Data Base using Hibernate. What I want to do is commented below in the function.

public List<Customer> showCustomer(long customerIdFromCustomerListPage)
        throws Exception {

    Session session = HibernateUtil.getSessionFactory().openSession();
    Transaction transaction = null;
    List<Customer> customerList = new ArrayList<Customer>();
    try {
        transaction = session.beginTransaction();

        **//Select * from Customers where customerId="customerIdFromCustomerListPage"**

        transaction.commit();
    } catch (HibernateException e) {
        transaction.rollback();
        e.printStackTrace();
    } finally {
        session.close();
    }
    return customerList;

}
  • 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-12T22:32:21+00:00Added an answer on June 12, 2026 at 10:32 pm

    try something like this

     public Customer getCustomer(Long customerIdFromCustomerListPage)
        throws Exception {
    
          Session session = HibernateUtil.getSessionFactory().openSession();
          Customer customer = (Customer )session.get(Customer.class, customerIdFromCustomerListPage); 
          return customer ;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below I'm trying to retrieve a specific category record in my data store for
I am using wordpress list categories function to retrieve a specific selection of categories
I want to retrieve all 4sq venues from a specific area. Now I can
For a specific requirement in my project, I want to retrieve JSON response from
I want to retrieve information regarding specific IIS 7 website using the PowerShell Get-Website
I want to retrieve value from a specific row of MySQL table,for example :
I want to retrieve some data items from a web page. Link of webpage:
i'm trying to auto retrieve data from mysql server in specific DIV without manual
I want retrieve the width and height of browser in pixel(px) using ruby code.
I have a HTML table as follows. I want retrieve row values from this

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.