| |
|
| java.lang.Object org.apache.commons.dbutils.QueryLoader
QueryLoader | public class QueryLoader (Code) | | 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.
|
Constructor Summary | |
protected | QueryLoader() QueryLoader constructor. |
Method Summary | |
public static QueryLoader | instance() Return an instance of this class. | public synchronized Map | load(String path) Loads a Map of query names to SQL values. | protected Map | loadQueries(String path) Loads a set of named queries into a Map object. | public synchronized void | unload(String path) Removes the queries for the given path from the cache. |
QueryLoader | protected QueryLoader()(Code) | | QueryLoader constructor.
|
instance | public static QueryLoader instance()(Code) | | Return an instance of this class.
The Singleton instance. |
load | public synchronized Map load(String path) throws IOException(Code) | | 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.
Parameters: path - The path that the ClassLoader will use to find the file. This is not a file system path. If you had a jarredQueries.properties file in the com.yourcorp.app.jdbc package you would pass "/com/yourcorp/app/jdbc/Queries.properties" to this method. throws: IOException - if a file access error occurs throws: IllegalArgumentException - if the ClassLoader can't find a file atthe given path. Map of query names to SQL values |
loadQueries | protected Map loadQueries(String path) throws IOException(Code) | | Loads a set of named queries into a Map object. This implementation
reads a properties file at the given path.
Parameters: path - The path that the ClassLoader will use to find the file. throws: IOException - if a file access error occurs throws: IllegalArgumentException - if the ClassLoader can't find a file atthe given path. since: DbUtils 1.1 Map of query names to SQL values |
unload | public synchronized void unload(String path)(Code) | | Removes the queries for the given path from the cache.
Parameters: path - The path that the queries were loaded from. |
|
|
|