iobjects java 10.1.2,windows11,postgres 15 用idesktopx创建的数据源,在桌面能打开,通过组件用两种方式都打开失败
Workspace workspace=new Workspace();
DatasourceConnectionInfo datasourceConnectionInfo = new DatasourceConnectionInfo();
//1
datasourceConnectionInfo.setEngineType(EngineType.POSTGRESQL); datasourceConnectionInfo.setServer("localhost:5432"); datasourceConnectionInfo.setDatabase("inmo_idm_kj");
datasourceConnectionInfo.setUser("postgres");
datasourceConnectionInfo.setPassword("postgres");
datasourceConnectionInfo.setAlias("QJDC");
//2
datasourceConnectionInfo.loadFromDCF("E:\\2-doc\\5-gis\\DatabaseConnectionFile.dcf");
Datasource datasource = workspace.getDatasources().open(datasourceConnectionInfo);
报错信息: Exception in thread "main" javax.management.RuntimeErrorException: 数据库连接失败,请检查数据源连接参数 at com.supermap.data.Datasources.open(Datasources.java:128) at com.company.Main1.main(Main1.java:30)