Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
To query a database for information about what it supports, the Microsoft JDBC Driver for SQL Server implements the SQLServerDatabaseMetaData class. This class contains many methods that return information in the form of a single value, or as a result set.
To create a SQLServerDatabaseMetaData object, you can use the getMetaData method of the SQLServerConnection class to get information about the database that it's connected to.
In the following example, an open connection to the AdventureWorks2022 sample database is passed in to the function. Then the getMetaData method of the SQLServerConnection class is used to return a SQLServerDatabaseMetadata object. Finally, various SQLServerDatabaseMetaData methods are used to display information about the driver, driver version, database name, and database version.
public static void getDatabaseMetaData(Connection con) {
try {
DatabaseMetaData dbmd = con.getMetaData();
System.out.println("dbmd:driver version = " + dbmd.getDriverVersion());
System.out.println("dbmd:driver name = " + dbmd.getDriverName());
System.out.println("db name = " + dbmd.getDatabaseProductName());
System.out.println("db ver = " + dbmd.getDatabaseProductVersion());
}
// Handle any errors that may have occurred.
catch (SQLException e) {
e.printStackTrace();
}
}
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Database handling in Power Automate for desktop - Training
Learn about the database actions in Power Automate for desktop.
Certification
Microsoft Certified: Azure Database Administrator Associate - Certifications
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.