怎么打开本地udbx文件并获取dataset? 通过WorkspaceConnectionInfo获取吗?
·
Workspace workspace = new Workspace(); WorkspaceConnectionInfo workspaceConnectionInfo = new WorkspaceConnectionInfo(); workspaceConnectionInfo.setType(WorkspaceType.SXW); String file = "F:\\workdata\\ProjectDocument\\天府管廊项目\\超图模板\\雅州路.udbx"; workspaceConnectionInfo.setServer(file); workspace.open(workspaceConnectionInfo); Datasource datasource = workspace.getDatasources().get(0); Recordset recordset = null; int fieldCount = recordset.getFieldCount(); System.out.println("fieldCount = " + fieldCount); DatasetVector dataset = (DatasetVector) datasource.getDatasets().get( "雅州路"); System.out.println("数据集的描述信息为:" + dataset.getDescription());
这个是获取数据集的代码,但是没获取到? Datasource datasource = workspace.getDatasources().get(0);这行报数组越界异常