Skip to content

Commit

Permalink
MONDRIAN: Oops. (And it still only builds under JDK 1.4.)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 182]
  • Loading branch information
julianhyde committed Oct 4, 2002
1 parent 738ef8b commit cd0a485
Show file tree
Hide file tree
Showing 5 changed files with 1,136 additions and 26 deletions.
30 changes: 30 additions & 0 deletions src/main/mondrian/olap/Schema.java
@@ -0,0 +1,30 @@
/*
// $Id$
// This software is subject to the terms of the Common Public License
// Agreement, available at the following URL:
// http://www.opensource.org/licenses/cpl.html.
// (C) Copyright 2002 Kana Software, Inc. and others.
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
// jhyde, 2 October, 2002
*/
package mondrian.olap;

/**
* A <code>Schema</code> lists cubes and shared dimensions.
*/
public interface Schema {
/**
* Find a cube called <code>cube</code> in the current catalog; if no cube
* exists, <code>failIfNotFound</code> controls whether to raise an error
* or return null.
**/
Cube lookupCube(String cube,boolean failIfNotFound);

/**
* Find the names of all cubes in a given database.
**/
String[] listCubeNames();

}
26 changes: 0 additions & 26 deletions src/main/mondrian/rolap/agg/TestAggregationManager.java
Expand Up @@ -182,30 +182,4 @@ private CellRequest createRequest(final String cube, final String measure, final

}


class FakeConnection extends DelegatingConnection {
FakeConnection(java.sql.Connection connection, String expectedSql) {
super(connection);
}

public Statement createStatement() throws SQLException {
return new DelegatingStatement(super.createStatement(), this);
}
}



class AccessDatabaseMetaData extends DelegatingDatabaseMetaData {
public AccessDatabaseMetaData(DatabaseMetaData meta) {
super(meta);
}

public String getIdentifierQuoteString() throws SQLException {
return "`";
}
public String getDatabaseProductName() throws SQLException {
return "ACCESS";
}
}

// End TestAggregationManager.java
195 changes: 195 additions & 0 deletions src/main/mondrian/rolap/sql/DelegatingConnection.java
@@ -0,0 +1,195 @@
/*
// $Id$
// This software is subject to the terms of the Common Public License
// Agreement, available at the following URL:
// http://www.opensource.org/licenses/cpl.html.
// (C) Copyright 2002 Kana Software, Inc. and others.
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
// jhyde, Oct 3, 2002
*/

package mondrian.rolap.sql;

import java.sql.*;
import java.util.Map;

/**
* <code>DelegatingConnection</code> implements {@link java.sql.Connection} (up
* to JDK 1.4) by delegating to an underlying connection.
*
* @author jhyde
* @since Oct 3, 2002
* @version $Id$
**/
public class DelegatingConnection implements Connection {
protected Connection connection;

public DelegatingConnection(Connection connection) {
this.connection = connection;
}
public Connection getUnderlyingConnection() {
return connection;
}

// Below this point, implementations of Connection methods
public void clearWarnings() throws SQLException {
connection.clearWarnings();
}

public void close() throws SQLException {
connection.close();
}

public void commit() throws SQLException {
connection.commit();
}

public Statement createStatement() throws SQLException {
return connection.createStatement();
}

public Statement createStatement(int resultSetType, int resultSetConcurrency)
throws SQLException {
return connection.createStatement(resultSetType, resultSetConcurrency);
}

public Statement createStatement(int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
return connection.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
}

public boolean getAutoCommit() throws SQLException {
return connection.getAutoCommit();
}

public String getCatalog() throws SQLException {
return connection.getCatalog();
}

public int getHoldability() throws SQLException {
return connection.getHoldability();
}

public DatabaseMetaData getMetaData() throws SQLException {
return connection.getMetaData();
}

public int getTransactionIsolation() throws SQLException {
return connection.getTransactionIsolation();
}

public Map getTypeMap() throws SQLException {
return connection.getTypeMap();
}

public SQLWarning getWarnings() throws SQLException {
return connection.getWarnings();
}

public boolean isClosed() throws SQLException {
return connection.isClosed();
}

public boolean isReadOnly() throws SQLException {
return connection.isReadOnly();
}

public String nativeSQL(String sql) throws SQLException {
return connection.nativeSQL(sql);
}

public CallableStatement prepareCall(String sql) throws SQLException {
return connection.prepareCall(sql);
}

public CallableStatement prepareCall(String sql, int resultSetType,
int resultSetConcurrency) throws SQLException {
return connection.prepareCall(sql, resultSetType, resultSetConcurrency);
}

public CallableStatement prepareCall(String sql, int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
return connection.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
}

public PreparedStatement prepareStatement(String sql)
throws SQLException {
return connection.prepareStatement(sql);
}

public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
throws SQLException {
return connection.prepareStatement(sql, autoGeneratedKeys);
}

public PreparedStatement prepareStatement(String sql, int columnIndexes[])
throws SQLException {
return connection.prepareStatement(sql, columnIndexes);
}

public PreparedStatement prepareStatement(String sql, String columnNames[])
throws SQLException {
return connection.prepareStatement(sql, columnNames);
}

public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency)
throws SQLException {
return connection.prepareStatement(sql, resultSetType, resultSetConcurrency);
}

public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
return connection.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
}

public void releaseSavepoint(Savepoint savepoint) throws SQLException {
connection.releaseSavepoint(savepoint);
}

public void rollback() throws SQLException {
connection.rollback();
}

public void rollback(Savepoint savepoint) throws SQLException {
connection.rollback(savepoint);
}

public void setAutoCommit(boolean autoCommit) throws SQLException {
connection.setAutoCommit(autoCommit);
}

public void setCatalog(String catalog) throws SQLException {
connection.setCatalog(catalog);
}

public void setHoldability(int holdability) throws SQLException {
connection.setHoldability(holdability);
}

public void setReadOnly(boolean readOnly) throws SQLException {
connection.setReadOnly(readOnly);
}

public Savepoint setSavepoint() throws SQLException {
return connection.setSavepoint();
}

public Savepoint setSavepoint(String name) throws SQLException {
return connection.setSavepoint(name);
}

public void setTransactionIsolation(int level) throws SQLException {
connection.setTransactionIsolation(level);
}

public void setTypeMap(Map map) throws SQLException {
connection.setTypeMap(map);
}
}

// End DelegatingConnection.java

0 comments on commit cd0a485

Please sign in to comment.