This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Count in jsp  RSS feed

 
Ankita Jha
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,
I m firing an HQL query.In that query i m also using count.
My problem is i need to dispaly the count which is obtained from HQL in my jsp page .I m able to show all other details.But not count.
Can any one suggest me ...how do i display the value of my Count in jsp.

Any help will be appreciated.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37384
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankita,
What do you have so far? Does your Hibernate query work if you run it elsewhere? I'm trying to figure out if you are asking about the Hibernate part or the web part.
 
Ritika Misra
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to figure out if you are asking about the Hibernate part or the web part.



definately hibernate ......becusae i have to display that record in my jsp page...
 
Shashank Rudra
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you please post the code you are trying to use.
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ankita,

I got your problem, it seems like you need to change your query...

I guess you are currently doing some thing like

select count(id), name, address from table;

You change this query to

select count(id) as MYCOUNT, name, address from table;

Now, refer this MYCOUNT in hibernate, you need to define this in bean.

Try this out.....



 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37384
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a forum for Hibernate questions. I've moved this out of the JSP forum for you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!