|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.dbutils.QueryLoader
QueryLoader
loads properties files filled with query name to
SQL mappings. It acts as a registry for sets of queries so that multiple
copies of the same queries aren't loaded into memory. This class is thread
safe.
Field Summary | |
private static QueryLoader |
instance
The Singleton instance of this class. |
private Map |
queries
Maps query set names to Maps of their queries. |
Constructor Summary | |
protected |
QueryLoader()
QueryLoader constructor. |
Method Summary | |
static QueryLoader |
instance()
Return an instance of this class. |
Map |
load(String path)
Loads a Map of query names to SQL values. |
private Map |
loadQueries(String path)
Loads a properties file into a Map object. |
void |
unload(String path)
Removes the queries for the given path from the cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final QueryLoader instance
private Map queries
Constructor Detail |
protected QueryLoader()
Method Detail |
public static QueryLoader instance()
public Map load(String path) throws IOException
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.
IOException
IllegalArgumentException
- if the ClassLoader can't find a file at
the given path.private Map loadQueries(String path) throws IOException
path
- The path that the ClassLoader will use to find the file.
IOException
public void unload(String path)
path
- The path that the queries were loaded from.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |