mysql/oracle导出数据库说明文档

import cn.smallbun.screw.core.Configuration;
import cn.smallbun.screw.core.engine.EngineConfig;
import cn.smallbun.screw.core.engine.EngineFileType;
import cn.smallbun.screw.core.engine.EngineTemplateType;
import cn.smallbun.screw.core.execute.DocumentationExecute;
import cn.smallbun.screw.core.process.ProcessConfig;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

import java.util.Arrays;

public class DbDocTest {
    public static void main(String[] args) {
        documentGeneration();
    }

    private static void documentGeneration(){
        HikariConfig config = new HikariConfig();
        //config.setDriverClassName("oracle.jdbc.driver.OracleDriver");
        //config.setJdbcUrl("jdbc:oracle......");
        config.setDriverClassName("com.mysql.jdbc.Driver");
        config.setJdbcUrl("jdbc:mysql://***:13306/ruoyi-vue-pro");
        config.setUsername("***");
        config.setPassword("***");
        config.setSchema("mysql");//?不确定的但是能导出
       // config.addDataSourceProperty("remarksReporting",true); //oracle
        config.addDataSourceProperty("useInformationSchema",true); //mysql

        HikariDataSource dataSource = new HikariDataSource(config);
        EngineConfig engineConfig = EngineConfig.builder()
                .fileOutputDir("d://dbDoc")
                .openOutputDir(true)
                .fileType(EngineFileType.WORD)
                .produceType(EngineTemplateType.velocity)
                .build();

        ProcessConfig processConfig = ProcessConfig.builder()
                .designatedTableName(Arrays.asList("oss_user","oss_dept"))
//                .designatedTablePrefix(new ArrayList<>())
//                .designatedTableSuffix()
//                .ignoreTableName()
//                .ignoreTablePrefix()
//                .ignoreTableSuffix()
                .build();

        Configuration configuration = Configuration.builder()
                .version("1.0.0")
                .description("数据库说明文档")
                .dataSource(dataSource)
                .engineConfig(engineConfig)
                .produceConfig(processConfig)
                .build();

        new DocumentationExecute(configuration).execute();
    }

}

pom文件需要引入

<dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>3.4.5</version>
        </dependency>
        <dependency>
            <groupId>cn.smallbun.screw</groupId>
            <artifactId>screw-core</artifactId>
            <version>1.0.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.7</version>
        </dependency>

你可能感兴趣的:(oracle,java,mysql)