You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/04/16 18:38:04 UTC

svn commit: r1587967 - in /tomee/site/trunk/content: configuring-datasources-in-tests.mdtext configuring-datasources.mdtext

Author: andygumbrecht
Date: Wed Apr 16 16:38:04 2014
New Revision: 1587967

URL: http://svn.apache.org/r1587967
Log:
Docs

Modified:
    tomee/site/trunk/content/configuring-datasources-in-tests.mdtext
    tomee/site/trunk/content/configuring-datasources.mdtext

Modified: tomee/site/trunk/content/configuring-datasources-in-tests.mdtext
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/configuring-datasources-in-tests.mdtext?rev=1587967&r1=1587966&r2=1587967&view=diff
==============================================================================
--- tomee/site/trunk/content/configuring-datasources-in-tests.mdtext (original)
+++ tomee/site/trunk/content/configuring-datasources-in-tests.mdtext Wed Apr 16 16:38:04 2014
@@ -16,9 +16,22 @@ need for an `openejb.xml` entirely) like
     
     Context context = new InitialContext(p);
 
+Under certain circumstances it may be necessary to load two versions of the same driver.
+This is possible by definition of a classpath for the resource which points to the
+specific driver files required for the DataSource:
+
+    p.put("myDataSourceOne", "new://Resource?type=DataSource&classpath=/path/to/driverVersionOne.jar");
+    p.put("myDataSourceOne.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+    p.put("myDataSource.JdbcUrl", "jdbc:derby:myDatabaseOne;create=true");
+    ....
+    p.put("myDataSourceTwo", "new://Resource?type=DataSource&classpath=/path/to/driverVersionTwo.jar");
+    p.put("myDataSourceTwo.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+    p.put("myDataSource.JdbcUrl", "jdbc:derby:myDatabaseTwo;create=true");
+
+This will allow an application to communicate through legacy drivers to the same JDBC provider.
 
 See [Embedded Configuration](embedded-configuration.html)
- for details on properties and overrides.
+ for further details on properties and overrides.
 
 See [Containers and Resources](containers-and-resources.html)
  for a full list of supported Resource types and their properties.

Modified: tomee/site/trunk/content/configuring-datasources.mdtext
URL: http://svn.apache.org/viewvc/tomee/site/trunk/content/configuring-datasources.mdtext?rev=1587967&r1=1587966&r2=1587967&view=diff
==============================================================================
--- tomee/site/trunk/content/configuring-datasources.mdtext (original)
+++ tomee/site/trunk/content/configuring-datasources.mdtext Wed Apr 16 16:38:04 2014
@@ -31,15 +31,16 @@ can abbreviated to just _DataSource_ as 
 
 
 See [Containers and Resources](containers-and-resources.html)
- for a complete list of supported DataSource properties.  See [DataSource Password
-Encryption](datasource-password-encryption.html)
- for information on specifying non-plain-text database passwords in your
-openejb.xml file.  See [Common DataSource Configurations](common-datasource-configurations.html)
+ for a complete list of supported DataSource properties.
+
+See [DataSource Password Encryption](datasource-password-encryption.html)
+ for information on specifying non-plain-text database passwords in your openejb.xml file.
+
+See [Common DataSource Configurations](common-datasource-configurations.html)
  for a list of the commonly used databases and their driver configurations.
 
 You may also need data partitioning per customer or depending on any other
-business criteria. That's also an available feature. See [Dynamic Datasource](dynamic-datasource.html)
- for more details.
+business criteria. That's also an available feature. See [Dynamic Datasource](dynamic-datasource.html) for more details.
 
 <a name="ConfiguringDataSources-JNDInamesforconfiguredDataSources"></a>
 ## JNDI names for configured DataSources