commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1567746 - in /commons/proper/dbcp/trunk/src: changes/changes.xml site/xdoc/guide/jndi-howto.xml
Date Wed, 12 Feb 2014 20:04:38 GMT
Author: markt
Date: Wed Feb 12 20:04:37 2014
New Revision: 1567746

URL: http://svn.apache.org/r1567746
Log:
Fix DBCP-309
Improve example for JNDI with BasicDataSource

Modified:
    commons/proper/dbcp/trunk/src/changes/changes.xml
    commons/proper/dbcp/trunk/src/site/xdoc/guide/jndi-howto.xml

Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1567746&r1=1567745&r2=1567746&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Wed Feb 12 20:04:37 2014
@@ -196,6 +196,9 @@ The <action> type attribute can be add,u
         Using batchUpdate() should not invalidate the PreparedStatement when it
         is returned to the pool.
       </action>
+      <action dev="markt" issue="DBCP-309" type="fix">
+        Improve documentation for JNDI example using BasicDataSource. 
+      </action>
     </release>
     <release version="1.4.1" date="TBD" description="TBD">
       <action dev="psteitz" issue="DBCP-334" type="update" due-to="Alberto Mozzone">

Modified: commons/proper/dbcp/trunk/src/site/xdoc/guide/jndi-howto.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/site/xdoc/guide/jndi-howto.xml?rev=1567746&r1=1567745&r2=1567746&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/site/xdoc/guide/jndi-howto.xml (original)
+++ commons/proper/dbcp/trunk/src/site/xdoc/guide/jndi-howto.xml Wed Feb 12 20:04:37 2014
@@ -52,14 +52,14 @@
   System.setProperty(Context.PROVIDER_URL, "file:///tmp");
   InitialContext ic = new InitialContext();
 
-  // Construct BasicDataSource reference
-  Reference ref = new Reference("javax.sql.DataSource",
-    "org.apache.commons.dbcp2.BasicDataSourceFactory", null);
-  ref.add(new StringRefAddr("driverClassName", "org.apache.commons.dbcp2.TesterDriver"));
-  ref.add(new StringRefAddr("url", "jdbc:apache:commons:testdriver"));
-  ref.add(new StringRefAddr("username", "username"));
-  ref.add(new StringRefAddr("password", "password"));
-  ic.rebind("jdbc/basic", ref);
+  // Construct BasicDataSource
+  BasicDataSource bds = new BasicDataSource();
+  bds.setDriverClassName("org.apache.commons.dbcp2.TesterDriver");
+  bds.setUrl("jdbc:apache:commons:testdriver");
+  bds.setUsername("username");
+  bds.setPassword("password");
+
+  ic.rebind("jdbc/basic", bds);
    
   // Use
   InitialContext ic2 = new InitialContext();



Mime
View raw message