cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2002-08-16 Thread amyroh

amyroh  2002/08/16 13:18:38

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  Update the doc following the current DBCP implementation - username instead
  of user.
  
  Revision  ChangesPath
  1.14  +4 -4  jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jndi-resources-howto.xml  16 Mar 2002 20:32:31 -  1.13
  +++ jndi-resources-howto.xml  16 Aug 2002 20:18:38 -  1.14
  @@ -113,9 +113,9 @@
   codeoverride/code attribute to true)./p
   
   pGlobal resources can be defined in the server-wide JNDI context, by adding
  -the resource elements described above to the 
  -a href=config/globalresources.htmllt;GlobalNamingResourcesgt;/a 
  -child element of the a href=config/server.htmllt;Servergt;/a 
  +the resource elements described above to the
  +a href=config/globalresources.htmllt;GlobalNamingResourcesgt;/a
  +child element of the a href=config/server.htmllt;Servergt;/a
   element./p
   
   /section
  @@ -503,7 +503,7 @@
   type=javax.sql.DataSource/gt;
 lt;ResourceParams name=jdbc/EmployeeDBgt;
   lt;parametergt;
  -  lt;namegt;userlt;/namegt;
  +  lt;namegt;usernamelt;/namegt;
 lt;valuegt;dbusernamelt;/valuegt;
   lt;/parametergt;
   lt;parametergt;
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2002-03-12 Thread craigmcc

craigmcc02/03/12 20:13:34

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  Update JNDI documentation to reflect the switch from Tyrex to DBCP for default
  connection pool support.
  
  Revision  ChangesPath
  1.12  +5 -28 jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jndi-resources-howto.xml  18 Dec 2001 18:17:44 -  1.11
  +++ jndi-resources-howto.xml  13 Mar 2002 04:13:34 -  1.12
  @@ -420,9 +420,11 @@
   /ul
   
   pstrongNOTE/strong - The default data source support in Tomcat
  -supports Tyrex.  However, it is possible to use any other connection pool
  -that implements codejavax.sql.DataSource/code, by writing your own
  -custom resource factory, as described
  +is based on the strongDBCP/strong connection pool from the
  +a href=http://jakarta.apache.org/commons;Jakarta Commons/a
  +subproject.  However, it is possible to use any other connection pool
  +that implements codejavax.sql.DataSource/code, by writing your
  +own custom resource factory, as described
   a href=#Adding Custom Resource Factoriesbelow/a./p
   
   h31.  Install Your JDBC Driver/h3
  @@ -528,31 +530,6 @@
   JDBC driver.  Customize the codedriverClassName/code and
   codedriverName/code parameters to match your actual database's
   JDBC driver and connection URL./p
  -
  -  /subsection
  -
  -  subsection name=User Transactions
  -
  -pIf you utilize Tyrex for your JDBC resource factory as described
  -a href=#JDBC Data Sourcesabove/a, you will also have support for
  -the codejava.transaction.UserTransaction/code resource provided by
  -Tyrex (since it is XA-capable).  To use this feature, code your
  -application as follows:/p
  -source
  -Context initCtx = new InitialContext();
  -Context envCtx = (Context) initCtx.lookup(java:comp/env);
  -Transaction tx = (Transaction) envCtx.lookup(UserTransaction);
  -
  -tx.begin();
  -... perform transactional operations on data ...
  -tx.commit();
  -/source
  -
  -pThis is useful when you need to do two-phased commits across more
  -than one database, where the commit needs to either succeed completely
  -or fail completely across all associated databases.  This feature
  -requires a JDBC driver that also supports XA capabilities.  See the
  -J2EE and JDBC documentation for more information./p
   
 /subsection
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-12-18 Thread remm

