public static String getDatabaseType(Connection conn) throws Exception {
        DatabaseMetaData databaseMetaData = conn.getMetaData();
        String databaseProductName = databaseMetaData.getDatabaseProductName();
        return databaseTypeMappings.getProperty(databaseProductName);
    }
public static String getDatabaseType ( Connection conn ) throws Exception { DatabaseMetaData databaseMetaData = conn . getMetaData ( ) ; String databaseProductName = databaseMetaData . getDatabaseProductName ( ) ; return databaseTypeMappings . getProperty ( databaseProductName ) ; }
根据连接对象获取数据库类型
@param conn 数据库连接
@return 类型
@throws Exception