目前很多etl开发工具上都是用这个获取元数据信息的
版本3.3.2
建表语句
create TEMPORARY table xxx as select * from scores;
jdbc驱动用的是 mariadb 3.0.8
DatabaseMetaData metaData = connection.getMetaData();
ResultSet tablesResult = metaData.getTables(filter.catalogName, filter.schemaName, filter.tableName, (String[])null);
实际执行的sql:
SELECT TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, IF(TABLE_TYPE='BASE TABLE' or TABLE_TYPE='SYSTEM VERSIONED', 'TABLE', TABLE_TYPE) as TABLE_TYPE, TABLE_COMMENT REMARKS, NULL TYPE_CAT, NULL TYPE_SCHEM, NULL TYPE_NAME, NULL SELF_REFERENCING_COL_NAME, NULL REF_GENERATION FROM INFORMATION_SCHEMA.TABLES