<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/sinsengumi_2/">
    <title>sinsengumi_2 のプログラム覚え書き</title>
    <link>http://w.atwiki.jp/sinsengumi_2/</link>
    <atom:link href="https://w.atwiki.jp/sinsengumi_2/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>sinsengumi_2 のプログラム覚え書き</description>

    <dc:language>ja</dc:language>
    <dc:date>2009-01-20T01:03:02+09:00</dc:date>
    <utime>1232380982</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/sinsengumi_2/pages/12.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/sinsengumi_2/pages/1.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/sinsengumi_2/pages/14.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/sinsengumi_2/pages/13.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/sinsengumi_2/pages/3.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/sinsengumi_2/pages/12.html">
    <title>iBatis</title>
    <link>https://w.atwiki.jp/sinsengumi_2/pages/12.html</link>
    <description>
      *導入
**0. 準備
***ibatisのインストール
インストールといってもjarファイルをクラスパスに追加するだけです。
http://ibatis.apache.org/からダウンロード。

あと今回はDBにPostgreSQLを使用するので、PostgreSQLのJDBCドライバもクラスパスに追加しておく。
http://jdbc.postgresql.org/からダウンロード。

***DBの準備
DBはPostgreSQLを利用します。
サンプルとして以下のようなテーブルを作成（DB名はsampledbとしています）
|&amp;bold(){id}|&amp;bold(){name}|&amp;bold(){age}|
|1|Yoshida|23|
|2|Abe|34|
|3|Ogawa|17|
 CREATE TABLE users
 (
   id serial NOT NULL,
   name character varying(100),
   age integer,
   CONSTRAINT id PRIMARY KEY (id)
 )
※ちなみにnameというのはPostgreSQLでは予約語らしいです。。。

**1. sqlMapConfigを作成
iBATIS用configファイルを記述する。
DB接続設定やMapファイルの参照を書いていきます。
ファイル名は「&amp;bold(){SqlMapConfig.xml}」としてます。

 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
 &lt;!DOCTYPE sqlMapConfig PUBLIC &quot;-//iBATIS.com//DTD SQL Map Config 2.0//EN&quot;
 	&quot;http://www.ibatis.com/dtd/sql-map-config-2.dtd&quot;&gt;
 
 &lt;sqlMapConfig&gt;
 	&lt;!-- DB接続設定 --&gt;
 	&lt;transactionManager type=&quot;JDBC&quot;&gt;
 		&lt;dataSource type=&quot;SIMPLE&quot;&gt;
 			&lt;property name=&quot;JDBC.Driver&quot; value=&quot;org.postgresql.Driver&quot;/&gt;
 			&lt;property name=&quot;JDBC.ConnectionURL&quot; value=&quot;jdbc:postgresql://localhost:5432/sampledb&quot;/&gt;
 			&lt;property name=&quot;JDBC.Username&quot; value=&quot;postgres&quot;/&gt;
 			&lt;property name=&quot;JDBC.Password&quot; value=&quot;postgres&quot;/&gt;
 		&lt;/dataSource&gt;
 	&lt;/transactionManager&gt;
 
 	&lt;!-- sqlMapファイルの参照 --&gt;
 	&lt;sqlMap resource=&quot;ibatis/dao/user.SqlMap.xml&quot; /&gt;
 &lt;/sqlMapConfig&gt;    </description>
    <dc:date>2009-01-20T01:03:02+09:00</dc:date>
    <utime>1232380982</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/sinsengumi_2/pages/1.html">
    <title>トップページ</title>
    <link>https://w.atwiki.jp/sinsengumi_2/pages/1.html</link>
    <description>
      プログラムに関して、会社や家で勉強したことを忘れないように備忘録として書き連ねています。    </description>
    <dc:date>2009-01-20T00:42:40+09:00</dc:date>
    <utime>1232379760</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/sinsengumi_2/pages/14.html">
    <title>PostgreSQL JDBC Driver</title>
    <link>https://w.atwiki.jp/sinsengumi_2/pages/14.html</link>
    <description>
      使用するJDKのバージョンによって、使えるドライバが違うので注意する。
違うドライバを使うと実行エラーが起きる。
|&amp;b(){JDKのバージョン}|&amp;b(){対応ドライバ}|
|JDK 1.4, 1.5|JDBC 3|
|JDK 1.6|JDBC4|
詳細は以下で確認。
http://jdbc.postgresql.org/download.html    </description>
    <dc:date>2009-01-19T20:43:27+09:00</dc:date>
    <utime>1232365407</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/sinsengumi_2/pages/13.html">
    <title>メニュー</title>
    <link>https://w.atwiki.jp/sinsengumi_2/pages/13.html</link>
    <description>
      *Java
-[[iBatis&gt;iBatis]]
-[[PostgreSQL JDBC Driver&gt;PostgreSQL JDBC Driver]]    </description>
    <dc:date>2009-01-19T20:33:35+09:00</dc:date>
    <utime>1232364815</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/sinsengumi_2/pages/3.html">
    <title>右メニュー</title>
    <link>https://w.atwiki.jp/sinsengumi_2/pages/3.html</link>
    <description>
      **更新履歴
#recent(20)


&amp;link_editmenu2(text=ここを編集)
    </description>
    <dc:date>2009-01-18T21:37:59+09:00</dc:date>
    <utime>1232282279</utime>
  </item>
  </rdf:RDF>
