org.apache.commons.dbutils
クラス QueryLoader

java.lang.Object
  上位を拡張 org.apache.commons.dbutils.QueryLoader

public class QueryLoader
extends java.lang.Object

QueryLoader is a registry for sets of queries so that multiple copies of the same queries aren't loaded into memory. This implementation loads properties files filled with query name to SQL mappings. This class is thread safe.


メソッドの概要
static QueryLoader instance()
          Return an instance of this class.
 java.util.Map load(java.lang.String path)
          Loads a Map of query names to SQL values.
 void unload(java.lang.String path)
          Removes the queries for the given path from the cache.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

instance

public static QueryLoader instance()
Return an instance of this class.

戻り値:
The Singleton instance.

load

public java.util.Map load(java.lang.String path)
                   throws java.io.IOException
Loads a Map of query names to SQL values. The Maps are cached so a subsequent request to load queries from the same path will return the cached Map.

パラメータ:
path - The path that the ClassLoader will use to find the file. This is not a file system path. If you had a jarred Queries.properties file in the com.yourcorp.app.jdbc package you would pass "/com/yourcorp/app/jdbc/Queries.properties" to this method.
戻り値:
Map of query names to SQL values
例外:
java.io.IOException - if a file access error occurs
java.lang.IllegalArgumentException - if the ClassLoader can't find a file at the given path.

unload

public void unload(java.lang.String path)
Removes the queries for the given path from the cache.

パラメータ:
path - The path that the queries were loaded from.