一、新建springboot项目
1,新建springboot项目,选择必需依赖
说明:这里MySQL和Oracle的驱动我都选了,主要是平时常用的数据库就这两个,这两个添加好之后之后需要生成不同数据库的文档只用修改数据库连接配置文件就行,不同再单独添加依赖。
2、配置数据库连接(Oracle)
说明:配置数据库连接信息就可以,这里配置的是Oracle的连接,如果MySQL不知道如何连接的话百度下,一堆。
二、添加必需依赖
<dependency>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-core</artifactId>
<version>1.0.3</version>
</dependency>
这部没有特别说明,这个开源项目还在更新中,后续会支持更多类型数据库吧,如果需要新版本的话,文末会附上开源项目地址。
三、代码部分
在springboot test测试类中编写即可
package com.light.testdbfile;
import cn.smallbun.screw.core.Configuration;
import cn.smallbun.screw.core.engine.EngineConfig;
import cn.smallbun.screw.core.engine.EngineFileType;
import cn