com.centit.support.database.metadata.DatabaseMetadata Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of centit-database Show documentation
Show all versions of centit-database Show documentation
数据库操作通用方法和函数,从以前的util包中分离出来,并且整合了部分sys-module中的函数
package com.centit.support.database.metadata;
import com.centit.support.database.utils.DBType;
import java.sql.Connection;
import java.sql.SQLException;
@SuppressWarnings("unused")
public interface DatabaseMetadata {
void setDBConfig(Connection dbc);
SimpleTableInfo getTableMetadata(String tabName);
String getDBSchema();
void setDBSchema(String schema);
static DatabaseMetadata createDatabaseMetadata(final DBType dbtype)
throws SQLException {
switch (dbtype){
case Oracle:
return new OracleMetadata();
case DB2:
return new DB2Metadata();
case SqlServer:
return new SqlSvrMetadata();
case MySql:
case Access:
case H2:
default:
return new JdbcMetadata();
}
}
}