com.esri.arcgis.geodatabase
Class IWorkspaceProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.IWorkspaceProxy
All Implemented Interfaces:
IWorkspace, Externalizable, Serializable

public class IWorkspaceProxy
extends com.esri.arcgis.interop.Dispatch
implements IWorkspace, Serializable

Provides access to members that have information about the workspace.

Remarks

A Workspace is a container of spatial and non-spatial datasets such as feature classes, raster datasets, and tables. It provides methods to instantiate existing datasets and to create new datasets. Workspaces are classified into types specified by the esriWorkspaceType enumerator; FileSystemWorkspace, LocalDatabaseWorkspace, and RemoteDatabaseWorkspace.

Shapefiles and ArcGIS for Desktop Advanced workspaces are examples of FileSystemWorkspace. A personal geodatabase stored in an Access or a File Geodatabase is an example of a LocalDatabaseWorkspace. A geodatabase stored in an RDBMS such as Oracle, DB2, SqlServer, or Informix and accessed via ArcSDE is an example of a RemoteDatabaseWorkspace.

The WorkspaceName for a workspace can be persisted, for example, in a map document. An application can call the Open method on the workspace name after loading it from persistent storage in order to connect to and get an object reference to the workspace. A WorkspaceName name object can be returned from a workspace through the use of IDataset.FullName.

The IWorkspace interface provides methods for accessing various properties of a workspace, such as its connection properties, and the collection of datasets it contains.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

IWorkspaceFactory rasWkspFactory = new RasterWorkspaceFactory();

IWorkspace wksp = new RasterWorkspace(rasWkspFactory.openFromFile(aPath, 0));

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  IWorkspaceProxy()
           
  IWorkspaceProxy(Object obj)
           
protected IWorkspaceProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void executeSQL(String sqlStmt)
          Executes the specified SQL statement.
 boolean exists()
          Checks if the workspace exists.
 IPropertySet getConnectionProperties()
          The connection properties of the workspace.
 IEnumDatasetName getDatasetNames(int datasetType)
          The DatasetNames in the workspace.
 IEnumDataset getDatasets(int datasetType)
          The datasets in the workspace.
 String getPathName()
          The file system full path of the workspace.
 int getType()
          The Type of the Workspace.
 IWorkspaceFactory getWorkspaceFactory()
          The factory that created the workspace.
 boolean isDirectory()
          TRUE if the workspace is a file system directory.
 void removeListener(String iidStr, Object theListener)
           
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IWorkspaceProxy

public IWorkspaceProxy()

IWorkspaceProxy

public IWorkspaceProxy(Object obj)
                throws IOException
Throws:
IOException

IWorkspaceProxy

protected IWorkspaceProxy(Object obj,
                          String iid)
                   throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

getConnectionProperties

public IPropertySet getConnectionProperties()
                                     throws IOException,
                                            AutomationException
The connection properties of the workspace.

Remarks

The ConnectionProperties property of a workspace returns the set of named connection properties for this workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getConnectionProperties in interface IWorkspace
Returns:
A reference to a com.esri.arcgis.system.IPropertySet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWorkspaceFactory

public IWorkspaceFactory getWorkspaceFactory()
                                      throws IOException,
                                             AutomationException
The factory that created the workspace.

Remarks

The WorkspaceFactory property can be used to get a reference back to the workspace factory for this workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getWorkspaceFactory in interface IWorkspace
Returns:
A reference to a com.esri.arcgis.geodatabase.IWorkspaceFactory
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDatasets

public IEnumDataset getDatasets(int datasetType)
                         throws IOException,
                                AutomationException
The datasets in the workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDatasets in interface IWorkspace
Parameters:
datasetType - A com.esri.arcgis.geodatabase.esriDatasetType constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDatasetNames

public IEnumDatasetName getDatasetNames(int datasetType)
                                 throws IOException,
                                        AutomationException
The DatasetNames in the workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDatasetNames in interface IWorkspace
Parameters:
datasetType - A com.esri.arcgis.geodatabase.esriDatasetType constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumDatasetName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPathName

public String getPathName()
                   throws IOException,
                          AutomationException
The file system full path of the workspace.

Remarks

If a remote workspace is opened using connection properties, this will be empty.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPathName in interface IWorkspace
Returns:
The pathName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getType

public int getType()
            throws IOException,
                   AutomationException
The Type of the Workspace.

Remarks

See esriWorkspaceType for information on the types of workspaces.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getType in interface IWorkspace
Returns:
A com.esri.arcgis.geodatabase.esriWorkspaceType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirectory

public boolean isDirectory()
                    throws IOException,
                           AutomationException
TRUE if the workspace is a file system directory.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirectory in interface IWorkspace
Returns:
The isDir
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exists

public boolean exists()
               throws IOException,
                      AutomationException
Checks if the workspace exists.

Remarks

This method can be used with workspaces from file-based data sources to detect if they've been deleted by another application. For example, a shapefile workspace is a directory and can be deleted while the workspace is open.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
exists in interface IWorkspace
Returns:
The exists
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

executeSQL

public void executeSQL(String sqlStmt)
                throws IOException,
                       AutomationException
Executes the specified SQL statement.

Remarks

The ExecuteSQL method can be used to send an arbitrary SQL statement to the underlying database for execution. The statement can be any DDL (data definition language) or DML (data manipulation language) statement but can not return any result sets. The syntax for the SQL is as required by the underlying database. The workspace supports an optional ISQLSyntax interface that provides information to applications on aspects of the SQL Syntax for the underlying database.

To determine if a workspace supports the ExecutesSQL method, an application can check the value of the canExecuteSQLworkspace property via the optional IWorkspaceProperties interface. In general, this method is only supported on local and remote database workspaces.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
executeSQL in interface IWorkspace
Parameters:
sqlStmt - The sqlStmt (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.