Sort column by without case sensitive  using Comparator interface

Hello,
When i sorted my values of a column in a table it was showing all sorted upper case letters at top rows and all sorted lower case letters on bottom. So i would like to sort values without case sensitive order. Like. A, a, B, b, C, c....
I am using Collection class to sort vector that contains the values of a column as an object and using Comparator interface to sort the values of a column in either ascending and descending order. It facilitates to compare two objects like.
<class> Collections.sort(<Vector contains values of column to be sort>, <Comparator interface>);
and in interface it compares two objects ((Comparable) object).compareTo(object);
Now Let's suppose i have three values say Z, A, a to sort then this interface sorted in ascending order like A, Z, a
but the accepted was A, a, Z. So how can i get this sequence. I would like to sort the values of a column without case sensitive manner.
Thanks
Ashish Pancholi
Edited by: A.Pancholi on Dec 29, 2008 1:36 PM

[http://java.sun.com/javase/6/docs/api/java/lang/String.html#CASE_INSENSITIVE_ORDER]

Similar Messages

  • Search without case sensitivity??

    I am trying to create a search function that displays a report based on the search. I have the following query:
    select
    date_participated "Date Participated:",
    highschool_attended "Highschool Attended:",
    attending_college "Attending College:",
    college_attended "College currently attending:", participate_intercollegiate "Participating intercollegiate:",
    what_sport "What Sport:",
    what_position "What Positions:",
    financial_help "Financial Help:",
    financial_help_kind "Financial help kind:",
    additional_comments "Additional Comments:",
    name_and_address "Name and Address:"
    from bcombine_survey where HIGHSCHOOL_ATTENDED like NVL(REPLACE(:P3_Highschool|| '%','0',NULL) ,'%');
    My first question is:
    1. How can I make that query so that it is not case sensitive.
    2. Can i create a query that will search the database for any string that the client puts in? For exanple, if a highschool is named Athens and the client searches for "thens" I want it to pop up the Athens.

    Hi BlackMamba11
    Try something like:
    WHERE UPPER(MY_VARCHAR_COLUMN) LIKE '%' || UPPER(:P3_MY_TEXT_ITEM) || '%'
    Hope this helps.
    Cheers,
    Patrick

  • Case sensitive table names and column names in 8i or 9i databases

    Hi everybody,
    I've got a couple of business-side colleagues who insist that Oracle table and column names are case sensitive. That is, there is a setting in the set up of a database that lets you pick if table and column names are case sensitive. For example, this would mean that there could be a table named EMP in a given schema schema plus a table named emp in that same schema.
    Can this be true? I'd be surprised of course, but I've been surprised before.
    Thanks for any direction.
    -- Bill Loggins

    You can do it, but I would avoid it like the plague.
    SQL> create table "a" (b date);
    Table created.
    SQL> create table "A" (b date);
    Table created.
    I think I would refuse to work on a database where this has been used !

  • Sorting date using Comparator.

    Hi frnds,
    I have a problem sorting a date using comparator Interface. To the compare method I am passing Objects, which contains values retrieved from bean.
    I have hyperlinks for all the fields, upon clicking am able to sort all the fields except the date:
    The format of date is MM/DD/YYYY. It is sorting only taking month into consideration. I want the date to be sorted completely taking into consideration the complete date.
    Kindly help me in this regards.
    Below is the code listed:
    public int compare(Object vendoremployee1, Object vendoremployee2){
              String strSowTitle1 = ((CVendorEmployees) vendoremployee1).getSowTitle().toUpperCase();
              String strSowNum1 = ((CVendorEmployees) vendoremployee1).getSowNumber().toUpperCase();
              String lastName1 = ((CVendorEmployees) vendoremployee1).getLastName().toUpperCase();
              String strCreatedDate1 = ((CVendorEmployees) vendoremployee1).getCreatedDate().toUpperCase();
              String strSowTitle2 = ((CVendorEmployees) vendoremployee2).getSowTitle().toUpperCase();
              String strSowNum2 = ((CVendorEmployees) vendoremployee2).getSowNumber().toUpperCase();
              String lastName2 = ((CVendorEmployees) vendoremployee2).getLastName().toUpperCase();
              String strCreatedDate2 = ((CVendorEmployees) vendoremployee2).getCreatedDate().toUpperCase();
    // How do i sort
    strCreatedDate1.compareTo(strCreatedDate2);Thanks

    II am assuming that you are using either the Collections.sort() method, passing in a Vector of your objects or the Arrays.sort() method passing in an array of your objects. Either way your class definition for your object must implement Comparable. Then you have to implement the compareTo(Object o) method. Inside this method you can setup the sort any way you want. If you want the object to sort by the date member, the easiest way to accomplish the sort is to get the milliseconds from EPOC. Then you can sort either ascending or descending.
    Example code: forgive the formatting, cut and paste it into an editor
    The example has the data member as a Long object.
    Hope this is helpful.
    public int compareTo( Object o ) throws ClassCastException
              YourClassNameHere obj;
              if( o instanceof YourClassNameHere)
                   obj = (YourClassNameHere) o;
              else
                   throw new ClassCastException("Specified Object o is not of type YourClassNameHere." );
               //Only if these are not primitives
              if( this.getYourDatamember() != null && obj.getYourDatamember() != null) 
                        if(this. getYourDatamember().longValue() < obj. getYourDatamember().longValue())
                              return -1;
                        else if( this. getYourDatamember().longValue() > obj.getYourDatamember().longValue() )
                             return 1;
                        else
                             return 0;
              else if(this.getYourDatamember != null && obj.getYourDatamember() == null)
                   return -1;
              else if(this.getYourDatamember == null && obj.getYourDatamember() != null)
                   return 1;
              else
                   return 0;
         }

  • Nautilus case sensitive ordering

    Hi,
    Just wondering if it's possible to make nautilus order files without case sensitivity when they're sorted by name.
    I've tried a few searches but turned up nothing, except that the gnome documentation says it isn't case sensitive (here)
    There's nothing in gconf either, as far as I can see.
    If I recall correctly, it wasn't case sensitive when using nautilus in other distros...
    Sorry if this has come up before, but I couldn't find anything in the forums.
    thanks
    Fishonadish[/url]

    Sorry to dig this out, but I have the same problem here. Maybe it has something to do with a Locale setting?
    EDIT: Indeed, changing the Locale did fix the problem. Add this to your ~/.bashrc
    export LC_COLLATE="en_US.utf8"
    Note: Now most programs will sort files insensitive including the "ls" command.
    Last edited by IceHand (2007-05-07 18:37:59)

  • HFS File system with case sensitive is not accepted to install creative cloud? Is there any other way but install the whole MacOS again after formatting the drive. I cannot belief that Adobe is so bad to it's Mac customers..

    After many hours setting up OS10.10 from he scratch the last step should be installing m Adobe apps again.
    trying this I always get the error message that creative cloud does not accept case sensitive file systems and I shall use another drive.
    This means I have to set up the whole machine again after formatting without case sensitive but then having copy problems with my NAS?
    I cannot belief that Adobe is really demanding this. If so this would show how urgent this market need alternatives and some more competition...

    Hi,
    You can refer below link for more information.
    Error "Case-sensitive drives not supported" or similar install error | Mac OS

  • Case sensitive filed in DB table, Filter needed ignoring case sensitivity

    Hi,
      Therse is a DB table with one of the fields marked to recognize case sensitivity. I have to do a filter on this field with a wild card pattern such that irrespective of the case, the record should be extracted as and when the pattern is found.
    One way of doing this is TRANSLATE field to UPPER CASE after extracting all the records to an internal table.
    But I see that this can be an expensive call as there are tons of records to be processed. Is there any performance efficient way to handle this?
    Example:
    Filed Name: XML_LINE.
    Field Content can be in any of the following formats:
    Format 1: break.
    Format 2: BREAK
    Format 3: BreaK.
    Format 4: breAK.
    Format 5: breAK-point.
    Format 6: breAK-POINT.
    The wild card pattern I would like to use here is on the word "break" irrespective of the case and extract only the relevant records.
    wild card pattern1: b*.
    wild card pattern:B*.
    Can count of the number of letters help here for the words "break." and "break-point." along with wild card patterns or is there any better way of doing this? 
    Thanks & Regards,
    Ranjini

    Hi,
    a solution is to create a second field without case sensitive ans stored word in UPER CASE.
    If you see in SAP (f.e. Customer or Creditor), SAP store NAME in a search field (in upper case). Make the same.
    Rgds

  • [Solved] Username case sensitivity when logging in via BASIC authentication

    Hi,
    Quick question... where the web.xml file defines BASIC authentication for an app, can a change be made somewhere to make the username case INsensitive ?
    .. such that passwords remain case sensitive but usernames can be upper/lower regardless of how they are stored (in the database in this case, via DBTableOraDataSourceLoginModule).
    I was thinking I could add an upper(supplied_username) function wrapper somewhere before the supplied username / stored username are compared.. what class/file would I need to edit to try that solution?
    If not possible.. would form authentication be a better option for case insensitivity, and if so would it be difficult to hookup a custom login form to the DBTableOraDataSourceLoginModule instead of the BASIC login window ?
    Thanks..

    Hi,
    by default all username and password is cases sensitive - no matter how the logon is performed. The DBTableOraDataSourceLoginModule provides an option to handle passwords case insensitive (as explained in the documentation !)
    http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28957/loginmod.htm#BABHDJAH
    casing
    =====     
    The case-sensitivity when comparing login user names to names in the database. Use sensitive to require case-sensitive comparisons, toupper to convert the login user name to all-uppercase, or tolower to convert the login user name to all-lowercase. (If anything other than these three values is specified, the default value will be used.)
    Default: sensitive
    Example: toupper
    Frank

  • Objects name case sensitive

    Hi Dear;
    to call any object in SDK, i have to write the object name(index) as case sensitive.
    if there any way to call these objects without case sensitive?
    Ex: if i have a UDF named U_BPDrv and i try to get it as U_BPDRV i get an error.
    how can i resolve this error?
    thank you Dear;

    Hi Lita,
    i tried it now. UDF field is named as u_Test.
    When I call SELECT ordr.u_Test so the result is the same as when I call SELECT ordr.U_TESt, so here is it not case sensitive. When I try get result from recordset as rs_ordr.Fields.Item("U_TeSt").Value() it give no error. When I bound result from recordset to matrix as
    column.DataBind.SetBound(True, "@KZ", "u_TEst") - no error as well.
    Everything was tested with no binary collation on db.
    So I`m persuaded, that in this cases it depends on sql server and not on SDK.
    Petr

  • Time Machine automatically formats new external drive CASE-SENSITIVE?

    I noticed a strange thing when I set up Time Machine. I'd bought an external drive that was presumably pre-formatted as FAT32 or NTFS, so when I connected it and told Time Machine to use that drive, it told me it needed to format the drive, so I told it to go ahead.
    It happened so fast that I wanted to make sure it had worked, so I checked the stats on the drive, and I noticed that it was formatted "Mac OS Extended (Journaled, Case-sensitive)". I thought it was a bit odd that it was formatted case-sensitive. When I google for this, the only thing I find is people saying that the external drive should NOT be case-sensitive.
    So what's going on here? Should it be case-sensitive? Is this a glitch? Should I be concerned? Should those who don't use case-sensitive be concerned?
    Thanks!

    Well, I've been reading through some other discussions in this forum, and some people have attributed problems with Time Machine to the disk being formatted case-sensitive. So the issue is still up in the air. So far, I've only done an initial backup, and that worked fine. I've also read about people having trouble with subsequent backups. Also, some people report that Apple's tech support instructions specify that you format the drive explicitly without case-sensitivity. There are inconsistencies here, and Apple is mum about the details. So this kinda leaves this up in the air.
    BTW, you say the drive will only be used for TM. Is that necessarily the case? I mean, can't I use it to store other files? I got a 500GB disk because it was on sale (a My Book for $125), and I figure it'll take a while to fill up, so why not use the disk for other things?

  • Sort columns in matrix report

    Hi all
    I create matrix report( in version 9i)
    I want sort columns of report
    when i use order by it sort rows but i want sort columns
    my query is like this:
    SELECT
    Code,
    name,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E') Activity,
    SUM(amnt) amount
    From Mytable
    Where ....
    group by
    Code,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E')
    my group base on code
    my columns base on Activity
    and cells are Amount
    my report result is:
    ........ B E D A C
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    I want this :
    ........ A B C D E
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    ....

    Hello,
    How about this?
    SELECT Code, name,
    DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
    From Mytable
    WHERE ....
    GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
    ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')

  • Case Sensitive String

    Hi,
    I need to read an argument but without case sensitivity, so far I have:
    if (args[2].equals("MEAN"))
    How can I make this line case insensitive?
    Thank you
    Mike

    Hi,
    I need to read an argument but without case
    sensitivity, so far I have:
    if (args[2].equalsIgnoreCase("MEAN"))
    How can I make this line case insensitive?
    Thank you
    Mike

  • Comparable and Comparator Interface - Collections

    Hi All
    Please let me know when to use Comparable interface and Comparator interface. ?
    Any sort of information is highly appreciable .
    Matt

    Matt wrote:
    @ jverd      
    So, when you googled, and found tutorials, and worked through those tutorials, and read the javadocs for those classes, what in particular did you not understand?If everything would work like that what will be the use of forums like this , It does work like that, for people who aren't lazy. The use of these forums, as indicated by my first reply, is among other things, when you've done your own research, as you should do, and run into something you don't understand.
    so dont try to be smart :(Maybe you should try to be smarter.
    Lets try not to abuse the forum with exchanges like this. The only abuse so far has been you expecting the forum to be a substitute for doing your own research.
    I know how to use Comparable and Comparator but dont know when to use these in a real time application.That statement says nothing about your problem. The only information it carries is that you don't know what the term "real time" means.

  • Populating the Addressee field using Customer Interface program

    Hello All,
    Can any body tell me how to populate the "Addressee" column in the HZ_Party_Sites table using Customer Interface Program. Which field should be populated in RA_Customers_Interface_All table inorder to populate the "Addressee" field.
    Thank you,
    Vijay

    You can post this thread in this
    Customers as well.
    Thanks
    GM

  • Column header sort - case sensitivity issue

    Hi guys,
    I'm having an issue with the built in column sorting when you click the headers on a report. Basically case sensitivity is taken into account and capital letters get sorted before smaller case letters, for example:
    Cats
    Dogs
    Zebra
    ants
    bears
    How would I be able to fix this built in sort?
    Thanks,
    Luis

    Luis,
    See if Denes's solution helps: Report sort by column header question .
    Scott

Maybe you are looking for

  • Closed Sales Order With Open Rows-Cannot Close Rows

    Hi, As the title states we have one SO which is closed and the 1st Row is also closed but the 7 other rows are showing as open so they appear on reports etc We can close the rows individually but when we go back to the SO they are open again! Could t

  • [Solved] Automatic power on

    Sorry if this is the wrong forum... My computer boots up on it's own after systemctl shutdown and complete poweroff. I haven't found anything in the logs that tells me why this is happening. uname -a Linux orange 3.16.3-1-ARCH #1 SMP PREEMPT Wed Sep

  • Why I am getting ORA-29257 while running a get ipaddress query?

    Friends, The query: select machine,utl_inaddr.get_host_address(machine) from v$session where username is not null Result: Error at line 1: ORA-29257 host bmc01\beating How can i resolve this error? Thanks & Regards Sathyguy

  • Pictures not appearing in after upgrade to SRM-MDM Catalog 3.0 SP7 Patch4

    Hello, Due to some issues in Advanced search we performed the service pack upgrade from SRM-MDM Catalog 3.0 SP5 (with MDM 7.1.03.72) to SRM-MDM Catalog 3.0 SP7 Patch4 ( MDM 7.1.04.146).  With this new SP, the Pictures are not appearing anymore under

  • How long did your  23" LCD  last.

    I have a dead Apple 23" LCD, tech says its not repairable. Purchased in 2002 for over $5,000 (Canadian $). Canadian Law requires products to be durable for a reasonable period of time. Is 4 yrs 6 mths a reasonable period for such a product to last? I