Java JDBC Database Metadata isMysql(DatabaseMetaData metadata)

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

Description

is Mysql

License

Open Source License

Declaration

public static boolean isMysql(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 boolean isMysql(DatabaseMetaData metadata) throws SQLException {
        boolean result = false;
        try {/*  w  w w .ja  v  a 2 s. co  m*/
            if (metadata != null && metadata.getDriverName() != null && metadata.getDatabaseProductName() != null
                    && metadata.getDatabaseProductName().toUpperCase().indexOf("MYSQL") > -1) { //$NON-NLS-1$
                result = true;
            }
        } catch (SQLException e) {
            result = false;
        }
        return result;
    }
}

Related

  1. getTableNames(DatabaseMetaData dbMD)
  2. isDB2(DatabaseMetaData metadata)
  3. isDerbyDatabase(DatabaseMetaData metaData)
  4. isExistsTable(Connection con, String schema, String tableName)
  5. isIdGenerated(DatabaseMetaData metaData)
  6. isOracleForSid(DatabaseMetaData metadata, String oracleProduct)
  7. isSybase(DatabaseMetaData metadata)
  8. isSybaseDb(DatabaseMetaData metaData)
  9. listAllTables(Connection connection)