Package com.microsoft.sqlserver.jdbc

# Class SQLServerDataSourceObjectFactory

java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerDataSourceObjectFactory

All Implemented Interfaces:
  `javax.naming.spi.ObjectFactory`

    public final class SQLServerDataSourceObjectFactory
    extends java.lang.Object
    implements javax.naming.spi.ObjectFactory

Defines an object factory to materialize datasources from JNDI.

## Constructor Summary

Constructors
Constructor | Description
--- | ---
`SQLServerDataSourceObjectFactory()` | Constructs a SQLServerDataSourceObjectFactory.

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`java.lang.Object` | `getObjectInstance​(java.lang.Object ref, javax.naming.Name name, javax.naming.Context c, java.util.Hashtable<?,​?> h)` | Returns an reference to the SQLServerDataSource instance getObjectInstance is a factory for rehydrating references to SQLServerDataSource and its child classes.

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

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

## Constructor Details

### SQLServerDataSourceObjectFactory

public SQLServerDataSourceObjectFactory()
Constructs a SQLServerDataSourceObjectFactory.

## Method Details

### getObjectInstance

public java.lang.Object getObjectInstance​(java.lang.Object ref, javax.naming.Name name, javax.naming.Context c, java.util.Hashtable<?,​?> h) throws SQLServerException
Returns an reference to the SQLServerDataSource instance getObjectInstance is a factory for rehydrating references to SQLServerDataSource and its child classes. Caller gets the reference by calling SQLServerDataSource.getReference. References are used by JNDI to persist and rehydrate objects.

Specified by:
  `getObjectInstance` in interface `javax.naming.spi.ObjectFactory`
Throws:
  `SQLServerException`