Before attempting to access data sources directly, ensure you have the Sun JDBC 2.0 Standard Extension packages installed.

Perform the following steps to directly connect to a data source:

  1. Include an import statement in an application to import the NvDataSource class, as follows:
    import com.attunity.jdbc.NvDataSource;
  2. Specify the following in order to define a data source object: NvDataSource ds = new NvDataSource();
    were ds is the name of the data source object.
  3. Specify the methods for the data source object, using the following syntax:
    ds.method
  4. Where ds is the name of the data source object, as specified in the previous step. For example, the following specifies the server and port for a connection:
    ds.setServerName("osf.acme.com");
    ds.setPortNumber(8888);
    Note: The methods available for the data source object are described in JDBC API Conformance.
  5. Connect to AIS using the following syntax:
    Connection con = ds.getConnection();
    were con is the connection instance.