Java JDBC Database Metadata isDB2(DatabaseMetaData metadata)

Here you can find the source of isDB2(DatabaseMetaData metadata)

Description

Comment method "isDB2".

License

Open Source License

Parameter

Parameter Description
metadata a parameter

Exception

Parameter Description
SQLException an exception

Declaration

public static boolean isDB2(DatabaseMetaData metadata) throws SQLException 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.sql.DatabaseMetaData;

import java.sql.SQLException;

public class Main {
    public static final String IBM_DB2_ZOS_PRODUCT_NAME = "DB2";

    /**/*from  w ww .  j av  a2  s  .  c o m*/
     * Comment method "isDB2".
     * 
     * @param metadata
     * @return
     * @throws SQLException
     */
    public static boolean isDB2(DatabaseMetaData metadata) throws SQLException {
        if (metadata != null && metadata.getDatabaseProductName() != null
                && metadata.getDatabaseProductName().indexOf(IBM_DB2_ZOS_PRODUCT_NAME) > -1) {
            return true;
        }
        return false;
    }
}

Related

  1. getSimplifiedURL(final DatabaseMetaData metadata)
  2. getTableColumns(Connection connection, String selectedTable)
  3. getTableMetadata(Connection connection, String tableName)
  4. getTableNames(Connection conn)
  5. getTableNames(DatabaseMetaData dbMD)
  6. isDerbyDatabase(DatabaseMetaData metaData)
  7. isExistsTable(Connection con, String schema, String tableName)
  8. isIdGenerated(DatabaseMetaData metaData)
  9. isMysql(DatabaseMetaData metadata)