• Post Reply Bookmark Topic Watch Topic
  • New Topic

display records

 
rames tirrupur
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a problem. I make a jdbc call and get all the information.

when i get information, i need to separate each one of them based on category.

eg: items starting with letter 'A' should be together. 'B' together like that.

A
Andhra
Aruna

B
Babu
Balu
...

Can anybody suggest how to do this.

Thanks,
ramesh
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this question related to Servlets ?

Anyway, you could use a map. The key would be the first letter, and the value would be an array of every element starting with this letter.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is JDBC related stuff. Have you tried something like...


SELECT * FROM categories_tbl ORDER BY category_name ASC
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!