Although didn't include his comment as a possible answer, I consider it a good possible solution. Here with a little bit of code
In Oracle case, altering the session to ,.
or .,
:
alter session set NLS_NUMERIC_CHARACTERS=',.';
depending on the server's locale. Simply using DecimalFormatSymbols to get those values:
String decimalSeparator = String.valueOf(new DecimalFormatSymbols().getDecimalSeparator());
String groupingSeparator = String.valueOf(new DecimalFormatSymbols().getGroupingSeparator());
In SQL Server, setting up the session language to the same as the server side:
SET LANGUAGE the_language;
and getting the language using Locale:
String language = Locale.getDefault().getDisplayLanguage("en_US");