// Path: src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
// enum BackendFlavor {
//     MONDRIAN("Mondrian"),
//     SSAS("Microsoft"),
//     PALO("Palo"),
//     SAP("SAP"),
//     ESSBASE("Essbase"),
//     UNKNOWN("");
// 
//     private final String token;
// 
//     private BackendFlavor(String token) {
//         this.token = token;
//     }
// 
//     static BackendFlavor getFlavor(OlapConnection conn, boolean fail)
//         throws OlapException
//     {
//         return getFlavor(
//             conn.getOlapDatabase().getDataSourceInfo(),
//             conn.getOlapDatabase().getProviderName(),
//             fail);
//     }
// 
//     static BackendFlavor getFlavor(
//         String dataSourceInfo, String providerName, boolean fail)
//     {
//         for (BackendFlavor flavor : BackendFlavor.values()) {
//             if (providerName.toUpperCase()
//                     .contains(flavor.token.toUpperCase())
//                 || dataSourceInfo.toUpperCase()
//                     .contains(flavor.token.toUpperCase()))
//             {
//                 return flavor;
//             }
//         }
//         if (fail) {
//             throw new AssertionError("Can't determine the backend vendor.");
//         } else {
//             return UNKNOWN;
//         }
//     }
// }


import org.olap4j.*;
import org.olap4j.driver.xmla.XmlaOlap4jConnection.BackendFlavor;
import org.olap4j.mdx.*;
import java.io.StringWriter;
import java.sql.*;
import java.util.concurrent.*;
    public void setPoolable(boolean poolable) throws SQLException {
        throw new UnsupportedOperationException();
    }

    public boolean isPoolable() throws SQLException {
        throw new UnsupportedOperationException();
    }

    // implement Wrapper

    public <T> T unwrap(Class<T> iface) throws SQLException {
        if (iface.isInstance(this)) {
            return iface.cast(this);
        }
        throw getHelper().createException(
            "does not implement '" + iface + "'");
    }

    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        return iface.isInstance(this);
    }

    // implement OlapStatement

    public CellSet executeOlapQuery(String mdx) throws OlapException {
        final String catalog = olap4jConnection.getCatalog();
        final String roleName = olap4jConnection.getRoleName();
        final String propList = olap4jConnection.makeConnectionPropertyList();

        final String dataSourceInfo;
// Path: src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
// enum BackendFlavor {
//     MONDRIAN("Mondrian"),
//     SSAS("Microsoft"),
//     PALO("Palo"),
//     SAP("SAP"),
//     ESSBASE("Essbase"),
//     UNKNOWN("");
// 
//     private final String token;
// 
//     private BackendFlavor(String token) {
//         this.token = token;
//     }
// 
//     static BackendFlavor getFlavor(OlapConnection conn, boolean fail)
//         throws OlapException
//     {
//         return getFlavor(
//             conn.getOlapDatabase().getDataSourceInfo(),
//             conn.getOlapDatabase().getProviderName(),
//             fail);
//     }
// 
//     static BackendFlavor getFlavor(
//         String dataSourceInfo, String providerName, boolean fail)
//     {
//         for (BackendFlavor flavor : BackendFlavor.values()) {
//             if (providerName.toUpperCase()
//                     .contains(flavor.token.toUpperCase())
//                 || dataSourceInfo.toUpperCase()
//                     .contains(flavor.token.toUpperCase()))
//             {
//                 return flavor;
//             }
//         }
//         if (fail) {
//             throw new AssertionError("Can't determine the backend vendor.");
//         } else {
//             return UNKNOWN;
//         }
//     }
// }


// Path: src/org/olap4j/driver/xmla/XmlaOlap4jStatement.java
import org.olap4j.*;
import org.olap4j.driver.xmla.XmlaOlap4jConnection.BackendFlavor;
import org.olap4j.mdx.*;
import java.io.StringWriter;
import java.sql.*;
import java.util.concurrent.*;

    public void setPoolable(boolean poolable) throws SQLException {
        throw new UnsupportedOperationException();
    }

    public boolean isPoolable() throws SQLException {
        throw new UnsupportedOperationException();
    }

    // implement Wrapper

    public <T> T unwrap(Class<T> iface) throws SQLException {
        if (iface.isInstance(this)) {
            return iface.cast(this);
        }
        throw getHelper().createException(
            "does not implement '" + iface + "'");
    }

    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        return iface.isInstance(this);
    }

    // implement OlapStatement

    public CellSet executeOlapQuery(String mdx) throws OlapException {
        final String catalog = olap4jConnection.getCatalog();
        final String roleName = olap4jConnection.getRoleName();
        final String propList = olap4jConnection.makeConnectionPropertyList();

        final String dataSourceInfo;
        switch (BackendFlavor.getFlavor(olap4jConnection, true)) {