public abstract class ScrewDriverDbUtil extends Object
| 构造器和说明 |
|---|
ScrewDriverDbUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract boolean |
createDatabase(SdAbstractDatabaseContent content)
创建数据库
|
abstract boolean |
createDatabase(SdDatabaseOptions config,
SdAbstractDatabaseContent content)
创建数据库
|
abstract boolean |
createTable(SdAbstractTableContent content)
创建一张表
|
abstract boolean |
deleteTable(SdAbstractTableContent content)
删除一张表
|
abstract boolean |
existDatabase(SdDatabaseOptions config,
String dbName)
数据库是否存在
|
abstract boolean |
existDatabase(String dbName)
数据库是否存在
|
abstract boolean |
existTable(String tableName)
数据库表是否存在
|
abstract Connection |
getConnection()
获取数据库连接
|
abstract Connection |
getConnection(SdDatabaseOptions config)
获取数据库连接
|
abstract SdTable |
getSdTable(String tableName)
获取数据库中指定表的描述
|
abstract SdTable |
getSdTable(String tableName,
boolean unique,
boolean approximate)
获取数据库中指定表的描述
|
abstract SdTableAttribute |
getTableAttribute(String tableName)
获取指定数据库,指定表的属性,如果不存在返回null
|
abstract List<SdTableColumnAttribute> |
getTableColumnsAttribute(String tableName)
获取当前数据库中指定表的所有属性,如果不存在抛出异常
|
abstract List<SdTablePortedKeysAttribute> |
getTableExportedKeysAttribute(String tableName)
获取指定表的外键索引属性,如果不存在返回长度为0的集合
|
abstract List<SdTablePortedKeysAttribute> |
getTableImportedKeysAttribute(String tableName)
获取指定表的主键索引属性,如果不存在返回长度为0的集合
|
abstract List<SdTableIndexKeyAttribute> |
getTableIndexKeysAttribute(String tableName,
boolean unique,
boolean approximate)
获取指定表的索引属性,如果不存在返回长度为0的集合
|
abstract List<String> |
getTableNames()
获取当前数据库所有数据库表名,如果不存在返回长度为0的集合
|
abstract SdTablePrimaryKeyAttribute |
getTablePrimaryKeyAttribute(String tableName)
获取指定表的主键属性,如果不存在返回null
|
static ScrewDriverDbUtil |
instance(SdDatabaseOptions databaseOptions)
根据配置文件实例化ScrewDriverDbUtil
|
abstract boolean |
updateDatabase(SdAbstractDatabaseContent content)
修改数据库
|
abstract boolean |
updateDatabase(SdDatabaseOptions config,
SdAbstractDatabaseContent content)
修改数据库
|
abstract boolean |
updateTable(SdAbstractTableContent content)
修改一张表
|
public static ScrewDriverDbUtil instance(SdDatabaseOptions databaseOptions)
databaseOptions - public abstract Connection getConnection() throws Exception
config - Exceptionpublic abstract Connection getConnection(SdDatabaseOptions config) throws Exception
config - Exceptionpublic abstract boolean existDatabase(String dbName) throws Exception
dbName - 数据库名称Exceptionpublic abstract boolean existDatabase(SdDatabaseOptions config, String dbName) throws Exception
config - 数据库连接信息dbName - 数据库名称Exceptionpublic abstract boolean existTable(String tableName) throws Exception
Exceptionpublic abstract boolean createDatabase(SdAbstractDatabaseContent content) throws Exception
content - 数据库创建的内容Exceptionpublic abstract boolean createDatabase(SdDatabaseOptions config, SdAbstractDatabaseContent content) throws Exception
config - 数据库连接信息content - 数据库创建的内容Exceptionpublic abstract boolean updateDatabase(SdAbstractDatabaseContent content) throws Exception
content - 数据库修改的内容Exceptionpublic abstract boolean updateDatabase(SdDatabaseOptions config, SdAbstractDatabaseContent content) throws Exception
config - 数据库连接信息content - 数据库修改的内容Exceptionpublic abstract boolean createTable(SdAbstractTableContent content) throws Exception
content - Exceptionpublic abstract boolean updateTable(SdAbstractTableContent content) throws Exception
content - Exceptionpublic abstract boolean deleteTable(SdAbstractTableContent content) throws Exception
content - Exceptionpublic abstract SdTable getSdTable(String tableName) throws Exception
tableName - Exceptionpublic abstract SdTable getSdTable(String tableName, boolean unique, boolean approximate) throws Exception
tableName - 表的名字unique - when true, return only indices for unique values;when false,
return indices regardless of whether unique or not (get index info
)approximate - when true, result is allowed to reflect approximateor out of data
values; when false, results are requested to beaccurate (get index
info )Exceptionpublic abstract List<String> getTableNames() throws Exception
Exceptionpublic abstract SdTableAttribute getTableAttribute(String tableName) throws Exception
config - tableName - Exceptionpublic abstract List<SdTableColumnAttribute> getTableColumnsAttribute(String tableName) throws Exception
tableName - Exceptionpublic abstract SdTablePrimaryKeyAttribute getTablePrimaryKeyAttribute(String tableName) throws Exception
tableName - Exceptionpublic abstract List<SdTableIndexKeyAttribute> getTableIndexKeysAttribute(String tableName, boolean unique, boolean approximate) throws Exception
tableName - unique - when true, return only indices for unique values;when false,
return indices regardless of whether unique or notapproximate - when true, result is allowed to reflect approximateor out of data
values; when false, results are requested to beaccurateExceptionpublic abstract List<SdTablePortedKeysAttribute> getTableExportedKeysAttribute(String tableName) throws Exception
tableName - Exceptionpublic abstract List<SdTablePortedKeysAttribute> getTableImportedKeysAttribute(String tableName) throws Exception
tableName - ExceptionCopyright © 2019 Mirren Tools. All rights reserved.