Last active
July 28, 2021 10:41
-
-
Save hhue13/d43bb1ff6fb6b831cb85f3fb060606bb to your computer and use it in GitHub Desktop.
Small Java class to determine the version of he MS-SQL driver version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To run it execute: java -cp <path>/getMSSQLDriverVersion.jar:<path>/mssql.jar at.twoinnovate.hhue.epo.GetMSSQLDriverVersion | |
package at.twoinnovate.hhue.epo; | |
import com.microsoft.sqlserver.jdbc.*; | |
public class GetMSSQLDriverVersion { | |
public static void main(String[] args) throws SQLServerException { | |
SQLServerDatabaseMetaData metaData = new SQLServerDatabaseMetaData(null); | |
String driverVersion = metaData.getDriverVersion(); | |
System.out.println(String.format("MS SQL Driver version is:'%s'", driverVersion)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results in an output like:
[hhuebler@hhuelinux shm]$ java -cp ./getMSSQLDriverVersion.jar:/2tmp/epo/mssql.jar at.twoinnovate.hhue.epo.GetMSSQLDriverVersion
MS SQL Driver version is:'6.2.2.0'