File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
articles/service-connector/includes Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ ms.author: xiaofanzhou
29
29
30
30
```java
31
31
String url = System.getenv("AZURE_MYSQL_CONNECTIONSTRING");
32
- Connection connection = DriverManager.getConnection(url + "& defaultAuthenticationPlugin=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin& authenticationPlugins=com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin");
32
+ String pluginName = "com.azure.identity.extensions.jdbc.mysql.AzureMysqlAuthenticationPlugin";
33
+ Connection connection = DriverManager.getConnection(url + "& defaultAuthenticationPlugin=" + pluginName +
34
+ "& authenticationPlugins=" + pluginName);
33
35
```
34
36
35
37
### [Spring](#tab/spring)
Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ ms.author: xiaofanzhou
31
31
```java
32
32
import java.sql.*;
33
33
34
- String url = System.getenv("AZURE_POSTGRESQL_CONNECTIONSTRING");
35
- Connection connection = DriverManager.getConnection(url + "& authenticationPluginClassName=com.Azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin");
34
+ String url = System.getenv("AZURE_POSTGRESQL_CONNECTIONSTRING");
35
+ String pluginName = "com.Azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin";
36
+ Connection connection = DriverManager.getConnection(url + "& authenticationPluginClassName=" + pluginName);
36
37
```
37
38
38
39
For more information, see the following resources:
You can’t perform that action at this time.
0 commit comments