Java JDBC Database Metadata printMetaData(Connection con)

Here you can find the source of printMetaData(Connection con)

Description

print Meta Data

License

Open Source License

Declaration

public static void printMetaData(Connection con) 

Method Source Code

//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());
        }
    }
}

Related

  1. isMysql(DatabaseMetaData metadata)
  2. isOracleForSid(DatabaseMetaData metadata, String oracleProduct)
  3. isSybase(DatabaseMetaData metadata)
  4. isSybaseDb(DatabaseMetaData metaData)
  5. printExistingTables(Connection conn)
  6. printTableExistence(String name, Connection conn)
  7. sequenceExists(String seqName, Connection conn)
  8. tableExists(Connection con, String table)
  9. tableExists(Connection connection, String tableName)