IlvDB2ConnectionInfo theDB2Connection=new IlvDB2ConnectionInfo(); theDB2Connection.setHostName("server_hostname"); theDB2Connection.setHostPort("50001"); theDB2Connection.setUser("a_db2_user"); theDB2Connection.setPassword("password"); theDB2Connection.setDatabaseName("database_name")
// we want to fetch layer "A_DB2_USER.FLOODZONES.LOCATION.SRID=100002" String layerName="A_DB2_USER.FLOODZONES.LOCATION.SRID=100002"; IlvDB2DataSource dataSource=new IlvDB2DataSource(DB2Connection, layerName);
boolean useTiling = true; int rowCount = 5; int columnCount = 5; dataSource.setTilingParameters(useTiling, rowCount, columnCount);
dataSource.setManager(getView().getManager());
IlvMapLayerTreeModel mltm = IlvMapLayerTreeProperty.GetMapLayerTreeModel(v.getManager()); mltm.addChild(null, dataSource.getInsertionLayer());
IlvMapDataSourceModel dataSourceModel = IlvMapDataSourceProperty.GetMapDataSourceModel(manager); dataSourceModel.insert(dataSource);
dataSource.start();