パッケージ org.apache.commons.dbcp.cpdsadapter

このパッケージは古い Driver ベースの JDBC の実装に適用するための ConnectionPoolDataSource (CPDS) を実装した1つの public クラスを持ちます。

参照:
          説明

クラスの概要
DriverAdapterCPDS ConnectionPoolDataSource の実装は持っていないが DriverManager の実装は持っているJDBCドライバのためのアダプタです。
 

パッケージ org.apache.commons.dbcp.cpdsadapter の説明

このパッケージは古い Driver ベースの JDBC の実装に適用するための ConnectionPoolDataSource (CPDS) を実装した1つの public クラスを持ちます。 catalina サーブレットコンテナ(Tomcat3.3以降)の JNDI 経由で CPDS を利用するための例を以下に示します。

This package contains one public class which is a ConnectionPoolDataSource (CPDS) implementation that can be used to adapt older Driver based jdbc implementations. Below is an example of setting up the CPDS to be available via JNDI in the catalina servlet container.

server.xml 内の <Context> の配下に以下の記述を追加してください:

In server.xml, the following would be added to the <Context> for your webapp:


 <Resource name="jdbc/bookstoreCPDS" auth="Container"
            type="org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS"/>
  <ResourceParams name="jdbc/bookstoreCPDS">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS</value>
    </parameter>
        <parameter><name>user</name><value>root</value></parameter>
        <parameter><name>password</name><value></value></parameter>
        <parameter>
            <name>driver</name>
            <value>org.gjt.mm.mysql.Driver</value></parameter>
        <parameter>
             <name>url</name>
             <value>jdbc:mysql://localhost:3306/bookstore</value>
        </parameter>

  </ResourceParams>

web.xml に以下の記述を追加してください。 これらの要素の順番はサーブレット定義のDTD宣言に従わなくてはいけないことに注意してください:

In web.xml. Note that elements must be given in the order of the dtd described in the servlet specification:

<resource-ref>
  <description>
    Resource reference to a factory for java.sql.Connection
    instances that may be used for talking to a particular
    database that is configured in the server.xml file.
  </description>
  <res-ref-name>
    jdbc/bookstoreCPDS
  </res-ref-name>
  <res-type>
    org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
  </res-type>
  <res-auth>
    Container
  </res-auth>
</resource-ref>

Catalina は java:comp/env ネームスペース内にも同様に設定された全てのオブジェクトをデプロイします。

Catalina deploys all objects configured similarly to above within the java:comp/env namespace.

翻訳者:
日置 聡
翻訳状況:
初稿(校正者募集中)
翻訳更新日:
2003/08/31


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