Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

For Getting Distinct value (In Struts2)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a software by Struts2+Hibernate3+Spring3

I want to get distinct value in a comboo from a table of a specific column.For that I write a method "findByValue(long id)" in Dao





I wrote a method in Action class




I write following code for getting data in comboo in jsp page


But When I write In dao class method

queryName = "select distinct(locationName) from com.rajuk.efms.model.LocationViewInfo where locationTypeId = ?";

for getting LocationName column data distinctly I get no data in comboo

When I write In dao class method

queryName = "from com.rajuk.efms.model.LocationViewInfo where locationTypeId = ?";

I get data in Comboo but not Distinctly .

Please help me to get distinct value ......
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use select refer the link http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/Select.html
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic