getMetaData()
method. There are so many methods in DatabaseMetaData that we can use to get the database product name, it’s version and configuration details.DatabaseMetaData metaData = con.getMetaData();
String dbProduct = metaData.getDatabaseProductName();