com.mapinfo.midev.xml.mws

## Class Connection

- java.lang.Object
- - com.mapinfo.midev.xml.mws.Connection

    public final class Connection
    extends Object

Represents a Connection in an MWS. Used for both reading and writing.

### Constructor Summary

Constructors
Constructor and Description
`Connection(String name, IDataSourceDefinition dataSourceDefinition)` Creates a Connection instance with the specified name and IDataSourceDefinition.

### Method Summary

All Methods Instance Methods Concrete Methods
`IDataSource` `getDataSource()` Returns an IDataSource instance using the IDataSourceDefinition.
`IDataSourceDefinition` `getDataSourceDefinition()` Returns the IDataSourceDefinition.
`String` `getName()` Returns the name of the Connection.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Connection

    public Connection(String name,
                      IDataSourceDefinition dataSourceDefinition)

Creates a Connection instance with the specified name and IDataSourceDefinition. If the specified name is null this usually indicates that the Connection will not be saved in the ConnectionSet element but will instead be saved 'inline' with the DataSourceDefinition that needs the Connection.

Parameters:
  `name` - The name of the Connection. May be null.
  `dataSourceDefinition` - The IDataSourceDefinition that this Connection represents.

### Method Detail

#### getName

    public String getName()

Returns the name of the Connection.

Returns:
  the name of the Connection.

#### getDataSourceDefinition

    public IDataSourceDefinition getDataSourceDefinition()

Returns the IDataSourceDefinition.

Returns:
  the IDataSourceDefinition.

#### getDataSource

    public IDataSource getDataSource()

Returns an IDataSource instance using the IDataSourceDefinition. Only one instance is created and is only created when this method is called.

Returns:
  an IDataSource instance using the IDataSourceDefinition.