Im using SQL Server 2008 R2.
I have a data cache retrieved from the database and currently the way to get a string is via map.get(). However, some parts of the code directly queries from the database instead of just using the cache since some joins are needed for those cases. The problem now, the collation on the table is causing different behavior between text comparison via SQL comparison (uses the table collation) and text comparison via Java using map.get().
I have read about java.text.Collator but it needs the use of collator.Compare to be able to use it properly. Is there a way to force a map in using a fixed Collator.
By the way the collation in this situation is using Japanese character where half-width and full-width Japanese are the same when compared in SQL Server.
You can use a TreeMap with a Collator properly configured for your case. Here is an example where uppercase and lowercase latin characters are considered equivalent: