org.apache.commons.dbutils
クラス QueryLoader

java.lang.Object
  拡張org.apache.commons.dbutils.QueryLoader

public class QueryLoader
extends Object

QueryLoader は、SQL文をマップさせた問い合わせ名称を満たすプロパティファイルを読み込みます。 問い合わせ一式の登録処理を行うため、同一の問い合わせ名称で重複するコピー内容はメモリへ読み込まれません。 このクラスはスレッドセーフです。

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.

作成者:
David Graham
翻訳者:
小川 環
校正者:
日置 聡
翻訳状況:
校正者校正中
翻訳更新日:
2003/12/22

コンストラクタの概要
protected QueryLoader()
          QueryLoader のコンストラクタ。
 
メソッドの概要
static QueryLoader instance()
          このクラスのインスタンスを返します。
 Map load(String path)
          問い合わせ名称とSQL文の値が対応付けられたMapを読み込みます。
 void unload(String path)
          指定したパスに対応する問い合わせをキャッシュされたMapから削除します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

QueryLoader

protected QueryLoader()
QueryLoader のコンストラクタ。
QueryLoader constructor.

メソッドの詳細

instance

public static QueryLoader instance()
このクラスのインスタンスを返します。
Return an instance of this class.

戻り値:
Singletonインスタンス。
The Singleton instance.

load

public Map load(String path)
         throws IOException
問い合わせ名称とSQL文の値が対応付けられたMapを読み込みます。 当該 Map はキャッシュ化され、同じパスから読み込まれた後に要求されると、キャッシュされた Map が返されます。
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 - クラスローダがファイルを検索するのに使用するパス。 これはファイルシステムのパスではありません。 JAR化されたcom.yourcorp.app.jdbcパッケージのQueries.propertiesファイルを配置した場合、 このメソッドに "/com/yourcorp/app/jdbc/Queries.properties" を渡してください。
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.

unload

public void unload(String path)
指定したパスに対応する問い合わせをキャッシュされたMapから削除します。
Removes the queries for the given path from the cache.

パラメータ:
path - 問い合わせが読み込まれたパス。
The path that the queries were loaded from.


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation