Index: /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/SimpleQuery.java
===================================================================
--- /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/SimpleQuery.java (revision 8451)
+++ /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/SimpleQuery.java (revision 8451)
@@ -0,0 +1,235 @@
+/*
+ * SimpleQuery.java
+ * SimpleUtil
+ * 
+ * Created by tarchan on 2008/02/14.
+ * Copyright (c) 2008 tarchan. All rights reserved.
+ */
+package com.mac.tarchan.sql;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.Properties;
+
+
+/**
+ * データベースにアクセスします。
+ * 
+ * @version 1.0
+ * @author tarchan
+ * @see PreparedStatement
+ * @see SimpleResult
+ * @see UpdateCount
+ */
+public class SimpleQuery
+{
+	/** JDBC ドライバ */
+	private static String sqlDriver = "oracle.jdbc.driver.OracleDriver";
+
+	/** 接続文字列 */
+	private static String sqlUrl = "jdbc:oracle:thin:@172.16.2.75:1521:OWLDB";
+
+	/** 接続ユーザ */
+	private static String sqlUser = "OWLG";
+
+	/** 接続パスワード */
+	private static String sqlPass = "OWLG";
+
+	/** アクティブな接続 */
+	private Connection con;
+
+	/**
+	 * 接続プロパティーを設定をします。
+	 * 
+	 * @param props 接続設定を含むプロパティーオブジェクト
+	 */
+	public static void configure(Properties props)
+	{
+		sqlDriver = props.getProperty("db.driver", "");
+		sqlUrl = props.getProperty("db.url", "");
+		sqlUser = props.getProperty("db.user", "");
+		sqlPass = props.getProperty("db.password", "");
+	}
+
+	/**
+	 * データベースに接続します。
+	 * 
+	 * @return アクティブな接続
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	private static Connection getConnection() throws SQLException
+	{
+		try
+		{
+//			Connection con = ConnectionFactory.getDefaultFactory().createConnection();
+			Class.forName(sqlDriver);
+			Connection con = DriverManager.getConnection(sqlUrl, sqlUser, sqlPass);
+//		System.out.println("SimpleQuery.getConnection()=" + con + ",commit=" + con.getAutoCommit());
+			return con;
+		}
+		catch (ClassNotFoundException e)
+		{
+			// Class.forName
+			throw new SQLException("JDBC ドライバが見つかりません。");
+		}
+	}
+
+	/**
+	 * SimpleQuery オブジェクトを構築します。
+	 * 
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	public SimpleQuery() throws SQLException
+	{
+		con = getConnection();
+		con.setAutoCommit(false);
+	}
+
+	/**
+	 * PreparedStatement オブジェクトの IN パラメータ値を設定します。
+	 * 
+	 * @param st PreparedStatement オブジェクト
+	 * @param params パラメータ値
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see PreparedStatement#setObject(int, Object)
+	 */
+	private static void setParams(PreparedStatement st, Object... params) throws SQLException
+	{
+		// パラメータが未指定の場合は何もしない
+		if (params == null) return;
+
+		int index = 1;
+//		System.out.println("SimpleQuery.select()=" + sql);
+		for (Object param : params)
+		{
+//			System.out.println("SimpleQuery.setParams()=" + index + ":" + param);
+			if (param != null)
+			{
+				st.setObject(index++, param);
+			}
+			else
+			{
+				// パラメータが null の場合は VARCHAR型とみなす
+				st.setNull(index++, Types.VARCHAR);
+			}
+		}
+	}
+
+//	public void commit() throws SQLException
+//	{
+//		con.commit();
+//	}
+//
+//	public void rollback() throws SQLException
+//	{
+//		con.rollback();
+//	}
+
+	/**
+	 * SimpleQuery オブジェクトのデータベースと JDBC リソースを開放します。
+	 * 
+	 * @param st Statement オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	private void close(PreparedStatement st) throws SQLException
+	{
+		if (st != null) st.close();
+		con.close();
+	}
+
+	/**
+	 * レコードを照会します。
+	 * 
+	 * @param sql SQL SELECT 文
+	 * @param params IN パラメータ値
+	 * @return SimpleResult オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see PreparedStatement#executeQuery()
+	 */
+	public SimpleResult select(String sql, Object... params) throws SQLException
+	{
+		PreparedStatement st = null;
+		try
+		{
+			st = con.prepareStatement(sql);
+			setParams(st, params);
+			ResultSet rs = st.executeQuery();
+			return new SimpleResult(st, rs);
+		}
+		catch (RuntimeException e)
+		{
+			close(st);
+			throw e;
+		}
+		catch (SQLException e)
+		{
+			close(st);
+			throw e;
+		}
+	}
+
+	/**
+	 * レコードを更新します。
+	 * 
+	 * @param sql SQL UPDATE 文
+	 * @param params IN パラメータ値
+	 * @return UpdateCount オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see PreparedStatement#executeUpdate()
+	 */
+	public UpdateCount update(String sql, Object... params) throws SQLException
+	{
+		PreparedStatement st = null;
+		try
+		{
+			st = con.prepareStatement(sql);
+			setParams(st, params);
+			int count = st.executeUpdate();
+			return new UpdateCount(st, count);
+		}
+		catch (RuntimeException e)
+		{
+			con.rollback();
+			close(st);
+			throw e;
+		}
+		catch (SQLException e)
+		{
+			con.rollback();
+			close(st);
+			throw e;
+		}
+	}
+
+	/**
+	 * レコードを追加します。
+	 * 
+	 * @param sql SQL INSERT 文
+	 * @param params IN パラメータ値
+	 * @return UpdateCount オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see PreparedStatement#executeUpdate()
+	 */
+	public UpdateCount insert(String sql, Object... params) throws SQLException
+	{
+		return update(sql, params);
+	}
+
+	/**
+	 * レコードを削除します。
+	 * 
+	 * @param sql SQL DELETE 文
+	 * @param params IN パラメータ値
+	 * @return UpdateCount オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see PreparedStatement#executeUpdate()
+	 */
+	public UpdateCount delete(String sql, Object... params) throws SQLException
+	{
+		return update(sql, params);
+	}
+}
Index: /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/SimpleResult.java
===================================================================
--- /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/SimpleResult.java (revision 8451)
+++ /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/SimpleResult.java (revision 8451)
@@ -0,0 +1,218 @@
+/*
+ * SimpleResult.java
+ * SimpleUtil
+ * 
+ * Created by tarchan on 2008/02/14.
+ * Copyright (c) 2008 tarchan. All rights reserved.
+ */
+package com.mac.tarchan.sql;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * データベースの結果セットを表すデータのテーブルです。
+ * 
+ * @version 1.0
+ * @author tarchan
+ * @see ResultSet
+ * @see SimpleQuery
+ */
+public class SimpleResult implements Iterator<Map<String, Object>>, Iterable<Map<String, Object>>
+{
+	/** ResultSet を生成した Statement オブジェクト */
+	private Statement st;
+
+	/** ResultSet オブジェクト */
+	private ResultSet rs;
+
+	/** メタデータ */
+	private ResultSetMetaData meta;
+
+	/** 行を消費したかどうかを表すフラグ */
+	private boolean consumed;
+
+	/** 次の行があるかどうかを表すフラグ */
+	private boolean hasNext;
+
+	/**
+	 * SimpleResult オブジェクトを構築します。
+	 * 
+	 * @param statement ResultSet を生成した Statement オブジェクト
+	 * @param result ResultSet オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	public SimpleResult(Statement statement, ResultSet result) throws SQLException
+	{
+		st = statement;
+		rs = result;
+		meta = rs.getMetaData();
+		// Statement が null の場合は、ResultSet から Statement を取得する。
+		if (statement == null) st = rs.getStatement();
+//		System.out.println("SimpleResult.SimpleResult()=" + meta);
+		consume();
+	}
+
+	/**
+	 * 結果セットの行データの反復子を返します。
+	 * 
+	 * @return 結果セットの行データの反復子
+	 */
+	public Iterator<Map<String, Object>> iterator()
+	{
+		return this;
+	}
+
+	/**
+	 * 現在の行が消費されたかどうかを返します。
+	 * 
+	 * @return 消費された場合は true、そうでない場合は false
+	 */
+	private boolean isConsumed()
+	{
+		return consumed;
+	}
+
+	/**
+	 * 現在の行を消費して、次の行を読めるようにします。
+	 * 
+	 * @see #hasNext()
+	 */
+	private void consume()
+	{
+		consumed = true;
+	}
+
+	/**
+	 * 新しい行が読めるようになったことを通知します。
+	 * 
+	 * @see #hasNext()
+	 */
+	private void produce()
+	{
+		consumed = false;
+	}
+
+	/**
+	 * 次の行データがある場合に true を返します。
+	 * 
+	 * @return 次の行データがある場合に true
+	 */
+	public boolean hasNext()
+	{
+		try
+		{
+			if (isConsumed())
+			{
+				hasNext = rs.next();
+				produce();
+			}
+			return hasNext;
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 現在の行データをマップ形式で返します。
+	 * 
+	 * @return 現在の行データ。null にはならない。
+	 */
+	public Map<String, Object> next()
+	{
+		try
+		{
+			return map();
+		}
+		catch (SQLException e)
+		{
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * 何もしません。
+	 */
+	public void remove()
+	{
+		// 何もしない
+	}
+
+	/**
+	 * 現在の行データをマップ形式で返します。
+	 * 
+	 * @return 現在の行データ。null にはならない。
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	private Map<String, Object> map() throws SQLException
+	{
+		int count = meta.getColumnCount();
+//		System.out.println("SimpleResult.toMap()=" + count);
+		LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
+		for (int i = 0; i < count; i++)
+		{
+			String key = meta.getColumnName(1 + i);
+			Object value = rs.getObject(1 + i);
+//			System.out.println("SimpleResult.toMap()=" + (1 + i) + ":" + key + "=" + value + "(" + SimpleString.toClassName(value) + ")");
+//			System.out.println("SimpleResult.toMap()=" + (1 + i) + ":" + key + "=" + value);
+			map.put(key, value);
+		}
+		consume();
+
+		return map;
+	}
+
+	/**
+	 * 結果セットのデータのテーブルをリスト形式で返します。
+	 * 
+	 * @return 結果セットのデータ。null にはならない。
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	public List<Map<String, Object>> list() throws SQLException
+	{
+		try
+		{
+			ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+			for (Map<String, Object> row : this)
+			{
+				list.add(row);
+			}
+
+			return list;
+		}
+		finally
+		{
+			close();
+		}
+	}
+
+	/**
+	 * 結果セットのデータベースと JDBC リソースを開放します。
+	 * 
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	public void close() throws SQLException
+	{
+		if (st != null)
+		{
+			Connection con = st.getConnection();
+//			System.out.println("SimpleResult.close()=" + con);
+//			System.out.println("SimpleResult.close()=" + st);
+			st.close();
+			con.close();
+			st = null;
+		}
+	}
+}
Index: /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/UpdateCount.java
===================================================================
--- /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/UpdateCount.java (revision 8451)
+++ /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/sql/UpdateCount.java (revision 8451)
@@ -0,0 +1,124 @@
+/*
+ * UpdateCount.java
+ * SimpleUtil
+ * 
+ * Created by tarchan on 2008/02/18.
+ * Copyright (c) 2008 tarchan. All rights reserved.
+ */
+package com.mac.tarchan.sql;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import com.mac.tarchan.util.SimpleString;
+
+
+/**
+ * データベースを更新した結果を表すオブジェクトです。
+ * 
+ * @version 1.0
+ * @author tarchan
+ * @see SimpleQuery
+ */
+public class UpdateCount
+{
+	/** ResultSet を生成した Statement オブジェクト */
+	private Statement st;
+
+	/** 更新レコード数 */
+	private int count;
+
+	/**
+	 * UpdateCount オブジェクトを構築します。
+	 * 
+	 * @param statement Statement オブジェクト
+	 * @param updateCount 更新した行数
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	public UpdateCount(Statement statement, int updateCount) throws SQLException
+	{
+		if (statement == null) throw new NullPointerException("statement");
+
+		st = statement;
+		count = updateCount;
+	}
+
+	/**
+	 * 更新した行数を返します。
+	 * 
+	 * @return 更新した行数
+	 */
+	public int getUpdateCount()
+	{
+		return count;
+	}
+
+	/**
+	 * 現在のトランザクションで行われた変更をすべて有効とし、データベースと JDBC リソースを開放します。
+	 * 
+	 * @return UpdateCount オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see Connection#commit()
+	 */
+	public UpdateCount commit() throws SQLException
+	{
+		if (st != null)
+		{
+			Connection con = st.getConnection();
+			con.commit();
+			close();
+		}
+
+		return this;
+	}
+
+	/**
+	 * 現在のトランザクションで行われた変更をすべて元に戻し、データベースと JDBC リソースを開放します。
+	 * 
+	 * @return UpdateCount オブジェクト
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 * @see Connection#rollback()
+	 */
+	public UpdateCount rollback() throws SQLException
+	{
+		if (st != null)
+		{
+			Connection con = st.getConnection();
+			con.rollback();
+			close();
+		}
+
+		return this;
+	}
+
+	/**
+	 * 結果セットのデータベースと JDBC リソースを開放します。
+	 * 
+	 * @throws SQLException データベースアクセスエラーが発生した場合
+	 */
+	private void close() throws SQLException
+	{
+		if (st != null)
+		{
+			Connection con = st.getConnection();
+//			System.out.println("SimpleResult.close()=" + con);
+//			System.out.println("SimpleResult.close()=" + st);
+			st.close();
+			con.close();
+			st = null;
+		}
+	}
+
+	/**
+	 * UpdateCount の文字列表現を返します。
+	 * 
+	 * @return UpdateCount の文字列表現
+	 */
+	public String toString()
+	{
+		return new SimpleString(this)
+			.append("更新カウント", getUpdateCount())
+			.toString();
+	}
+}
Index: /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleString.java
===================================================================
--- /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleString.java (revision 8451)
+++ /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleString.java (revision 8451)
@@ -0,0 +1,174 @@
+/*
+ * SimpleString.java
+ * SimpleUtil
+ * 
+ * Created by tarchan on 2008/02/18.
+ * Copyright (c) 2008 tarchan. All rights reserved.
+ */
+package com.mac.tarchan.util;
+
+import java.util.Arrays;
+
+/**
+ * オブジェクトの文字列表現を構築します。
+ * 
+ * <p>例：</p>
+ * <pre>
+ * public class Sample
+ * {
+ *     public String toString()
+ *     {
+ *         return new SimpleString(this)
+ *             .append("キー1", "値1")
+ *             .append("キー2", "値2")
+ *             .toString();
+ *     }
+ * }
+ * </pre>
+ * <p>出力：</p>
+ * <pre>
+ * Sample@1234567[キー1=値1, キー2=値2]
+ * </pre>
+ * 
+ * @version 1.0
+ * @author tarchan
+ */
+public class SimpleString
+{
+	/** シーケンス名 */
+	private String name;
+
+	/** 文字列表現のシーケンス */
+	private StringBuilder str;
+
+	/**
+	 * 指定した名前のシーケンスを構築します。
+	 * 
+	 * @param name シーケンス名
+	 */
+	public SimpleString(String name)
+	{
+		this.name = name;
+	}
+
+	/**
+	 * 指定したオブジェクトの名前を持つシーケンスを構築します。
+	 * 
+	 * @param o 任意のオブジェクト
+	 */
+	public SimpleString(Object o)
+	{
+		this(toObjectName(o));
+	}
+
+	/**
+	 * シーケンスに文字列表現を追加する準備をします。
+	 * 
+	 * @return このシーケンスへの参照
+	 */
+	private SimpleString preappend()
+	{
+		if (str != null)
+		{
+			str.append(", ");
+		}
+		else
+		{
+			str = new StringBuilder();
+		}
+
+		return this;
+	}
+
+	/**
+	 * 名前と値の文字列表現をこのシーケンスに追加します。
+	 * 
+	 * @param name 名前
+	 * @param value 値
+	 * @return このシーケンスへの参照
+	 */
+	public SimpleString append(String name, Object value)
+	{
+		preappend();
+		str.append(name).append("=").append(value);
+//		if (value != null && value.getClass().isArray()) this.append(value);
+//		else str.append(value);
+		return this;
+	}
+
+	/**
+	 * 名前と配列の文字列表現をこのシーケンスに追加します。
+	 * 
+	 * @param name 名前
+	 * @param array 配列
+	 * @return このシーケンスへの参照
+	 */
+	public SimpleString append(String name, Object[] array)
+	{
+		return append(name, Arrays.toString(array));
+	}
+
+//	/**
+//	 * 配列の文字列表現をこのシーケンスに追加します。
+//	 * 
+//	 * @param values 配列
+//	 * @return このシーケンスへの参照
+//	 */
+//	public SimpleString append(Object... values)
+//	{
+//		boolean delim = false;
+//		str.append("[");
+//		for (Object v : values)
+//		{
+//			if (delim) str.append(", ");
+//			str.append(v);
+//			delim = true;
+//		}
+//		str.append("]");
+//		return this;
+//	}
+
+	/**
+	 * このシーケンスの文字列表現を返します。
+	 * 
+	 * @return このシーケンスの文字列表現
+	 */
+	public String toString()
+	{
+		return name + "[" + str + "]";
+	}
+
+	/**
+	 * 指定したオブジェクトのクラス名を返します。
+	 * クラス名は次の値と等しい文字列を返します。
+	 * <pre>
+	 * o.getClass().getName()
+	 * </pre>
+	 * 
+	 * @param o 任意のオブジェクト
+	 * @return クラス名
+	 * @see #toObjectName(Object)
+	 */
+	public static String toClassName(Object o)
+	{
+		return o != null ? o.getClass().getName() : "null";
+	}
+
+	/**
+	 * 指定したオブジェクトのオブジェクト名を返します。
+	 * オブジェクト名は次の値と等しい文字列を返します。
+	 * <pre>
+	 * o.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(o))
+	 * </pre>
+	 * 
+	 * @param o 任意のオブジェクト
+	 * @return オブジェクト名
+	 * @see #toClassName(Object)
+	 * @see Object#toString()
+	 * @see System#identityHashCode(Object)
+	 */
+	public static String toObjectName(Object o)
+	{
+		return o != null ? toClassName(o) + "@" + Integer.toHexString(System.identityHashCode(o)) : "null";
+	}
+}
Index: /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleProperties.java
===================================================================
--- /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleProperties.java (revision 8451)
+++ /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleProperties.java (revision 8451)
@@ -0,0 +1,185 @@
+/*
+ * SimpleProperties.java
+ * SimpleUtil
+ * 
+ * Created by tarchan on 2008/03/12.
+ * Copyright (c) 2008 tarchan. All rights reserved.
+ */
+package com.mac.tarchan.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.regex.Pattern;
+
+/**
+ * システムプロパティーを優先するプロパティーセットを表します。
+ * java の起動オプション <b>-D</b><i>property=value</i> でアプリケーションのプロパティーを上書きすることができます。
+ * 
+ * @version 1.0
+ * @author tarchan
+ * @see Properties
+ */
+public class SimpleProperties extends Properties
+{
+//	/** 親パス名文字列　*/
+//	protected String parent = ".";
+
+	/**
+	 * 指定したキーを持つプロパティーを、プロパティーリストから探します。
+	 * システムプロパティーに指定したキーがあった場合は、システムプロパティーを返します。
+	 */
+	@Override
+	public String getProperty(String key)
+	{
+		String def = super.getProperty(key);
+		return System.getProperty(key, def);
+	}
+
+//	/**
+//	 * プロパティーリストを読み込む親パス名を、システムプロパティーから設定します。
+//	 * 指定したシステムプロパティーが見つからない場合は、カレントディレクトリを設定します。
+//	 * 
+//	 * <p>ユーザのホームディレクトリからプロパティーを読み込む場合は、以下のようにします。</p>
+//	 * <pre>
+//	 * SimpleProperties props = new SimpleProperties().setParent("user.home").load("conf/app.properties");
+//	 * </pre>
+//	 * 
+//	 * @param key 親パス名を表すシステムプロパティーのキー
+//	 * @return SimpleProperties オブジェクト
+//	 * @see #load(String)
+//	 */
+//	public SimpleProperties setParent(String key)
+//	{
+//		parent = getProperty(key, ".");
+//
+//		return this;
+//	}
+
+	/**
+	 * ファイルからプロパティーリストを読み込みます。
+	 * 
+	 * @param name プロパティーのファイル名
+	 * @return SimpleProperties オブジェクト
+	 * @throws IOException ファイルからの読み込み中にエラーが発生した場合
+	 * @see #load(java.io.InputStream)
+	 */
+	public SimpleProperties load(String name) throws IOException
+	{
+		File file = new File(name);
+		FileInputStream in = new FileInputStream(file);
+		load(in);
+		in.close();
+
+		return this;
+	}
+
+	/**
+	 * ファイルからプロパティーリストを読み込みます。
+	 * 
+	 * @param key プロパティーファイル名を表すキー
+	 * @param def デフォルトのプロパティーのファイル名
+	 * @return SimpleProperties オブジェクト
+	 * @throws IOException
+	 */
+	public SimpleProperties load(String key, String def) throws IOException
+	{
+		String name = getProperty(key, def);
+		return load(name);
+	}
+
+	/**
+	 * 指定した文字シーケンスと正規表現がマッチするかどうかを判定します。
+	 * 
+	 * @param regex 文字シーケンスとのマッチを判定する正規表現
+	 * @param input 文字シーケンス
+	 * @return 指定した文字シーケンスと正規表現がマッチする場合は true、そうでない場合は false
+	 * @see Pattern#matches(String, CharSequence)
+	 */
+	public static boolean test(String regex, CharSequence input)
+	{
+		return Pattern.matches(regex, input);
+	}
+
+	/**
+	 * 指定した文字シーケンスと正規表現がマッチするかどうかを判定します。
+	 * マッチしなかった場合は {@link IllegalArgumentException} をスローします。
+	 * 
+	 * @param regex 文字シーケンスとのマッチを判定する正規表現
+	 * @param input 文字シーケンス
+	 * @param desc エラーの説明
+	 * @return 指定した文字シーケンスと正規表現がマッチする場合にだけ、input が返される
+	 * @throws IllegalArgumentException 指定した文字シーケンスと正規表現がマッチしなかった場合
+	 * @see #test(String, CharSequence)
+	 */
+	public static String testString(String regex, CharSequence input, String desc)
+	{
+		boolean test;
+		try
+		{
+			test = test(regex, input);
+		}
+		catch (RuntimeException e)
+		{
+			throw new IllegalArgumentException(desc, e);
+		}
+
+		if (test) return input.toString();
+		else throw new IllegalArgumentException(desc);
+	}
+
+	/**
+	 * 指定した文字シーケンスと正規表現がマッチするかどうかを判定します。
+	 * マッチしなかった場合は {@link IllegalArgumentException} をスローします。
+	 * 
+	 * @param regex 文字シーケンスとのマッチを判定する正規表現
+	 * @param input 文字シーケンス
+	 * @param desc エラーの説明
+	 * @return 指定した文字シーケンスと正規表現がマッチする場合にだけ、input が返される
+	 * @throws IllegalArgumentException 指定した文字シーケンスと正規表現がマッチしなかった場合
+	 * @see #test(String, CharSequence)
+	 */
+	public static int testInt(String regex, CharSequence input, String desc)
+	{
+		boolean test;
+		try
+		{
+			test = test(regex, input);
+		}
+		catch (RuntimeException e)
+		{
+			throw new IllegalArgumentException(desc, e);
+		}
+
+		if (test) return Integer.parseInt(input.toString());
+		else throw new IllegalArgumentException(desc);
+	}
+
+	/**
+	 * 指定した文字シーケンスと正規表現がマッチするかどうかを判定します。
+	 * マッチしなかった場合は {@link IllegalArgumentException} をスローします。
+	 * 
+	 * @param regex 文字シーケンスとのマッチを判定する正規表現
+	 * @param input 文字シーケンス
+	 * @param desc エラーの説明
+	 * @return 指定した文字シーケンスと正規表現がマッチする場合にだけ、input が返される
+	 * @throws IllegalArgumentException 指定した文字シーケンスと正規表現がマッチしなかった場合
+	 * @see #test(String, CharSequence)
+	 */
+	public static long testLong(String regex, CharSequence input, String desc)
+	{
+		boolean test;
+		try
+		{
+			test = test(regex, input);
+		}
+		catch (RuntimeException e)
+		{
+			throw new IllegalArgumentException(desc, e);
+		}
+
+		if (test) return Long.parseLong(input.toString());
+		else throw new IllegalArgumentException(desc);
+	}
+}
Index: /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleLog.java
===================================================================
--- /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleLog.java (revision 8451)
+++ /lang/java/SimpleUtil/trunk/src/com/mac/tarchan/util/SimpleLog.java (revision 8451)
@@ -0,0 +1,154 @@
+/*
+ * SimpleLog.java
+ * SimpleUtil
+ * 
+ * Created by tarchan on 2008/03/17.
+ * Copyright (c) 2008 tarchan. All rights reserved.
+ */
+package com.mac.tarchan.util;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.log4j.NDC;
+import org.apache.log4j.PropertyConfigurator;
+
+/**
+ * log4j のラッパークラスです。
+ * このクラスを使用するには log4j 1.2.12 以上のバージョンが必要です。
+ * 
+ * <p>log4j 設定ファイルの例を以下に記述します。
+ * これは、出力先を CONSOLE と LOGFILE、デフォルトのログレベルを INFO に設定し、
+ * ライブラリのログレベルを FATAL に、アプリケーションのログレベルを TRACE に設定した例です。</p>
+ * <pre>
+ * # Set root category priority to INFO and its only appender to CONSOLE.
+ * #log4j.rootCategory=INFO, CONSOLE
+ * log4j.rootCategory=INFO, CONSOLE, LOGFILE
+ * 
+ * # Set the enterprise logger priority to FATAL
+ * log4j.logger.org.apache.axis2.enterprise=FATAL
+ * log4j.logger.de.hunsicker.jalopy.io=FATAL
+ * log4j.logger.httpclient.wire.header=FATAL
+ * log4j.logger.org.apache.commons.httpclient=FATAL
+ * 
+ * # Set the application logger priority
+ * log4j.logger.com.nttbgsol.owl.executor=TRACE
+ * 
+ * # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+ * log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+ * log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+ * log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %m%n
+ * 
+ * # LOGFILE is set to be a File appender using a PatternLayout.
+ * log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
+ * log4j.appender.LOGFILE.File=log/default.log
+ * log4j.appender.LOGFILE.MaxFileSize=10MB
+ * log4j.appender.LOGFILE.MaxBackupIndex=10
+ * log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+ * log4j.appender.LOGFILE.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss},[%-5p],%C{1},%M,%m%n
+ * </pre>
+ * 
+ * @version 1.0
+ * @author tarchan
+ */
+public class SimpleLog
+{
+	/**
+	 * インスタンス化を禁止します。
+	 */
+	private SimpleLog()
+	{
+	}
+
+	/**
+	 * ログの設定を読み込みます。
+	 * 
+	 * @param properties プロパティー
+	 * @see PropertyConfigurator#configure(Properties)
+	 */
+	public static void loadProperties(Properties properties)
+	{
+		PropertyConfigurator.configure(properties);
+	}
+
+	/**
+	 * ログの設定を読み込みます。
+	 * 
+	 * @param configFilename 設定ファイル名
+	 * @see PropertyConfigurator#configure(String)
+	 */
+	public static void loadProperties(String configFilename)
+	{
+		PropertyConfigurator.configure(configFilename);
+	}
+
+	/**
+	 * ログの設定を読み込みます。
+	 * 
+	 * @param configURL 設定ファイル URL
+	 * @see PropertyConfigurator#configure(URL)
+	 */
+	public static void loadProperties(URL configURL)
+	{
+		PropertyConfigurator.configure(configURL);
+	}
+
+	/**
+	 * ログオブジェクトを返します。
+	 * 
+	 * @param clazz クラスオブジェクト
+	 * @return Logger オブジェクト
+	 * @see LogManager#getLogger(Class)
+	 */
+	public static Logger getLog(Class<?> clazz)
+	{
+		return LogManager.getLogger(clazz);
+	}
+
+	/**
+	 * ログオブジェクトを返します。
+	 * "com.nttbgsol.owl.executor.util.SimpleLog" のような完全修飾クラス名を指定することを推奨します。
+	 * 
+	 * @param name カテゴリ名
+	 * @return Logger オブジェクト
+	 * @see LogManager#getLogger(String)
+	 */
+	public static Logger getLog(String name)
+	{
+		return LogManager.getLogger(name);
+	}
+
+	/**
+	 * NDC をプッシュします。
+	 * 
+	 * @param message メッセージ
+	 * @see NDC#push(String)
+	 */
+	public static void push(String message)
+	{
+		NDC.push(message);
+	}
+
+	/**
+	 * NDC をポップします。
+	 * 
+	 * @return メッセージ
+	 * @see NDC#pop()
+	 */
+	public static String pop()
+	{
+		return NDC.pop();
+	}
+
+	/**
+	 * NDC をクリアします。
+	 * 
+	 * @see NDC#clear()
+	 */
+	public static void clear()
+	{
+		NDC.clear();
+	}
+}
Index: /lang/java/SimpleUtil/trunk/build.xml
===================================================================
--- /lang/java/SimpleUtil/trunk/build.xml (revision 8451)
+++ /lang/java/SimpleUtil/trunk/build.xml (revision 8451)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="SimpleUtil" basedir="." default="jar">
+
+	<property environment="env" />
+	<property name="project.name" value="SimpleUtil" />
+	<property name="build.src" value="src" />
+	<property name="build.bin" value="bin" />
+	<property name="build.jar" value="${project.name}.jar" />
+	<property name="java.home" value="${env.JAVA_HOME}" />
+	<property name="java.docs" value="${java.home}/docs" />
+	<property name="axis2.home" value="${env.AXIS2_HOME}" />
+	<property name="repository.path" value="${axis2.home}/repository/services" />
+
+	<path id="build.class.path">
+		<fileset dir="${axis2.home}/lib">
+			<include name="*.jar" />
+		</fileset>
+	</path>
+
+	<target name="jar" depends="compile">
+		<jar basedir="${build.bin}" destfile="${build.jar}">
+		</jar>
+	</target>
+
+	<target name="compile">
+		<mkdir dir="${build.bin}" />
+		<javac srcdir="${build.src}" destdir="${build.bin}" encoding="UTF-8">
+			<classpath refid="build.class.path" />
+		</javac>
+	</target>
+
+	<target name="javadoc">
+		<javadoc packagenames="com.mac.tarchan.*" windowtitle="${project.name}"
+    		classpath="${axis2.home}/lib/log4j-1.2.14.jar:${axis2.home}/lib/axiom-api-1.2.5.jar:${axis2.home}/lib/axis2-kernel-1.3.jar"
+    		sourcepath="src" encoding="UTF-8"
+    		destdir="doc" docencoding="UTF-8">
+			<bottom><![CDATA[<i>Copyright &#169; 2008 tarchan. All rights reserved.</i>]]></bottom>
+			<link href="http://java.sun.com/javase/ja/6/docs/ja/api/" />
+			<link href="http://logging.apache.org/log4j/1.2/apidocs/" />
+		</javadoc>
+	</target>
+
+	<target name="clean">
+		<delete dir="${build.bin}" />
+		<delete file="${build.jar}" />
+	</target>
+
+</project>
