Skip to content

Commit

Permalink
MONDRIAN: Changes for Cloudscape/Derby
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 3454]
  • Loading branch information
Sherman Wood committed Apr 12, 2005
1 parent 7cdf656 commit 3f5cc4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/mondrian/olap/Mondrian.xml
Expand Up @@ -710,6 +710,7 @@ Revision is $Id$
<Value>hsqldb</Value>
<Value>mssql</Value>
<Value>sybase</Value>
<Value>cloudscape</Value>
</Attribute>
<CData/>
</Element>
Expand Down
16 changes: 15 additions & 1 deletion src/main/mondrian/rolap/sql/SqlQuery.java
Expand Up @@ -318,6 +318,14 @@ public boolean isAccess() {
return getProduct().equals("ACCESS");
}

public boolean isDerby() {
return getProduct().trim().toUpperCase().equals("APACHE DERBY");
}

public boolean isCloudscape() {
return getProduct().trim().toUpperCase().equals("DBMS:CLOUDSCAPE");
}

public boolean isDB2() {
// DB2 on NT returns "DB2/NT"
return getProduct().startsWith("DB2");
Expand Down Expand Up @@ -364,6 +372,8 @@ private String getBestName() {
best = "postgres";
} else if (isSybase()) {
best = "sybase";
} else if (isCloudscape() || isDerby()) {
best = "cloudscape";
} else {
best = "generic";
}
Expand Down Expand Up @@ -652,7 +662,11 @@ public void addHaving(final String expression)

public void addOrderBy(final String expression)
{
orderBy.add(expression);
if (isDerby() || isCloudscape()) {
orderBy.add(quoteIdentifier("c" + (select.size() - 1)));
} else {
orderBy.add(expression);
}
}

public String toString()
Expand Down

0 comments on commit 3f5cc4d

Please sign in to comment.