remm01/12/18 10:17:44

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  - Fix typos in example.
Submitted by Janek Bogucki janekdb at yahoo.co.uk
  
  Revision  ChangesPath
  1.11  +3 -3  jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jndi-resources-howto.xml  2001/11/30 07:00:36 1.10
  +++ jndi-resources-howto.xml  2001/12/18 18:17:44 1.11
  @@ -201,16 +201,16 @@
   
   source
   lt;resource-env-refgt;
  -  lt;Descriptiongt;
  +  lt;descriptiongt;
   Object factory for MyBean instances.
  -  lt;/Descriptiongt;
  +  lt;/descriptiongt;
 lt;resource-env-ref-namegt;
   bean/MyBeanFactory
 lt;/resource-env-ref-namegt;
 lt;resource-env-ref-typegt;
   com.mycompany.MyBean
 lt;/resource-env-ref-typegt;
  -lt;resource-env-refgt;
  +lt;/resource-env-refgt;
   /source
   
   pstrongWARNING/strong - Be sure you respect the element ordering
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-11-29 Thread remm

remm01/11/29 23:00:37

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  - Add some documentation on the possibility to define server-global JNDI
resources, in addition to the per-webapp JNDI resources.
  
  Revision  ChangesPath
  1.10  +8 -0  jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jndi-resources-howto.xml  2001/11/14 17:53:30 1.9
  +++ jndi-resources-howto.xml  2001/11/30 07:00:36 1.10
  @@ -93,6 +93,8 @@
   Configure the Java class name of the resource factory implementation to be
   used, as well as JavaBeans properties used to configure that resource
   factory./li
  +lia href=config/context.html#Resource Linkslt;ResourceLinkgt;/a -
  +Add a link to a resource defined in the global JNDI context./li
   /ul
   
   pAny number of these elements may be nested inside a
  @@ -109,6 +111,12 @@
   strongonly/strong if allowed by the corresponding
   codelt;Environmentgt;/code element (by setting the
   codeoverride/code attribute to true)./p
  +
  +pGlobal resources can be defined in the server-wide JNDI context, by adding
  +the resource elements described above to the 
  +a href=config/globalresources.htmllt;GlobalNamingResourcesgt;/a 
  +child element of the a href=config/server.htmllt;Servergt;/a 
  +element./p
   
   /section
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-11-14 Thread remm

remm01/11/14 09:53:30

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  - Fix 4512.
  
  Revision  ChangesPath
  1.9   +1 -3  jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jndi-resources-howto.xml  2001/11/12 21:03:49 1.8
  +++ jndi-resources-howto.xml  2001/11/14 17:53:30 1.9
  @@ -514,9 +514,7 @@
   /source
   
   pNote that the resource name (here, codejdbc/EmployeeDB/code) must
  -match the value specified in the web application deployment descriptor.
  -Customize the value of the codemail.smtp.host/code parameter to
  -point at the server that provides SMTP service for your network./p
  +match the value specified in the web application deployment descriptor./p
   
   pThis example assumes that you are using the HypersonicSQL database
   JDBC driver.  Customize the codedriverClassName/code and
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-09-16 Thread craigmcc

craigmcc01/09/16 20:49:16

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  Simplify the JNDI Resources HOW-TO instructions for JDBC data sources, now
  that Tomcat 4 includes a much larger number of JAR files as part of the
  standard binary distribution.
  
  Revision  ChangesPath
  1.6   +11 -33jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jndi-resources-howto.xml  2001/09/13 00:01:48 1.5
  +++ jndi-resources-howto.xml  2001/09/17 03:49:16 1.6
  @@ -411,47 +411,25 @@
   all J2EE platforms must provide to applications)./li
   /ul
   
  -h31.  Download And Install Required Packages/h3
  -
  -pUse of the data source JNDI resource involves downloading and installing
  -several packages that are not included with Tomcat.
  -Follow these steps:/p
  -ul
  -liDownload the JDBC Optional Package (version 2.0) from
  -a 
href=http://java.sun.com/products/jdbc/download.html;http://java.sun.com/products/jdbc/download.html/a./li

  -liInstall the codejdbc2_0-stdext.jar/code file from this package
  -into the code$CATALINA_HOME/common/lib/code directory, so that it
  -is available to both Catalina internal classes and to web applications.
  -/li
  -liDownload the Java Transaction API (JTA) package (version 1.0.1) from
  -a 
