org.apache.geode.connectors.jdbc

## Class JdbcLoader<K,V>

- java.lang.Object
- - org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback
  - - org.apache.geode.connectors.jdbc.JdbcLoader<K,V>

- All Implemented Interfaces:
    CacheCallback, CacheLoader<K,V>, Declarable

      @Experimental
      public class JdbcLoader<K,V>
      extends org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback
      implements CacheLoader<K,V>

  This class provides loading from a data source using JDBC.
  Since:
    Geode 1.4

- - ### Field Summary

    - ### Fields inherited from class org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback

      `cache`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JdbcLoader()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `load(LoaderHelper<K,V> helper)` Loads a value.

    - ### Methods inherited from class org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback

      `checkInitialized, close, eventCanBeIgnored, getSqlHandler`

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

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

    - ### Methods inherited from interface org.apache.geode.cache.CacheCallback

      `close`

    - ### Methods inherited from interface org.apache.geode.cache.Declarable

      `init, initialize`

- - ### Constructor Detail

    - #### JdbcLoader

          public JdbcLoader()

  - ### Method Detail

    - #### load

          public V load(LoaderHelper<K,V> helper)
                 throws CacheLoaderException

      Description copied from interface: `CacheLoader`
      Loads a value. Application writers should implement this method to customize the loading of a value. This method is called by the caching service when the requested value is not in the cache. Any exception (including an unchecked exception) thrown by this method is propagated back to and thrown by the invocation of `Region.get(Object, Object)` that triggered this load.

      Specified by:
        `load` in interface `CacheLoader<K,V>`
      Parameters:
        `helper` - a LoaderHelper object that is passed in from cache service and provides access to the key, region, argument, and `netSearch`.
      Returns:
        this method always returns a PdxInstance. It does not matter what the V generic parameter is set to.
      Throws:
        `CacheLoaderException`
      See Also:
        `Region.get`