@@ -731,32 +731,7 @@ public final class SQLServerDriver implements java.sql.Driver {
731
731
static final String AUTH_DLL_NAME = "mssql-jdbc_auth-" + SQLJdbcVersion .MAJOR + "." + SQLJdbcVersion .MINOR + "."
732
732
+ SQLJdbcVersion .PATCH + "." + Util .getJVMArchOnWindows () + SQLJdbcVersion .RELEASE_EXT ;
733
733
static final String DEFAULT_APP_NAME = "Microsoft JDBC Driver for SQL Server" ;
734
- static final String APP_NAME_TEMPLATE = "Microsoft JDBC - %s, %s - %s" ;
735
- static final String constructedAppName ;
736
- static {
737
- constructedAppName = getAppName ();
738
- }
739
734
740
- /**
741
- * Constructs the application name using system properties for OS, platform, and architecture.
742
- * If any of the properties cannot be fetched, it falls back to the default application name.
743
- * Format -> Microsoft JDBC - {OS}, {Platform} - {architecture}
744
- *
745
- * @return the constructed application name or the default application name if properties are not available
746
- */
747
- static String getAppName () {
748
- String osName = System .getProperty ("os.name" , "" );
749
- String osArch = System .getProperty ("os.arch" , "" );
750
- String javaVmName = System .getProperty ("java.vm.name" , "" );
751
- String javaVmVersion = System .getProperty ("java.vm.version" , "" );
752
- String platform = javaVmName .isEmpty () || javaVmVersion .isEmpty () ? "" : javaVmName + " " + javaVmVersion ;
753
-
754
- if (osName .isEmpty () && platform .isEmpty () && osArch .isEmpty ()) {
755
- return DEFAULT_APP_NAME ;
756
- }
757
- return String .format (APP_NAME_TEMPLATE , osName , platform , osArch );
758
- }
759
-
760
735
private static final String [] TRUE_FALSE = {"true" , "false" };
761
736
762
737
private static final SQLServerDriverPropertyInfo [] DRIVER_PROPERTIES = {
@@ -766,7 +741,7 @@ static String getAppName() {
766
741
SQLServerDriverStringProperty .APPLICATION_INTENT .getDefaultValue (), false ,
767
742
new String [] {ApplicationIntent .READ_ONLY .toString (), ApplicationIntent .READ_WRITE .toString ()}),
768
743
new SQLServerDriverPropertyInfo (SQLServerDriverStringProperty .APPLICATION_NAME .toString (),
769
- SQLServerDriverStringProperty .APPLICATION_NAME .getDefaultValue (), false , null ),
744
+ SQLServerDriverStringProperty .APPLICATION_NAME .getDefaultValue (), false , null ),
770
745
new SQLServerDriverPropertyInfo (SQLServerDriverStringProperty .COLUMN_ENCRYPTION .toString (),
771
746
SQLServerDriverStringProperty .COLUMN_ENCRYPTION .getDefaultValue (), false ,
772
747
new String [] {ColumnEncryptionSetting .DISABLED .toString (),
@@ -1053,9 +1028,6 @@ String getClassNameLogging() {
1053
1028
drLogger .finer ("Error registering driver: " + e );
1054
1029
}
1055
1030
}
1056
- if (loggerExternal .isLoggable (Level .FINE )) {
1057
- loggerExternal .log (Level .FINE , "Application Name: " + SQLServerDriver .constructedAppName );
1058
- }
1059
1031
}
1060
1032
1061
1033
// Check for jdk.net.ExtendedSocketOptions to set TCP keep-alive options for idle connection resiliency
@@ -1294,7 +1266,6 @@ public java.sql.Connection connect(String url, Properties suppliedProperties) th
1294
1266
Properties connectProperties = parseAndMergeProperties (url , suppliedProperties );
1295
1267
if (connectProperties != null ) {
1296
1268
result = DriverJDBCVersion .getSQLServerConnection (toString ());
1297
- connectProperties .setProperty (SQLServerDriverStringProperty .APPLICATION_NAME .toString (), SQLServerDriver .constructedAppName );
1298
1269
result .connect (connectProperties , null );
1299
1270
}
1300
1271
loggerExternal .exiting (getClassNameLogging (), "connect" , result );
0 commit comments