href=http://java.sun.com/products/jta/;http://java.sun.com/products/jta//a./li
  -liInstall the codejta-spec1_0_1.jar/code file from this package
  -into the code$CATALINA_HOME/common/lib/code directory, so that it
  -is available to both Catalina internal classes and to web applications.
  -/li
  -liDownload the Tyrex Data Source Package (version 0.9.7) from
  -a href=http://tyrex.exolab.org;http://tyrex.exolab.org/a./li
  -liInstall the codetyrex-0.9.7.0.jar/code file from this release
  -into the code$CATALINA_HOME/common/lib/code directory, so that it
  -is available to both Catalina internal classes and to web applications.
  -/li
  -liTyrex requires that you provide a JDBC driver to actually connect
  -to the underlying database.  Place the JAR file for your database
  -driver into the code$CATALINA_HOME/common/lib/code directory,
  -so that it is available to both Catalina internal classes and to
  -web applications./li
  -/ul
  -
   pstrongNOTE/strong - The default data source support in Tomcat
   supports Tyrex.  However, it is possible to use any other connection pool
   that implements codejavax.sql.DataSource/code, by writing your own
   custom resource factory, as described
   a href=#Adding Custom Resource Factoriesbelow/a./p
   
  +h31.  Install Your JDBC Driver/h3
  +
  +pUse of the emJDBC Data Sources/em JNDI Resource Factory requires
  +that you make an appropriate JDBC driver available to both Tomcat internal
  +classes and to your web application.  This is most easily accomplished by
  +installing the driver's JAR file(s) into the
  +code$CATALINA_HOME/common/lib/code directory, which makes the driver
  +available both to the resource factory and to your application./p
  +
   h32.  Declare Your Resource Requirements/h3
   
  -pNExt, modify the web application deployment
  -descriptor (code/WEB-INF/web.xml/code) to declare the JNDI name under
  +pNext, modify the web application deployment descriptor
  +(code/WEB-INF/web.xml/code) to declare the JNDI name under
   which you will look up preconfigured data source.  By convention, all such
   names should resolve to the codejdbc/code subcontext (relative to the
   standard codejava:comp/env/code naming context that is the root of
  
  
  



cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-09-12 Thread craigmcc

craigmcc01/09/12 16:19:29

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  Add a description of the Generic JavaBean JNDI resource factory.  This
  can be used when you want to return new instances of preconfigured beans
  when a lookup() operation is performed, where the bean's properties can
  be customized by suitable entries in conf/web.xml.
  
  Revision  ChangesPath
  1.4   +135 -0jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jndi-resources-howto.xml  2001/09/09 23:31:53 1.3
  +++ jndi-resources-howto.xml  2001/09/12 23:19:29 1.4
  @@ -127,6 +127,141 @@
 configure, and use your own custom resource factory classes with
 Tomcat 4./p
   
  +  pemNOTE/em - Of the standard resource factories, only the
  +  JDBC Data Source and User Transaction factories are mandated to
  +  be available on other platforms, and then they are required only if
  +  the platform implements the Java2 Enterprise Edition (J2EE) specs.
  +  All other standard resource factories, plus custom resource factories
  +  that you write yourself, are specific to Tomcat and cannot be assumed
  +  to be available on other containers./p
  +
  +  subsection name=Generic JavaBean Resources
  +
  +h30.  Introduction/h3
  +
  +pThis resource factory can be used to create objects of emany/em
  +Java class that conforms to standard JavaBeans naming conventions (i.e.
  +it has a zero-arguments constructor, and has property setters that
  +conform to the setFoo() naming pattern.  The resource factory will
  +create a new instance of the appropriate bean class every time a
  +codelookup()/code for this entry is made./p
  +
  +pThe steps required to use this facility are described below./p
  +
  +h31.  Create Your JavaBean Class/h3
  +
  +pCreate the JavaBean class which will be instantiated each time
  +that the resource factory is looked up.  For this example, assume
  +you create a class codecom.mycompany.MyBean/code, which looks
  +like this:/p
  +
  +source
  +package com.mycompany;
  +
  +public class MyBean {
  +
  +  private String foo = Default Foo;
  +
  +  public String getFoo() {
  +return (this.foo);
  +  }
  +
  +  public void setFoo(String foo) {
  +this.foo = foo;
  +  }
  +
  +  private int bar = 0;
  +
  +  public int getBar() {
  +return (this.bar);
  +  }
  +
  +  public void setBar(int bar) {
  +this.bar = bar;
  +  }
  +
  +
  +}
  +/source
  +
  +  h32.  Declare Your Resource Requirements/h3
  +
  +  pNext, modify your web application deployment descriptor
  +  (code/WEB-INF/web.xml/code) to declare the JNDI name under which
  +  you will request new instances of this bean.  The simplest approach is
  +  to use a codelt;resource-env-refgt;/code element, like this:/p
  +
  +source
  +lt;resource-env-refgt;
  +  lt;Descriptiongt;
  +Object factory for MyBean instances.
  +  lt;/Descriptiongt;
  +  lt;resource-env-ref-namegt;
  +bean/MyBeanFactory
  +  lt;/resource-env-ref-namegt;
  +  lt;resource-env-ref-typegt;
  +com.mycompany.MyBean
  +  lt;/resource-env-ref-typegt;
  +lt;resource-env-refgt;
  +/source
  +
  +pstrongWARNING/strong - Be sure you respect the element ordering
  +that is required by the DTD for web application deployment descriptors!
  +See the
  +a href=http://java.sun.com/products/servlet/download.html;Servlet
  +Specification/a for details./p
  +
  +  h33.  Code Your Application's Use Of This Resource/h3
  +
  +  pA typical use of this resource environment reference might look
  +  like this:/p
  +
  +source
  +Context initCtx = new InitialContext();
  +Context envCtx = (Context) initCtx.lookup(java:comp/env);
  +MyBean bean = (MyBean) envCtx.lookup(bean/MyBeanFactory);
  +
  +writer.println(foo =  + bean.getFoo() + , bar =  +
  +   bean.getBar());
  +/source
  +
  +h34.  Configure Tomcat's Resource Factory/h3
  +
  +pTo configure Tomcat's resource factory, add an elements like this to the
  +code$CATALINA_HOME/conf/server.xml/code file, nested inside the
  +codeContext/code element for this web application (or nested inside
  +a codeDefaultContext/code element for the surrounding
  +codelt;Hostgt;/code or codelt;Enginegt;/code element./p
  +source
  +lt;Context ...gt;
  +  ...
  +  lt;Resource name=bean/MyBeanFactory auth=Container
  +type=com.mycompany.MyBean/gt;
  +  lt;ResourceParams name=bean/MyBeanFactorygt;
  +lt;parametergt;
  +  lt;namegt;factorylt;/namegt;
  +  

cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-09-12 Thread craigmcc

craigmcc01/09/12 17:01:48

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  Document the procedure for creating your own JNDI resource factories.
  
  Revision  ChangesPath
  1.5   +189 -1jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jndi-resources-howto.xml  2001/09/12 23:19:29 1.4
  +++ jndi-resources-howto.xml  2001/09/13 00:01:48 1.5
  @@ -577,7 +577,195 @@
   
   section name=Adding Custom Resource Factories
   
  -  pstrongFIXME/strong/p
  +  pIf none of the standard resource factories meet your needs, you can
  +  write your own factory and integrate it into Tomcat 4, and then configure
  +  the use of this factory in the codeconf/server.xml/code configuration
  +  file.  In the example below, we will create a factory that only knows how
  +  to create codecom.mycompany.MyBean/code beans, from the
  +  a href=Generic JavaBean ResourcesGeneric JavaBean Resources/a
  +  example, above./p
  +
  +  h31.  Write A Resource Factory Class/h3
  +
  +  pYou must write a class that implements the JNDI service provider
  +  codejavax.naming.spi.ObjectFactory/code inteface.  Every time your
  +  web application calls codelookup()/code on a context entry that is
  +  bound to this factory, the codegetObjectInstance()/code method is
  +  called, with the following arguments:/p
  +  ul
  +  listrongObject obj/strong - The (possibly null) object containing
  +  location or reference information that can be used in creating an
  +  object.  For Tomcat, this will always be an object of type
  +  codejavax.naming.Reference/code, which contains the class name
  +  of this factory class, as well as the configuration properties
  +  (from codeconf/server.xml/code) to use in creating objects
  +  to be returned./li
  +  listrongName name/strong - The name to which this factory is bound
  +  relative to codenameCtx/code, or codenull/code if no name
  +  is specified./li
  +  listrongContext nameCtx/strong - The context relative to which the
  +  codename/code parameter is specified, or codenull/code if
  +  codename/code is relative to the default initial context./li
  +  listrongHashtable environment/strong - The (possibly null)
  +  environment that is used in creating this object.  This is generally
  +  ignored in Tomcat object factories./li
  +  /ul
  +
  +  pTo create a resource factory that knows how to produce codeMyBean/code
  +  instances, you might create a class like this:/p
  +
  +source
  +package com.mycompany;
  +
  +import java.util.Enumeration;
  +import java.util.Hashtable;
  +import javax.naming.Context;
  +import javax.naming.Name;
  +import javax.naming.NamingException;
  +import javax.naming.RefAddr;
  +import javax.naming.Reference;
  +import javax.naming.spi.ObjectFactory;
  +
  +public class MyBeanFactory implements ObjectFactory {
  +
  +  public Object getObjectInstance(Object obj,
  +  Name name, Context nameCtx, Hashtable environment)
  +  throws NamingException {
  +
  +  // Acquire an instance of our specified bean class
  +  MyBean bean = new MyBean();
  +
  +  // Customize the bean properties from our attributes
  +  Reference ref = (Reference) obj;
  +  Enumeration addrs = ref.getAll();
  +  while (addrs.hasMoreElements()) {
  +  RefAddr addr = (RefAddr) addrs.nextElement();
  +  String name = addr.getType();
  +  String value = (String) addr.getContent();
  +  if (name.equals(foo)) {
  +  bean.setFoo(value);
  +  } else if (name.equals(bar)) {
  +  try {
  +  bean.setBar(Integer.parseInt(value));
  +  } catch (NumberFormatException e) {
  +  throw new NamingException(Invalid 'bar' value  + value);
  +  }
  +  }
  +  }
  +
  +  // Return the customized instance
  +  return (bean);
  +
  +  }
  +
  +}
  +/source
  +
  +  pIn this example, we are unconditionally creating a new instance of
  +  the codecom.mycompany.MyBean/code class, and populating its properties
  +  based on the parameters included in the codelt;ResourceParamsgt;/code
  +  element that configures this factory (see below).  You should note that any
  +  parameter named codefactory/code should be skipped - that parameter is
  +  used to specify the name of the factory class itself (in this case,
  +  codecom.mycompany.MyBeanFactory/code) rather than a property of the
  +  bean being configured./p
  +
  +  pFor more information about codeObjectFactory/code, see the
  +  a 

cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-09-09 Thread craigmcc

craigmcc01/09/09 16:31:53

  Modified:webapps/tomcat-docs jndi-resources-howto.xml
  Log:
  Update to include documentation on configuring JDBC data sources available
  as JNDI resources (finally :-).
  
  Revision  ChangesPath
  1.3   +184 -0jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml
  
  Index: jndi-resources-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jndi-resources-howto.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jndi-resources-howto.xml  2001/09/09 04:00:09 1.2
  +++ jndi-resources-howto.xml  2001/09/09 23:31:53 1.3
  @@ -250,15 +250,199 @@
 /subsection
   
 subsection name=JDBC Data Sources
  +
  +h30.  Introduction/h3
  +
  +pMany web applications need to access a database via a JDBC driver,
  +to support the functionality required by that application.  The J2EE
  +Platform Specification requires J2EE Application Servers to make
  +available a emDataSource/em implementation (that is, a connection
  +pool for JDBC connections) for this purpose.  Tomcat 4 offers exactly
  +the same support, so that database-based applications you develop on
  +Tomcat using this service will run unchanged on any J2EE server./p
  +
  +pFor information about JDBC, you should consult the following:/p
  +ul
  +lia 
href=http://java.sun.com/products/jdbc/;http://java.sun.com/products/jdbc//a -
  +Home page for information about Java Database Connectivity./li
  +lia 
href=http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame.html;http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame.html/a
 -
  +The JDBC 2.1 API Specification./li
  +lia 
href=http://java.sun.com/products/jdbc/jdbc20.stdext.pdf;http://java.sun.com/products/jdbc/jdbc20.stdext.pdf/a
 -
  +The JDBC 2.0 Standard Extension API (including the
  +codejavax.sql.DataSource/code API).  This package is now known
  +as the JDBC Optional Package./li
  +lia 
href=http://java.sun.com/j2ee/download.html;http://java.sun.com/j2ee/download.html/a
 -
  +The J2EE Platform Specification (covers the JDBC facilities that
  +all J2EE platforms must provide to applications)./li
  +/ul
  +
  +h31.  Download And Install Required Packages/h3
  +
  +pUse of the data source JNDI resource involves downloading and installing
  +several packages that are not included with Tomcat.
  +Follow these steps:/p
  +ul
  +liDownload the JDBC Optional Package (version 2.0) from
  +a 
href=http://java.sun.com/products/jdbc/download.html;http://java.sun.com/products/jdbc/download.html/a./li

  +liInstall the codejdbc2_0-stdext.jar/code file from this package
  +into the code$CATALINA_HOME/common/lib/code directory, so that it
  +is available to both Catalina internal classes and to web applications.
  +/li
  +liDownload the Java Transaction API (JTA) package (version 1.0.1) from
  +a 
href=http://java.sun.com/products/jta/;http://java.sun.com/products/jta//a./li
  +liInstall the codejta-spec1_0_1.jar/code file from this package
  +into the code$CATALINA_HOME/common/lib/code directory, so that it
  +is available to both Catalina internal classes and to web applications.
  +/li
  +liDownload the Tyrex Data Source Package (version 0.9.7) from
  +a href=http://tyrex.exolab.org;http://tyrex.exolab.org/a./li
  +liInstall the codetyrex-0.9.7.0.jar/code file from this release
  +into the code$CATALINA_HOME/common/lib/code directory, so that it
  +is available to both Catalina internal classes and to web applications.
  +/li
  +liTyrex requires that you provide a JDBC driver to actually connect
  +to the underlying database.  Place the JAR file for your database
  +driver into the code$CATALINA_HOME/common/lib/code directory,
  +so that it is available to both Catalina internal classes and to
  +web applications./li
  +/ul
  +
  +pstrongNOTE/strong - The default data source support in Tomcat
  +supports Tyrex.  However, it is possible to use any other connection pool
  +that implements codejavax.sql.DataSource/code, by writing your own
  +custom resource factory, as described
  +a href=#Adding Custom Resource Factoriesbelow/a./p
  +
  +h32.  Declare Your Resource Requirements/h3
  +
  +pNExt, modify the web application deployment
  +descriptor (code/WEB-INF/web.xml/code) to declare the JNDI name under
  +which you will look up preconfigured data source.  By convention, all such
  +names should resolve to the codejdbc/code subcontext (relative to the
  +standard codejava:comp/env/code naming 

cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml

2001-09-08 Thread craigmcc

craigmcc01/09/08 21:00:09

  Modified:.BUILDING.txt build.properties.sample
   catalina build.xml
   catalina/src/conf server.xml
   webapps/examples build.xml
   webapps/examples/WEB-INF web.xml
   webapps/examples/jsp index.html
   webapps/tomcat-docs jndi-resources-howto.xml
  Added:   webapps/examples/WEB-INF/classes SendMailServlet.java
   webapps/examples/jsp/mail sendmail.html sendmail.jsp
sendmail.txt
  Log:
  Update the JNDI Resources documentation to describe the resource factory
  for javax.mail.Session objects.  Add an example page and servlet to
  illustrate the use of this feature, and update the build process
  accordingly.
  
  WARNING:  The build process now requires that the Java Activation
  Framework and JavaMail package distributions be available, and
  activation.jar and mail.jar are now included automatically in the
  Tomcat binary build (in directory $CATALINA_HOME/common/lib).
  
  Revision  ChangesPath
  1.2   +33 -9 jakarta-tomcat-4.0/BUILDING.txt
  
  Index: BUILDING.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/BUILDING.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BUILDING.txt  2001/07/27 22:26:03 1.1
  +++ BUILDING.txt  2001/09/09 04:00:07 1.2
  @@ -1,4 +1,4 @@
  -$Id: BUILDING.txt,v 1.1 2001/07/27 22:26:03 craigmcc Exp $
  +$Id: BUILDING.txt,v 1.2 2001/09/09 04:00:07 craigmcc Exp $
   
   
  Building The Tomcat 4.0 Servlet/JSP Container
  @@ -208,8 +208,27 @@
 it resides in its own subdirectory.
   
   
  -(10) Download and Install the JSSE 1.0.2 Reference Implementation
  +(10) Download and Install the Java Activation Framework 1.0.1
   
  +* Download the Java Activation Framework package (version 1.0.1 or later) from
  +
  +http://java.sun.com/products/javabeans/glasgow/jaf.html
  +
  +* Unpack the package into a convenient location so that it
  +  resised in its own subdirectory.
  +
  +(11) Download and Install JavaMail 1.2
  +
  +* Download the JavaMail package (version 1.2 or later) from
  +
  +http://java.sun.com/products/javamail/index.html
  +
  +* Unpack the package into a convenient location so that
  +  it resides in its own subdirectory.
  +
  +
  +(12) Download and Install the JSSE 1.0.2 Reference Implementation
  +
   * Download the Java Secure Sockets Extension (JSSE) package,
 (version 1.0.2 or later) from
   
  @@ -219,7 +238,7 @@
 it resides in its own subdirectory.
   
   
  -(11) Download and Install the Java Transaction APIs (OPTIONAL)
  +(13) Download and Install the Java Transaction APIs (OPTIONAL)
   
   NOTE:  This step is only required if you wish to build the Tyrex connection
   pool implementation for JNDI-accessed data sources.
  @@ -232,7 +251,7 @@
 own subdirectory.
   
   
  -(12) Download and Install the JUnit Testing Package (OPTIONAL)
  +(14) Download and Install the JUnit Testing Package (OPTIONAL)
   
   NOTE:  This step is only required if you wish to build and execute the unit
   tests that are part of the Tomcat 4.0 source base.
  @@ -245,7 +264,7 @@
 own subdirectory.
   
   
  -(13) Download and Install the Tyrex Data Source Package (OPTIONAL)
  +(15) Download and Install the Tyrex Data Source Package (OPTIONAL)
   
   NOTE:  This step is only required if you wish to build the Tyrex connection
   pool implementation for JNDI-accessed data sources.
  @@ -258,7 +277,7 @@
 own subdirectory.
   
   
  -(13) Customize Build Properties For This Subproject
  +(16) Customize Build Properties For This Subproject
   
   Most Jakarta subprojects allow you to customize Ant properties (with default
   values defined in the build.xml file.  This is done by creating a text file
  @@ -274,6 +293,9 @@
 Property Name Description
   
   
  +  activation.home   Pathname to directory containing the Java Activation
  +Framework package, version 1.0.1 or later
  +
 jmx.home  Pathname to directory containing the Java Management
   Extensions (JMX) Reference Implementation, version 1.0
   or later
  @@ -289,21 +311,23 @@
 junit.jar Pathname to the junit.jar file from JUnit, version 3.7
   or later
   
  +  mail.home Pathname to the directory containing the JavaMail package,
  +version 1.2 or later
  +
 regexp.home   Pathname to directory containing a binary distribution of
   the Jakarta Regexp Project, version 1.2
   
 servletapi.home   Pathname to directory containing a binary distribution of
   the Servlet 2.3/JSP 1.2 API classes
   
  -FIXME:  Properties for mail.jar,