I have a SQL Server in Azure, with default language eu_english. That means that the dates are in format mdy and I need them in dmy, I want to put the language to Spanish in the connection string. I have tried this. but it doesn't work:
jdbc:sqlserver://myazureURL:1433;DatabaseName=MyDataBase;Language=Spanish
I have tried adding Language=Spanish, but it doesn't work. I have also tried Language=5 because 5 is the Spanish Id of languages of my SQL Server.
I need this because I can't change default language from database settings. If I try to change default language with that:
EXEC sp_configure 'default language', 'Spanish';
It gives me this error:
EXEC sp_configure 'default language', 'Spanish';
EDIT WITH SOLUTION: I solved it incluiding this to the connection String so in each connection it sets the language:
connectionInitSqls ="SET LANGUAGE Spanish"

mdyis something you would rather find in the US. And you most probably don't even need to change the language, just properly parse the parameters, which should automatically happen if you usePreparedStatementjava.util.Datevalues viaDATEJDBC type parameters? If you need to change the database language to make your code work then it sounds like you are subject to SQL Injection attacks because you're concatenating string snippets to construct SQL queries.