类 DatabaseUtils
java.lang.Object
com.walker.dbmeta.util.DatabaseUtils
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static AddresscopyAddress(Address addr, boolean isUsing, int suffixIndex, String defineName) 克隆一个Address资源地址对象static StringfindIndexNameInSQL(String createTableSQL) 找到SQL语句中的索引名字,如果是创建索引语句的话static final String返回创建索引SQL中的表名称static final StringfindTableNameInSQL(String createTableSQL) 从创建表的SQL中找出表名static final intgetDatabaseNameIndex(String dbName) 返回数据库名字后面的后缀,如果不存在返回-1static final StringgetMySQLSchemaName(String serviceName) 把MySQL的服务名字中提取数据库,因为里面会有参数,如:walkersoft-share-marks?static booleanisCreateIndexSQL(String sql) 是个创建索引的SQL语句static booleanisCreateTableSQL(String sql) 是个创建表结构的SQL语句static voidstatic booleanmanualCreatePhysicalTable(DatabaseConnector connector, String createSQL, String tableName, String business) 手动创建物理表数据,在存在元数据的情况下,物理表不存在,需要通过该方法创建。
-
字段详细资料
-
构造器详细资料
-
DatabaseUtils
public DatabaseUtils()
-
-
方法详细资料
-
copyAddress
public static Address copyAddress(Address addr, boolean isUsing, int suffixIndex, String defineName) 克隆一个Address资源地址对象- 参数:
addr-isUsing- 是否正在使用suffixIndex- 命名的后缀,多库使用- 返回:
-
getMySQLSchemaName
把MySQL的服务名字中提取数据库,因为里面会有参数,如:walkersoft-share-marks?characterEncoding=UTF-8 提取之后结果为:walkersoft-share-marks- 参数:
serviceName-- 返回:
-
getDatabaseNameIndex
返回数据库名字后面的后缀,如果不存在返回-1 如:demo_1, test_u_2- 参数:
dbName-- 返回:
-
findTableNameInSQL
从创建表的SQL中找出表名- 参数:
createTableSQL-- 返回:
- 抛出:
DatabaseException
-
findIndexNameInSQL
找到SQL语句中的索引名字,如果是创建索引语句的话- 参数:
createTableSQL-- 返回:
- 抛出:
DatabaseException
-
findTableNameInIndex
返回创建索引SQL中的表名称- 参数:
sql-- 返回:
-
isCreateTableSQL
是个创建表结构的SQL语句- 参数:
sql-- 返回:
-
isCreateIndexSQL
是个创建索引的SQL语句- 参数:
sql-- 返回:
-
manualCreatePhysicalTable
public static boolean manualCreatePhysicalTable(DatabaseConnector connector, String createSQL, String tableName, String business) throws DatabaseException 手动创建物理表数据,在存在元数据的情况下,物理表不存在,需要通过该方法创建。- 参数:
connector-createSQL-tableName- 缺失的表名,如:rec_main_consume_709business- 业务参数,如:customerCode- 返回:
- 抛出:
DatabaseException
-
main
- 抛出:
Exception
-