Skip to content

Commit

Permalink
Enable build on JDK 1.7 (JDBC 4.1).
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@478 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Nov 7, 2011
1 parent 624a2a8 commit ae37510
Show file tree
Hide file tree
Showing 3 changed files with 1,196 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/org/olap4j/driver/xmla/FactoryJdbc3Impl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2007-2010 Julian Hyde
// Copyright (C) 2007-2011 Julian Hyde
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
Expand Down Expand Up @@ -59,27 +59,42 @@ public ResultSet newFixedResultSet(
public XmlaOlap4jCellSet newCellSet(
XmlaOlap4jStatement olap4jStatement) throws OlapException
{
return new FactoryJdbc3Impl.XmlaOlap4jCellSetJdbc3(
olap4jStatement);
return new XmlaOlap4jCellSetJdbc3(olap4jStatement);
}

public XmlaOlap4jStatement newStatement(
XmlaOlap4jConnection olap4jConnection)
{
return new XmlaOlap4jStatementJdbc3(olap4jConnection);
}

public XmlaOlap4jPreparedStatement newPreparedStatement(
String mdx,
XmlaOlap4jConnection olap4jConnection) throws OlapException
{
return new FactoryJdbc3Impl.XmlaOlap4jPreparedStatementJdbc3(
return new XmlaOlap4jPreparedStatementJdbc3(
olap4jConnection, mdx);
}

public XmlaOlap4jDatabaseMetaData newDatabaseMetaData(
XmlaOlap4jConnection olap4jConnection)
{
return new FactoryJdbc3Impl.XmlaOlap4jDatabaseMetaDataJdbc3(
return new XmlaOlap4jDatabaseMetaDataJdbc3(
olap4jConnection);
}

// Inner classes

private static class XmlaOlap4jStatementJdbc3
extends XmlaOlap4jStatement
{
public XmlaOlap4jStatementJdbc3(
XmlaOlap4jConnection olap4jConnection)
{
super(olap4jConnection);
}
}

private static class XmlaOlap4jPreparedStatementJdbc3
extends XmlaOlap4jPreparedStatement
{
Expand Down
268 changes: 268 additions & 0 deletions src/org/olap4j/driver/xmla/FactoryJdbc41Impl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
/*
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 2011-2011 Julian Hyde
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
package org.olap4j.driver.xmla;

import org.olap4j.OlapException;
import org.olap4j.driver.xmla.proxy.XmlaOlap4jProxy;

import java.sql.*;
import java.util.*;
import java.util.concurrent.Executor;

/**
* Implementation of {@link Factory} for JDBC 4.0.
*
* @author jhyde
* @version $Id: FactoryJdbc41Impl.java 476 2011-10-24 17:54:40Z jhyde $
* @since Jun 14, 2007
*/
class FactoryJdbc41Impl implements Factory {
/**
* Creates a FactoryJdbc41Impl.
*/
public FactoryJdbc41Impl() {
}

public Connection newConnection(
XmlaOlap4jDriver driver,
XmlaOlap4jProxy proxy,
String url,
Properties info)
throws SQLException
{
return new XmlaOlap4jConnectionJdbc41(
this, driver, proxy, url, info);
}

public EmptyResultSet newEmptyResultSet(
XmlaOlap4jConnection olap4jConnection)
{
List<String> headerList = Collections.emptyList();
List<List<Object>> rowList = Collections.emptyList();
return new EmptyResultSetJdbc41(olap4jConnection, headerList, rowList);
}

public ResultSet newFixedResultSet(
XmlaOlap4jConnection olap4jConnection,
List<String> headerList,
List<List<Object>> rowList)
{
return new EmptyResultSetJdbc41(
olap4jConnection, headerList, rowList);
}

public XmlaOlap4jCellSet newCellSet(
XmlaOlap4jStatement olap4jStatement) throws OlapException
{
return new XmlaOlap4jCellSetJdbc41(olap4jStatement);
}

public XmlaOlap4jStatement newStatement(
XmlaOlap4jConnection olap4jConnection)
{
return new XmlaOlap4jStatementJdbc41(olap4jConnection);
}

public XmlaOlap4jPreparedStatement newPreparedStatement(
String mdx,
XmlaOlap4jConnection olap4jConnection) throws OlapException
{
return new XmlaOlap4jPreparedStatementJdbc41(olap4jConnection, mdx);
}

public XmlaOlap4jDatabaseMetaData newDatabaseMetaData(
XmlaOlap4jConnection olap4jConnection)
{
return new XmlaOlap4jDatabaseMetaDataJdbc41(olap4jConnection);
}

// Inner classes

private static class EmptyResultSetJdbc41
extends FactoryJdbc4Plus.AbstractEmptyResultSet
{
/**
* Creates a EmptyResultSetJdbc41.
*
* @param olap4jConnection Connection
* @param headerList Column names
* @param rowList List of row values
*/
EmptyResultSetJdbc41(
XmlaOlap4jConnection olap4jConnection,
List<String> headerList,
List<List<Object>> rowList)
{
super(olap4jConnection, headerList, rowList);
}

public <T> T getObject(
int columnIndex,
Class<T> type) throws SQLException
{
throw new UnsupportedOperationException();
}

public <T> T getObject(
String columnLabel,
Class<T> type) throws SQLException
{
throw new UnsupportedOperationException();
}
}

private static class XmlaOlap4jConnectionJdbc41
extends FactoryJdbc4Plus.AbstractConnection
{
/**
* Creates a XmlaOlap4jConnectionJdbc41.
*
* @param factory Factory
* @param driver Driver
* @param proxy Proxy
* @param url URL
* @param info Extra properties
* @throws SQLException on error
*/
public XmlaOlap4jConnectionJdbc41(
Factory factory,
XmlaOlap4jDriver driver,
XmlaOlap4jProxy proxy,
String url,
Properties info) throws SQLException
{
super(factory, driver, proxy, url, info);
}

public void abort(Executor executor) throws SQLException {
throw new UnsupportedOperationException();
}

public void setNetworkTimeout(
Executor executor,
int milliseconds) throws SQLException
{
throw new UnsupportedOperationException();
}

public int getNetworkTimeout() throws SQLException {
throw new UnsupportedOperationException();
}
}

private static class XmlaOlap4jCellSetJdbc41
extends FactoryJdbc4Plus.AbstractCellSet
{
/**
* Creates an XmlaOlap4jCellSetJdbc41.
*
* @param olap4jStatement Statement
* @throws OlapException on error
*/
XmlaOlap4jCellSetJdbc41(
XmlaOlap4jStatement olap4jStatement)
throws OlapException
{
super(olap4jStatement);
}

public <T> T getObject(
int columnIndex,
Class<T> type) throws SQLException
{
throw new UnsupportedOperationException();
}

public <T> T getObject(
String columnLabel,
Class<T> type) throws SQLException
{
throw new UnsupportedOperationException();
}
}

private static class XmlaOlap4jStatementJdbc41
extends XmlaOlap4jStatement
{
/**
* Creates a XmlaOlap4jStatementJdbc41.
*
* @param olap4jConnection Connection
*/
XmlaOlap4jStatementJdbc41(
XmlaOlap4jConnection olap4jConnection)
{
super(olap4jConnection);
}

public void closeOnCompletion() throws SQLException {
throw new UnsupportedOperationException();
}

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

private static class XmlaOlap4jPreparedStatementJdbc41
extends FactoryJdbc4Plus.AbstractPreparedStatement
{
/**
* Creates a XmlaOlap4jPreparedStatementJdbc41.
*
* @param olap4jConnection Connection
* @param mdx MDX query text
* @throws OlapException on error
*/
XmlaOlap4jPreparedStatementJdbc41(
XmlaOlap4jConnection olap4jConnection,
String mdx) throws OlapException
{
super(olap4jConnection, mdx);
}

public void closeOnCompletion() throws SQLException {
throw new UnsupportedOperationException();
}

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

private static class XmlaOlap4jDatabaseMetaDataJdbc41
extends FactoryJdbc4Plus.AbstractDatabaseMetaData
{
/**
* Creates an XmlaOlap4jDatabaseMetaDataJdbc41.
*
* @param olap4jConnection Connection
*/
XmlaOlap4jDatabaseMetaDataJdbc41(
XmlaOlap4jConnection olap4jConnection)
{
super(olap4jConnection);
}

public ResultSet getPseudoColumns(
String catalog,
String schemaPattern,
String tableNamePattern,
String columnNamePattern) throws SQLException
{
throw new UnsupportedOperationException();
}

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

// End FactoryJdbc41Impl.java
Loading

0 comments on commit ae37510

Please sign in to comment.