Allow the type to be the exact name of the data source
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 25 Mar 2009 17:46:13 +0000 (17:46 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 25 Mar 2009 17:46:13 +0000 (17:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@758363 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java

index 9287850..edbbe7c 100644 (file)
@@ -172,9 +172,20 @@ public class DataSourceFactory implements ObjectFactory {
             return null;
         }
         Reference ref = (Reference) obj;
-        if (!"javax.sql.DataSource".equals(ref.getClassName())) {
+        
+        boolean ok = false;
+        if ("javax.sql.DataSource".equals(ref.getClassName())) {
+            ok = true;
+        }
+        if (org.apache.tomcat.jdbc.pool.DataSource.class.getName().equals(ref.getClassName())) {
+            ok = true;
+        }
+        
+        if (!ok) {
+            log.warn(ref.getClassName()+" is not a valid class name/type for this JNDI factory.");
             return null;
         }
+        
 
         Properties properties = new Properties();
         for (int i = 0; i < ALL_PROPERTIES.length; i++) {