Holger's
Java API

com.antelmann.sql
Class JDBCResourceControl

java.lang.Object
  extended by java.util.ResourceBundle.Control
      extended by com.antelmann.sql.JDBCResourceControl

public class JDBCResourceControl
extends ResourceBundle.Control

allows to conveniently store language in a jdbc table, where column names correspond to the locale

Since:
9. März 2007, 16:44
Author:
Holger Antelmann
See Also:
JDBCResourceBundle, TableListResourceBundle, JDBCResourceBundle

Field Summary
 
Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
 
Constructor Summary
JDBCResourceControl(Connection con, String keyColumn, String valueBaseColumn, boolean useCaching)
          if useCaching is true, a TableResourceBundle is used; otherwise, a JDBCResourceBundle is used.
 
Method Summary
 Locale getFallbackLocale(String baseName, Locale l)
          always returns null, so that instead of defaulting to the default locale of the system, this control uses the root locale.
 List<String> getFormats(String baseName)
           
 ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload)
          returns either a JDBCResourceBundle or a TableResourceBundle, depending on whether caching is used (see constructor).
 
Methods inherited from class java.util.ResourceBundle.Control
getCandidateLocales, getControl, getNoFallbackControl, getTimeToLive, needsReload, toBundleName, toResourceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCResourceControl

public JDBCResourceControl(Connection con,
                           String keyColumn,
                           String valueBaseColumn,
                           boolean useCaching)
if useCaching is true, a TableResourceBundle is used; otherwise, a JDBCResourceBundle is used.

Method Detail

getFallbackLocale

public Locale getFallbackLocale(String baseName,
                                Locale l)
always returns null, so that instead of defaulting to the default locale of the system, this control uses the root locale.

Overrides:
getFallbackLocale in class ResourceBundle.Control

getFormats

public List<String> getFormats(String baseName)
Overrides:
getFormats in class ResourceBundle.Control

newBundle

public ResourceBundle newBundle(String baseName,
                                Locale locale,
                                String format,
                                ClassLoader loader,
                                boolean reload)
                         throws IllegalAccessException,
                                InstantiationException,
                                IOException
returns either a JDBCResourceBundle or a TableResourceBundle, depending on whether caching is used (see constructor).

Overrides:
newBundle in class ResourceBundle.Control
Throws:
IllegalAccessException
InstantiationException
IOException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads