JdbcLoader (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.connectors.jdbc, class: JdbcLoader

Package 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
  Description
  `JdbcLoader()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `V`
  `load(LoaderHelper<K,V> helper)`
  Loads a value.

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

  `checkInitialized, 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 Details

  - ### JdbcLoader

    public JdbcLoader()

- ## Method Details

  - ### 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` - if an error occurs. This exception or any other exception thrown by this method will be propagated back to the application from the get method.
    See Also:
      - `Region.get`