2

I'm using arcObjects 9.2.6 java librairies to change connection/path properties within a java prog. This prog aims to change path and connection properties for all layers of an mxd file. It works well with Layers wich use Shape file. It also works well with layers from Database whith no joins. However when a joins to another table exists on layers it does not work.

what i do for database layers is :

dataSetName = datasetName.getName();
propertySet = (IPropertySet) new PropertySet();
propertySet.setProperty(SDE_SERVER, properties.get(SDE_SERVER));
propertySet.setProperty(SDE_INSTANCE, properties.get(SDE_INSTANCE));
propertySet.setProperty(SDE_DATABASE, properties.get(SDE_DATABASE));
propertySet.setProperty(SDE_USER, properties.get(SDE_USER));
propertySet.setProperty(SDE_PASSWORD, properties.get(SDE_PASSWORD));
propertySet.setProperty(SDE_VERSION, properties.get(SDE_VERSION));
workspaceNameCible = (IWorkspaceName2) new WorkspaceName();
workspaceNameCible.setWorkspaceFactoryProgID(SDE_SOURCE_ID);
workspaceNameCible.setConnectionProperties(propertySet);
datasetName.setWorkspaceNameByRef(workspaceNameCible);
if (dataSetName.contains(".")) {
  datasetName.setName(dataSetName.replaceAll(dataSetName.substring(0, dataSetName.indexOf(".")), properties.get(SDE_USER).toString()));
}

This correctly changed the connection information of the layer but not the joins.

For example if my layer contains a join on a table identified by sde_user.my_table and i execute the code to change the sde_user to sde_user2, the layer will have sde_user2 but the joins still remains on sde_user.my_table (where i expect sde_user2.my_table).

I've searched how to get the joins from the layer and see if it is possible to change their connection properties but i've found nothing.

Any suggestions ??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.