I have same problem. Is there a solution to this issue?
cant connect sql with android studio app error shows SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption
mario
1
Reputation point
SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption.
-i'm using driver in android studio build implementation project(path: ':mssql-jdbc-6.1.0.jre7')
Complete Code-url="jdbc:sqlserver://serverName.database.windows.net:1433;DatabaseName=sampleDatabase;user=user@Testta ;password=pass;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
try {
Connection conn = DriverManager.getConnection(url);
System.out.println("connection "+conn);
Statement sttete = conn.createStatement();
ResultSet qqq = sttete.executeQuery("select * from users");
} catch (SQLException e) {
e.printStackTrace();
System.out.println("error During Get Connection.....././././. "+e);
}