Hi Aishwarya,
Can you please append the following to your ‘Jdbc Url’ encrypt=true;trustServerCertificate=true;
it should look like this
jdbc:sqlserver://localhost:1433;databasename=MSSQLMendix;encrypt=true;trustServerCertificate=true;
I am assuming query is working property on sql server if used in query language.
You can try enable trace in the log to know more details of the error. can you share the any additional details or screen shot?