public class DbConfig extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_USER_OR_AUTHORIZATION
默认的账号或者密码
|
Constructor and Description |
---|
DbConfig() |
Modifier and Type | Method and Description |
---|---|
void |
clearExecuteSqlLog()
清除执行记录
|
void |
close() |
File |
dbLocalPath()
获取数据库保存路径
|
String |
deleteDbFiles()
恢复数据库
|
void |
executeRecoverDbSql(cn.hutool.db.ds.DSFactory dsFactory)
恢复数据库
|
String |
getDbName() |
String |
getDbUrl()
获取数据库的jdbc 连接
|
static DbConfig |
getInstance()
单利模式
|
void |
initOk() |
boolean |
isInit() |
Set<String> |
loadExecuteSqlLog()
加载 本地已经执行的记录
|
void |
recoverDb()
恢复数据库
|
void |
saveExecuteSqlLog(Set<String> logs)
保存本地已经执行的记录
|
void |
transformSql(File sqlFile)
转换 sql 文件内容,低版本兼容高版本
|
public static final String DEFAULT_USER_OR_AUTHORIZATION
public static DbConfig getInstance()
public void initOk()
public void close()
public boolean isInit()
public File dbLocalPath()
public String getDbUrl()
public String getDbName()
public void transformSql(File sqlFile)
sqlFile
- sql 文件public void clearExecuteSqlLog()
public void executeRecoverDbSql(cn.hutool.db.ds.DSFactory dsFactory) throws Exception
dsFactory
- 数据库连接Exception
Copyright © 2017–2022. All rights reserved.