20001931 commented on issue #30896:
URL: 
https://github.com/apache/shardingsphere/issues/30896#issuecomment-2106738128

   May i konw shardingsphere support ActiveDirectoryPassword authentication 
mode for SQLservice
   
https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-using-azure-active-directory-authentication?view=sql-server-ver16#client-setup-requirements
   import java.sql.Connection;
   import java.sql.ResultSet;
   import java.sql.Statement;
   
   import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
   
   public class MSEntraUserPassword {
   
       public static void main(String[] args) throws Exception{
   
           SQLServerDataSource ds = new SQLServerDataSource();
           ds.setServerName("msentra-managed-demo.database.windows.net"); // 
Replace with your server name
           ds.setDatabaseName("demo"); // Replace with your database
           ds.setUser("[email protected]"); // Replace with your user name
           ds.setPassword("password"); // Replace with your password
           ds.setAuthentication("ActiveDirectoryPassword");
   
           try (Connection connection = ds.getConnection();
                   Statement stmt = connection.createStatement();
                   ResultSet rs = stmt.executeQuery("SELECT SUSER_SNAME()")) {
               if (rs.next()) {
                   System.out.println("You have successfully logged on as: " + 
rs.getString(1));
               }
           }
       }
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to