openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r549508 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
Date Thu, 21 Jun 2007 15:17:25 GMT
Author: mprudhom
Date: Thu Jun 21 08:17:24 2007
New Revision: 549508

URL: http://svn.apache.org/viewvc?view=rev&rev=549508
Log:
Changed the parsing of the driver name to not use the JDK 1.5-specific method String.contains()
and String.split().

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java?view=diff&rev=549508&r1=549507&r2=549508
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
Thu Jun 21 08:17:24 2007
@@ -79,9 +79,16 @@
                     driverVendor = VENDOR_OTHER;
             } else
                 driverVendor = VENDOR_OTHER;
-            if (driverName.contains(platform) && Integer.parseInt(driverName
-                .split("Server ",0)[1].split(" ")[0]) >= 2005)
-                supportsXMLColumn = true;
+            if (driverName.indexOf(platform) != -1) {
+                String versionString = driverName.
+                    substring(platform.length() + 1);
+                if (versionString.indexOf(" ") != -1)
+                    versionString = versionString.substring(0,
+                        versionString.indexOf(" "));
+                int version = Integer.parseInt(versionString);
+                if (version >= 2005)
+                    supportsXMLColumn = true;
+            }
         }
 
         // warn about using cursors



Mime
View raw message