Here you can find the source of printMetaData(Connection con)
public static void printMetaData(Connection con)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.SQLException; public class Main { public static void printMetaData(Connection con) { try {/*from ww w . ja v a 2 s . co m*/ DatabaseMetaData meta = con.getMetaData(); System.out.println("Driver: " + meta.getDriverName() + " " + meta.getDriverMajorVersion() + "." + meta.getDriverMinorVersion()); System.out.println("DB: " + meta.getDatabaseProductName() + " " + meta.getDatabaseMajorVersion() + "." + meta.getDatabaseMinorVersion() + " (" + meta.getDatabaseProductVersion() + ")"); } catch (SQLException e) { System.out.println("Error: " + e.getMessage()); } } }