Using the Informix spatial data source

The IlvInformixDataSource class is an IlvMapDataSource for reading georeferenced objects from an Informix® spatial datablade. It wraps up all operations (connecting to database, reading features, rendering them to graphic objects) in a convenient way.
To read a map stored in an Informix spatial datablade:
  1. Create a connection to the Informix Spatial datablade:
    IlvInformixConnectionInfo cx = new IlvInformixConnectionInfo(); 
    cx.setHostName("server_hostname");
    cx.setHostPort("9088");
    cx.setUser("an_informix_user");
    cx.setServer("informix_server_name");
    cx.setPassword("password");
    cx.setDatabaseName("database_name");
    
  2. Create a data source with this connection as a parameter:
    // we want to fetch layer "AN_INFORMIX_USER.WORLD.GEOM.SRID=0"
    String layerName="AN_INFORMIX_USER.WORLD.GEOM.SRID=0";
    IlvInformixDataSource dataSource=new IlvInformixDataSource(cx, layerName);
    
    To obtain a list of layers, see Getting a list of layers
  3. Set parameters on this data source to use load-on-demand, if needed:
    boolean useTiling = true;
    int rowCount = 5;
    int columnCount = 5;
    dataSource.setTilingParameters(useTiling, rowCount, columnCount);
    
  4. Connect this data source to the manager of the view:
    dataSource.setManager(getView().getManager());
  5. Insert the data source map layer into the layer tree: You first need to retrieve the layer model from the property of the manager:
    IlvMapLayerTreeModel mltm = IlvMapLayerTreeProperty.GetMapLayerTreeModel(v.getManager());
    mltm.addChild(null, dataSource.getInsertionLayer());
    
  6. Insert the data source into the data source tree. You first need to retrieve the data source model from the property of the manager:
    IlvMapDataSourceModel dataSourceModel = 
    IlvMapDataSourceProperty.GetMapDataSourceModel(manager);
    dataSourceModel.insert(dataSource);
    
  7. Finally, start the data source (or the whole model, if you have more than one data source):
    IlvDBConnectionInfo cx=…;
    String[] layersList = cx.getSpatiallyEnabledTableNames();