cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r526552 - in /cayenne/main/branches/STABLE-1.2/cayenne: cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/sybase/SybaseSniffer.java cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
Date Sun, 08 Apr 2007 13:33:39 GMT
Author: aadamchik
Date: Sun Apr  8 06:33:38 2007
New Revision: 526552

URL: http://svn.apache.org/viewvc?view=rev&rev=526552
Log:
CAY-775 AutoAdapter fails to detect Sybase when running with jTDS driver

Modified:
    cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/sybase/SybaseSniffer.java
    cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt

Modified: cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/sybase/SybaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/sybase/SybaseSniffer.java?view=diff&rev=526552&r1=526551&r2=526552
==============================================================================
--- cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/sybase/SybaseSniffer.java
(original)
+++ cayenne/main/branches/STABLE-1.2/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/sybase/SybaseSniffer.java
Sun Apr  8 06:33:38 2007
@@ -69,10 +69,20 @@
  */
 public class SybaseSniffer implements DbAdapterFactory {
 
-    public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
-        String dbName = md.getDatabaseProductName();
-        return dbName != null && dbName.toUpperCase().indexOf("ADAPTIVE SERVER")
>= 0
-                ? new SybaseAdapter()
-                : null;
+    public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {    	
+    	// JTDS driver returns "sql server" for Sybase, so need to handle it differently
+    	String driver = md.getDriverName();
+    	if(driver != null && driver.toLowerCase().startsWith("jtds")) {
+    		String url = md.getURL();
+    		return url != null && url.toLowerCase().startsWith("jdbc:jtds:sybase:")
+    		        ? new SybaseAdapter()
+                    : null;
+    	}
+    	else {
+            String dbName = md.getDatabaseProductName();
+            return dbName != null && dbName.toUpperCase().indexOf("ADAPTIVE SERVER")
>= 0
+                    ? new SybaseAdapter()
+                    : null;
+    	}
     }
 }

Modified: cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt?view=diff&rev=526552&r1=526551&r2=526552
==============================================================================
--- cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
(original)
+++ cayenne/main/branches/STABLE-1.2/cayenne/cayenne-other/release-notes/RELEASE-NOTES-1.2.3.txt
Sun Apr  8 06:33:38 2007
@@ -18,3 +18,4 @@
 CAY-754 Local jNDI hack breaks when running with Jetty6-Maven
 CAY-764 Exception when importing an EOModel with single table inheritance
 CAY-765 Programmatically overriding "use share cache" fails
+CAY-775 AutoAdapter fails to detect Sybase when running with jTDS driver



Mime
View raw message