I am trying to connect my Azure SQL database to my Android App on Android Studio, but there seems to be a problem from the client side not being able to form a connection.
Initially I was using jtds-1.3.1.jar for the driver, but then I read somewhere that it is not being used or updated anymore so I am currently using mssql-jdbc-9.4.0.jre8
I am forming connection URL as stated in the documentation
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
connectionURL = "jdbc:sqlserver://t;databaseName=;user=;password=@;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;";
connection = DriverManager.getConnection(connectionURL);
But I am getting this error:
The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Socket is closed".