Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2008, 06:45 PM
Member
 
Join Date: Jun 2008
Posts: 1
senthil_jr is on a distinguished road
Collections Sort
Hi All,

Thankx in advance for answring this
please gimme a sample code f

how to make this query into java collections sorting as java program

SELECT *
FROM authors
ORDER BY au_lname ASC, au_fname AS, au_mname dsc

CAN USE THE JAVA BEAN AND beanproperties
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-03-2008, 07:00 PM
Zosden's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 386
Zosden is on a distinguished road
Nobody is going to write it for you but I'll give you some ideas. Put your objects into a vector and make sure that you have a method in your class for that object that has the comparable method, which tells how to compare the object. I think but could be wrong pass in the vector into Arrays.sort or there might be vector.sort, look in the api that should do it for yeah.
__________________
My IP address is 127.0.0.1
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-04-2008, 10:11 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
You can have vector sort for this.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort a list using Bubble sort algorithm Java Tip Algorithms 3 04-29-2008 10:04 PM
Simple demonstrations of the Collections utilities Java Tip java.lang 0 04-17-2008 12:39 AM
Collections framework yuvi461 New To Java 2 01-08-2008 12:46 PM
Performance Of Collections thomasprabu Advanced Java 0 01-05-2008 01:17 PM
how to sort Feng New To Java 1 11-20-2007 08:56 AM


All times are GMT +3. The time now is 12:28 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org