You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2010/10/07 22:46:39 UTC

svn commit: r1005627 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java

Author: doogie
Date: Thu Oct  7 20:46:39 2010
New Revision: 1005627

URL: http://svn.apache.org/viewvc?rev=1005627&view=rev
Log:
fix getSchemaName, to change the case of the defined schema, based on
the database metadata settings.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java?rev=1005627&r1=1005626&r2=1005627&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java Thu Oct  7 20:46:39 2010
@@ -3034,7 +3034,13 @@ public class DatabaseUtil {
     public String getSchemaName(DatabaseMetaData dbData) throws SQLException {
         if (!isLegacy && this.datasourceInfo.useSchemas && dbData.supportsSchemasInTableDefinitions()) {
             if (UtilValidate.isNotEmpty(this.datasourceInfo.schemaName)) {
-                return this.datasourceInfo.schemaName;
+                if (dbData.storesLowerCaseIdentifiers()) {
+                    return this.datasourceInfo.schemaName.toLowerCase();
+                } else if (dbData.storesUpperCaseIdentifiers()) {
+                    return this.datasourceInfo.schemaName.toUpperCase();
+                } else {
+                    return this.datasourceInfo.schemaName;
+                }
             } else {
                 return dbData.getUserName();
             }