From 6c3ebf7b0d5a9f3be0bda69eb9c0451b8b2732cd Mon Sep 17 00:00:00 2001 From: fhanik Date: Wed, 25 Mar 2009 17:46:13 +0000 Subject: [PATCH] Allow the type to be the exact name of the data source git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@758363 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java b/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java index 928785089..edbbe7c2f 100644 --- a/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java +++ b/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java @@ -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++) { -- 2.11.0