You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2012/05/25 08:10:24 UTC

svn commit: r1342503 - /tomcat/trunk/webapps/docs/config/context.xml

Author: kkolinko
Date: Fri May 25 06:10:23 2012
New Revision: 1342503

URL: http://svn.apache.org/viewvc?rev=1342503&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53289
Clarify ResourceLink example that uses getConnection(username, password)

Modified:
    tomcat/trunk/webapps/docs/config/context.xml

Modified: tomcat/trunk/webapps/docs/config/context.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?rev=1342503&r1=1342502&r2=1342503&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/trunk/webapps/docs/config/context.xml Fri May 25 06:10:23 2012
@@ -1196,16 +1196,26 @@
       </attribute>
 
     </attributes>
-    <p>Shared Data Source Example</p>
+    <p>Shared Data Source Example:</p>
+    <p><strong>Warning:</strong> This feature works only if the global DataSource
+supports <code>getConnection(username, password)</code> method.
+<a href="http://commons.apache.org/dbcp/">Apache Commons DBCP</a> pool that
+Tomcat uses by default does not support it. See its Javadoc for
+<code>BasicDataSource</code> class.
+<a href="../jdbc-pool.html">Apache Tomcat JDBC pool</a> does support it,
+but by default this support is disabled and can be enabled by
+<code>alternateUsernameAllowed</code> attribute. See its documentation
+for details.</p>
 <source>
 &lt;GlobalNamingResources&gt;
   ...
   &lt;Resource name=&quot;sharedDataSource&quot;
             global=&quot;sharedDataSource&quot;
             type=&quot;javax.sql.DataSource&quot;
+            factory=&quot;org.apache.tomcat.jdbc.pool.DataSourceFactory&quot;
+            alternateUsernameAllowed=&quot;true&quot;
             username=&quot;bar&quot;
             password=&quot;barpass&quot;
-
             ...
   ...
 &lt;/GlobalNamingResources&gt;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org