「GERONIMO データソースの作成」の版間の差分
ナビゲーションに移動
検索に移動
(ページの作成:「==GERONIMO データソースの作成== {{include_html banner_html, "!Geronimo"}} [GERONIMO] ver 1.1.1 [Tomcat 5.5 JNDI Datasource の利用] [Tomcatの場合]…」) |
|||
| 1行目: | 1行目: | ||
==GERONIMO データソースの作成== | ==GERONIMO データソースの作成== | ||
{{include_html banner_html, "!Geronimo"}} | {{include_html banner_html, "!Geronimo"}} | ||
| − | [GERONIMO] | + | [[GERONIMO]] |
ver 1.1.1 | ver 1.1.1 | ||
| − | [Tomcat 5.5 JNDI Datasource の利用] [Tomcatの場合] | + | [[Tomcat 5.5 JNDI Datasource の利用] [Tomcatの場合]] |
=====まず、GERONIMO のリポジトリに、JDBCドライバを登録する必要がある。メニューからCommon Libsを選択===== | =====まず、GERONIMO のリポジトリに、JDBCドライバを登録する必要がある。メニューからCommon Libsを選択===== | ||
| 27行目: | 27行目: | ||
WEB-INF/web.xmlに以下を追記 | 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 を作成し、以下を記述 | 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" | + | 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> | |
=====アプリケーションから利用===== | =====アプリケーションから利用===== | ||
2020年2月15日 (土) 08:02時点における版
目次
- 1 GERONIMO データソースの作成
- 1.1 まず、GERONIMO のリポジトリに、JDBCドライバを登録する必要がある。メニューからCommon Libsを選択
- 1.2 GERONIMO/repository ディレクトリ以下の構成にならって、各項目を設定し、Install
- 1.3 Database poolの作成
- 1.4 Database pool wizerd を起動
- 1.5 [Fedora Core 6 Oracle Express Edition のインストール] [Oracle Express Edition]のDatabase poolを作成
- 1.6 さっき登録したJDBC情報を選択し、ユーザ、パスワード等必要な情報を設定
- 1.7 Deployする
- 1.8 新しいDatabase poolが作成された
- 1.9 右のほうのusageを選択すると、使用法が書いてある。
- 1.10 アプリケーションから利用
GERONIMO データソースの作成
テンプレート:Include html banner html, "!Geronimo" GERONIMO
ver 1.1.1 [[Tomcat 5.5 JNDI Datasource の利用] [Tomcatの場合]]
まず、GERONIMO のリポジトリに、JDBCドライバを登録する必要がある。メニューからCommon Libsを選択
GERONIMO/repository ディレクトリ以下の構成にならって、各項目を設定し、Install
Database poolの作成
Database pool wizerd を起動
[Fedora Core 6 Oracle Express Edition のインストール] [Oracle Express Edition]のDatabase poolを作成
さっき登録したJDBC情報を選択し、ユーザ、パスワード等必要な情報を設定
Deployする
新しいDatabase poolが作成された
右のほうのusageを選択すると、使用法が書いてある。
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");
© 2006 矢木浩人









