title: how can i get correct Collation by sql query or other way of Sqlserver
body: <p>I can get all collation by below query:</p>
  
  <pre><code>SELECT name, description FROM sys.fn_helpcollations();
  
  Albanian_BIN
  Albanian_BIN2
  Albanian_CI_AI
  Albanian_CI_AI_WS
  Albanian_CI_AI_KS
  Albanian_CI_AI_KS_WS
  Albanian_CI_AS
  Albanian_CI_AS_WS
  Albanian_CI_AS_KS
  Albanian_CI_AS_KS_WS
  Albanian_CS_AI
  Albanian_CS_AI_WS
  Albanian_CS_AI_KS
  Albanian_CS_AI_KS_WS
  Albanian_CS_AS
  Albanian_CS_AS_WS
  Albanian_CS_AS_KS
  Albanian_CS_AS_KS_WS
  Albanian_100_BIN
  Albanian_100_BIN2
  Albanian_100_CI_AI
  Albanian_100_CI_AI_WS
  Albanian_100_CI_AI_KS
  Albanian_100_CI_AI_KS_WS
  Albanian_100_CI_AS
  Albanian_100_CI_AS_WS
  Albanian_100_CI_AS_KS
  Albanian_100_CI_AS_KS_WS
  Albanian_100_CS_AI
  Albanian_100_CS_AI_WS
  Albanian_100_CS_AI_KS
  Albanian_100_CS_AI_KS_WS
  Albanian_100_CS_AS
  Albanian_100_CS_AS_WS
  Albanian_100_CS_AS_KS
  Albanian_100_CS_AS_KS_WS
  Albanian_100_CI_AI_SC
  Albanian_100_CI_AI_WS_SC
  Albanian_100_CI_AI_KS_SC
  Albanian_100_CI_AI_KS_WS_SC
  Albanian_100_CI_AS_SC
  Albanian_100_CI_AS_WS_SC
  Albanian_100_CI_AS_KS_SC
  Albanian_100_CI_AS_KS_WS_SC
  Albanian_100_CS_AI_SC
  Albanian_100_CS_AI_WS_SC
  Albanian_100_CS_AI_KS_SC
  Albanian_100_CS_AI_KS_WS_SC
  Albanian_100_CS_AS_SC
  Albanian_100_CS_AS_WS_SC
  Albanian_100_CS_AS_KS_SC
  Albanian_100_CS_AS_KS_WS_SC
  Arabic_BIN
  Arabic_BIN2
  Arabic_CI_AI
  Arabic_CI_AI_WS
  Arabic_CI_AI_KS
  Arabic_CI_AI_KS_WS
  Arabic_CI_AS
  ...
  </code></pre>
  
  <p>i found that there are more than one collation per each locale</p>
  
  <p>when we setup sqlserver, sqlserver can select default collation follow current OS's locale.</p>
  
  <p>so, i also want to know which collation is used by default.</p>
  
  <p>for example, current locale is that:</p>
  
  <pre><code>System.out.println(Locale.getDefault().getDisplayCountry());
  System.out.println(Locale.getDefault().getDisplayLanguage());
  System.out.println(Locale.getDefault().getDisplayName());
  System.out.println(Locale.getDefault().getLanguage());
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>United States
  English
  English (United States)
  en
  </code></pre>
  
  <p>now, during the sqlserver installation, it will use "SQL_Latin1_General_CP1_CI_AS" automatically, how does sqlserver know it, where are the mapping list?</p>
  
  <p>i want to get the default collation by some api or query sql which like sqlserver get the collation when do installation.</p>
  
  <p>assume i just can get the OS locale info, how do i get the related default Collation by java api or windows native api or query db or any way?</p>