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
    • 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 - 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