svn - r34240 - trunk/modules/plugin/jdbc/jdbc-db2/src/main/java/org/geotools/data/db2

1 message Options
Embed this post
Permalink
svn_geotools

svn - r34240 - trunk/modules/plugin/jdbc/jdbc-db2/src/main/java/org/geotools/data/db2

Reply Threaded More More options
Print post
Permalink
Author: jdeolive
Date: 2009-10-26 00:15:35 -0400 (Mon, 26 Oct 2009)
New Revision: 34240

Modified:
   trunk/modules/plugin/jdbc/jdbc-db2/src/main/java/org/geotools/data/db2/DB2NGDataStoreFactory.java
Log:
GEOT-2598, having db2-ng pick up old db2 dbtype when old datastore not around

Modified: trunk/modules/plugin/jdbc/jdbc-db2/src/main/java/org/geotools/data/db2/DB2NGDataStoreFactory.java
===================================================================
--- trunk/modules/plugin/jdbc/jdbc-db2/src/main/java/org/geotools/data/db2/DB2NGDataStoreFactory.java 2009-10-25 10:58:11 UTC (rev 34239)
+++ trunk/modules/plugin/jdbc/jdbc-db2/src/main/java/org/geotools/data/db2/DB2NGDataStoreFactory.java 2009-10-26 04:15:35 UTC (rev 34240)
@@ -68,6 +68,29 @@
     }
     
     @Override
+    protected boolean checkDBType(Map params) {
+        if (super.checkDBType(params)) {
+            return true;
+        }
+        
+        //check also for "DB2" which is iold db type, but only when the old
+        // factory is not on the classpath
+        if (checkDBType(params, "DB2")) {
+            try {
+                Class.forName("org.geotools.data.db2.DB2DataStoreFactory");
+                
+                //old factory is around, let it handle the connection
+                return false;
+            }
+            catch (ClassNotFoundException e) {
+                return true;
+            }
+        }
+        
+        return false;
+    }
+    
+    @Override
     protected String getJDBCUrl(Map params) throws IOException {
         // jdbc url
      String host=null;


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits