public class DatasourceUtilities
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static boolean |
attemptToOpenDatasource(com.supermap.data.DatasourceConnectionInfo info)
尝试打开一下数据源,并返回是否能成功打开
|
static com.supermap.data.DatasourceConnectionInfo |
cloneInfo(com.supermap.data.DatasourceConnectionInfo srcInfo)
克隆指定的 DatasourceConnectionInfo
|
static boolean |
closeDatasource(com.supermap.data.Datasource... closeDatasources)
关闭数据源
|
static void |
closeMemoryDatasource()
关闭所有内存数据源
|
static boolean |
closeOpenDataset(com.supermap.data.Datasource... closeDatasources)
关闭数据源中打开的数据集
|
static com.supermap.data.DatasourceConnectionInfo |
copyDatasourceConnectionInfo(com.supermap.data.DatasourceConnectionInfo connectionInfo) |
static com.supermap.data.Datasource |
createDatasource(java.lang.String filePath)
创建文件数据源
|
static java.lang.String[] |
getAllSupportFileExtensions()
所有支持的文件类型
|
static java.lang.String |
getAvailableDatasourceAlias(java.lang.String alias)
查找可用的数据源名称,如果为0则不加后缀
|
static java.lang.String |
getAvailableDatasourceAlias(java.lang.String alias, int index)
以index为后缀开始查找可用的数据源名称,如果为0则不加后缀
|
static com.supermap.data.Datasource |
getDatasource(com.supermap.data.DatasourceConnectionInfo connectionInfo)
根据数据源链接信息,从当前工作空间中获取数据源
|
static com.supermap.data.Datasource |
getDefaultDatasource()
获得默认的数据源,不考虑是否为只读
|
static com.supermap.data.Datasource |
getDefaultNotReadOnlyDatasource()
获得默认非只读数据源
|
static java.lang.String[] |
getEngineSupportFileExtensions(com.supermap.data.EngineType engineType)
获取引擎支持的文件类型
|
static java.lang.String[] |
getMemoryDatasources(com.supermap.data.Workspace workspace)
获取工作空间中的内存数据源
|
static java.lang.String[] |
getSupportMathsOperation(com.supermap.data.EngineType engineType)
获取引擎支持的数学函数
|
static java.lang.String[] |
getSupportStringFunction(com.supermap.data.EngineType engineType)
获取引擎支持的字符函数
|
static java.lang.String[] |
getSupportTimeFunction(com.supermap.data.EngineType engineType)
获取引擎支持的日期函数
|
static boolean |
hasDatasourceNotReadOnly()
是否包含非只读数据源
|
static boolean |
isContainMemoryDatasource(com.supermap.data.Workspace workspace)
判断工作空间中是否存在内存数据源
|
static boolean |
isDatabaseDatasource(com.supermap.data.EngineType engineType)
根据引擎类型判断是否是数据库型数据源
|
static boolean |
isDatasourceOccupied(java.lang.String datasourcePath)
判断指定的数据源是否被占用,仅 windows 有用,Linux 没用
|
static boolean |
isFileDatasource(com.supermap.data.EngineType engineType)
根据引擎类型判断是否是文件型数据源
|
static boolean |
isMemoryDatasource(com.supermap.data.Datasource datasource)
判断指定的数据源是否内存数据源
|
static boolean |
isSpatialiteDatasource(java.lang.String server)
判断是否为Spatialite 引擎的数据源
|
static boolean |
isWebDatasource(com.supermap.data.EngineType engineType)
根据引擎类型判断是否为web类型的数据源
|
static com.supermap.data.Datasource |
openFileDatasource(java.lang.String fileName, java.lang.String passWord, boolean isReadOnly)
打开指定路径与密码的文件型数据源
|
static com.supermap.data.Datasource |
openFileDatasource(java.lang.String fileName, java.lang.String passWord, boolean isReadOnly, boolean isFirst)
打开文件数据源
|
static com.supermap.data.Datasource |
refreshDatasource(com.supermap.data.Datasource datasource)
刷新指定的数据源,返回结果,对于打开失败的文件型数据源刷新之后会返回一个新的数据源对象
|
static com.supermap.data.Datasource |
refreshDatasourceFile(com.supermap.data.Datasource datasource)
刷新文件型数据源
|
public static void closeMemoryDatasource()
public static boolean closeDatasource(com.supermap.data.Datasource... closeDatasources)
public static boolean closeOpenDataset(com.supermap.data.Datasource... closeDatasources)
closeDatasources
- 要关闭的数据源public static boolean isContainMemoryDatasource(com.supermap.data.Workspace workspace)
workspace
- 工作空间public static java.lang.String[] getMemoryDatasources(com.supermap.data.Workspace workspace)
workspace
- 工作空间public static java.lang.String getAvailableDatasourceAlias(java.lang.String alias)
alias
- 数据源别名public static java.lang.String getAvailableDatasourceAlias(java.lang.String alias, int index)
alias
- 数据源别名index
- 开始查找的indexpublic static com.supermap.data.Datasource openFileDatasource(java.lang.String fileName, java.lang.String passWord, boolean isReadOnly, boolean isFirst)
fileName
- 文件路径passWord
- 密码isReadOnly
- 是否只读打开isFirst
- 是否为第一次打开,第一次打开失败则会给出密码错误提示public static boolean isWebDatasource(com.supermap.data.EngineType engineType)
engineType
- 引擎类型public static boolean isSpatialiteDatasource(java.lang.String server)
server
-public static boolean isFileDatasource(com.supermap.data.EngineType engineType)
engineType
- 引擎类型public static boolean isDatabaseDatasource(com.supermap.data.EngineType engineType)
engineType
- 引擎类型public static com.supermap.data.DatasourceConnectionInfo cloneInfo(com.supermap.data.DatasourceConnectionInfo srcInfo)
public static com.supermap.data.Datasource refreshDatasource(com.supermap.data.Datasource datasource)
datasource
- 要刷新的数据源public static boolean isMemoryDatasource(com.supermap.data.Datasource datasource)
datasource
- 是否为内存数据源public static boolean isDatasourceOccupied(java.lang.String datasourcePath)
datasourcePath
- 数据源路径public static com.supermap.data.Datasource getDefaultNotReadOnlyDatasource()
public static com.supermap.data.Datasource getDefaultDatasource()
public static com.supermap.data.Datasource getDatasource(com.supermap.data.DatasourceConnectionInfo connectionInfo)
connectionInfo
-public static com.supermap.data.Datasource openFileDatasource(java.lang.String fileName, java.lang.String passWord, boolean isReadOnly)
fileName
- 文件路径passWord
- 密码isReadOnly
- 是否只读public static com.supermap.data.Datasource refreshDatasourceFile(com.supermap.data.Datasource datasource)
datasource
- 数据源public static boolean attemptToOpenDatasource(com.supermap.data.DatasourceConnectionInfo info)
info
-public static java.lang.String[] getSupportMathsOperation(com.supermap.data.EngineType engineType)
engineType
- 引擎类型public static java.lang.String[] getSupportStringFunction(com.supermap.data.EngineType engineType)
engineType
- 引擎类型public static java.lang.String[] getSupportTimeFunction(com.supermap.data.EngineType engineType)
engineType
- 引擎类型public static java.lang.String[] getAllSupportFileExtensions()
public static java.lang.String[] getEngineSupportFileExtensions(com.supermap.data.EngineType engineType)
public static com.supermap.data.Datasource createDatasource(java.lang.String filePath)
filePath
- 文件路径public static boolean hasDatasourceNotReadOnly()
public static com.supermap.data.DatasourceConnectionInfo copyDatasourceConnectionInfo(com.supermap.data.DatasourceConnectionInfo connectionInfo)