トップ 一覧 ping 検索 ヘルプ RSS ログイン

GERONIMO データソースの作成の変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!GERONIMO データソースの作成
{{include_html banner_html, "!Geronimo"}}
[GERONIMO]

ver 1.1.1
[[Tomcatの場合|Tomcat 5.5 JNDI Datasource の利用]]

::まず、GERONIMO のリポジトリに、JDBCドライバを登録する必要がある。メニューからCommon Libsを選択
{{ref_image dbpl_04.jpg}}
::GERONIMO/repository ディレクトリ以下の構成にならって、各項目を設定し、Install
{{ref_image dbpl_05.jpg}}
::Database poolの作成
{{ref_image dbpl_01.jpg}}
::Database pool wizerd を起動
{{ref_image dbpl_02.jpg}}
::[[Oracle Express Edition|Fedora Core 6 Oracle Express Edition のインストール]]のDatabase poolを作成
{{ref_image dbpl_03.jpg}}
::さっき登録したJDBC情報を選択し、ユーザ、パスワード等必要な情報を設定
{{ref_image dbpl_06.jpg}}
{{ref_image dbpl_07.jpg}}
::Deployする
{{ref_image dbpl_08.jpg}}
::新しいDatabase poolが作成された
{{ref_image dbpl_09.jpg}}
::右のほうのusageを選択すると、使用法が書いてある。
{{ref_image dbpl_10.jpg}}

WEB-INF/web.xmlに以下を追記
  <resource-ref>
    <res-ref-name>jdbc/fugitive</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>

WEB-INF/geronimo-web.xml を作成し、以下を記述
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app
    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
    <environment>
        <moduleId>
            <artifactId>fugitive</artifactId>
        </moduleId>
        <dependencies>
            <dependency>
                <groupId>console.dbpool</groupId>
                <artifactId>Fugitive</artifactId>
            </dependency>
        </dependencies>
    </environment>
    <context-root>/fugitive</context-root>
 
    <!-- security settings, if any, go here -->
 
    <resource-ref>
        <ref-name>jdbc/fugitive</ref-name>
        <pattern>
          <groupId>console.dbpool</groupId>
          <artifactId>Fugitive</artifactId>
          <name>Fugitive</name>
        </pattern>
    </resource-ref>
 </web-app>

::アプリケーションから利用
    InitialContext ctx = new InitialContext();
    DataSource ds = ctx.lookup("java:comp/env/jdbc/fugitive");

{{include_html banner_html, "!Geronimo"}}