Skip to content

Commit

Permalink
Fix build for JDK 1.6; check in mondrian jars built under JDK 1.5 (no…
Browse files Browse the repository at this point in the history
…t JDK 1.6); add script to recursively switch to JDK 1.6 and invoke ant to build a couple of classes.

git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@46 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Nov 22, 2007
1 parent 640a790 commit df5d08b
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 18 deletions.
9 changes: 7 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ ${jar-jdk14.file}"/>
<mkdir dir="${testlog.dir}"/>
</target>

<target name="compile" depends="prepare,parser,compile.java"/>
<target name="compile" depends="prepare,parser,compile.java,compileJdk16"/>

<target name="compileJdk16">
<exec executable="buildJdk16.sh"/>
</target>

<target name="compile.java">
<condition property="jdk16.present">
Expand Down Expand Up @@ -201,6 +205,7 @@ doc/**/*.html,
doc/**/*.pdf,
build.xml,
build.properties,
buildJdk16.sh,
test.properties.example,
LICENSE.html,
README.txt,
Expand Down Expand Up @@ -291,7 +296,7 @@ doc/olap4j_api.pdf"
</tar>
</target>

<target name="jar" depends="version,compile">
<target name="jar" depends="version,compile,compileJdk16">
<mkdir dir="${lib.dir}" />
<zip
zipfile="${jar.file}"
Expand Down
10 changes: 10 additions & 0 deletions buildJdk16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# $Id: $
# Called recursively from 'ant release' to build the files which can only be
# built under JDK 1.6.

export JAVA_HOME=/usr/local/jdk1.6.0_01
export PATH=$JAVA_HOME/bin:$PATH
ant compile.java

# End buildJdk16.sh

Binary file modified lib/mondrian-jdk14.jar
Binary file not shown.
Binary file modified lib/mondrian.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/mondrian/olap4j/FactoryJdbc3Impl.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static class MondrianOlap4jCellSetJdbc3
public MondrianOlap4jCellSetJdbc3(
MondrianOlap4jStatement olap4jStatement, Query query)
{
super(olap4jStatement);
super(olap4jStatement, query);
}
}

Expand Down
28 changes: 25 additions & 3 deletions src/mondrian/olap4j/FactoryJdbc4Impl.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
package mondrian.olap4j;

import org.olap4j.OlapConnection;
import org.olap4j.OlapStatement;
import org.olap4j.CellSetMetaData;
import org.olap4j.OlapDatabaseMetaData;

import java.sql.*;
import java.util.*;
import java.io.Reader;
import java.io.InputStream;

import mondrian.olap.Result;
import mondrian.olap.Query;

/**
Expand Down Expand Up @@ -76,7 +78,7 @@ public MondrianOlap4jDatabaseMetaData newDatabaseMetaData(
// Inner classes

private static class EmptyResultSetJdbc4 extends EmptyResultSet {
public EmptyResultSetJdbc4(
EmptyResultSetJdbc4(
MondrianOlap4jConnection olap4jConnection,
List<String> headerList,
List<List<Object>> rowList)
Expand Down Expand Up @@ -320,14 +322,22 @@ private static class MondrianOlap4jConnectionJdbc4
extends MondrianOlap4jConnection
implements OlapConnection
{
public MondrianOlap4jConnectionJdbc4(
MondrianOlap4jConnectionJdbc4(
Factory factory,
String url,
Properties info) throws SQLException
{
super(factory, url, info);
}

public OlapStatement createStatement() {
return super.createStatement();
}

public OlapDatabaseMetaData getMetaData() {
return super.getMetaData();
}

// implement java.sql.Connection methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down Expand Up @@ -387,6 +397,10 @@ public MondrianOlap4jCellSetJdbc4(
super(olap4jStatement, query);
}

public CellSetMetaData getMetaData() {
return super.getMetaData();
}

// implement java.sql.CellSet methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down Expand Up @@ -629,6 +643,10 @@ public MondrianOlap4jPreparedStatementJdbc4(
super(olap4jConnection, mdx);
}

public CellSetMetaData getMetaData() {
return super.getMetaData();
}

// implement java.sql.PreparedStatement methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down Expand Up @@ -730,6 +748,10 @@ public MondrianOlap4jDatabaseMetaDataJdbc4(
super(olap4jConnection);
}

public OlapConnection getConnection() {
return super.getConnection();
}

// implement java.sql.DatabaseMetaData methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down
2 changes: 1 addition & 1 deletion src/mondrian/olap4j/MondrianOlap4jDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ public ResultSet getUDTs(
throw new UnsupportedOperationException();
}

public OlapConnection getConnection() throws SQLException {
public OlapConnection getConnection() {
return olap4jConnection;
}

Expand Down
2 changes: 1 addition & 1 deletion src/mondrian/olap4j/MondrianOlap4jPreparedStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void setArray(int parameterIndex, Array x) throws SQLException {
throw new UnsupportedOperationException();
}

public CellSetMetaData getMetaData() throws SQLException {
public CellSetMetaData getMetaData() {
return cellSetMetaData;
}

Expand Down
2 changes: 1 addition & 1 deletion src/org/olap4j/OlapDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ ResultSet getDimensions(
*
* @exception OlapException if a database access error occurs
*
* @see #getFunctions(String, String, String)
* @see java.sql.DatabaseMetaData#getFunctions(String, String, String)
* @see #getSearchStringEscape
*/
ResultSet getOlapFunctions(
Expand Down
32 changes: 27 additions & 5 deletions src/org/olap4j/driver/xmla/FactoryJdbc4Impl.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.io.Reader;
import java.io.InputStream;

import org.olap4j.OlapConnection;
import org.olap4j.*;

/**
* Implementation of {@link Factory} for JDBC 4.0.
Expand Down Expand Up @@ -311,6 +311,14 @@ public XmlaOlap4jConnectionJdbc4(
super(factory, proxy, url, info);
}

public OlapStatement createStatement() {
return super.createStatement();
}

public OlapDatabaseMetaData getMetaData() {
return super.getMetaData();
}

// implement java.sql.Connection methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down Expand Up @@ -370,6 +378,10 @@ public XmlaOlap4jCellSetJdbc4(
super(olap4jStatement, is);
}

public CellSetMetaData getMetaData() {
return super.getMetaData();
}

// implement java.sql.CellSet methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down Expand Up @@ -603,14 +615,19 @@ public void updateNClob(
}

private static class XmlaOlap4jPreparedStatementJdbc4
extends XmlaOlap4jPreparedStatement {
public XmlaOlap4jPreparedStatementJdbc4(
extends XmlaOlap4jPreparedStatement
{
XmlaOlap4jPreparedStatementJdbc4(
XmlaOlap4jConnection olap4jConnection,
String mdx)
{
super(olap4jConnection, mdx);
}

public CellSetMetaData getMetaData() {
return super.getMetaData();
}

// implement java.sql.PreparedStatement methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down Expand Up @@ -705,13 +722,18 @@ public void setNClob(
}

private static class XmlaOlap4jDatabaseMetaDataJdbc4
extends XmlaOlap4jDatabaseMetaData {
public XmlaOlap4jDatabaseMetaDataJdbc4(
extends XmlaOlap4jDatabaseMetaData
{
XmlaOlap4jDatabaseMetaDataJdbc4(
XmlaOlap4jConnection olap4jConnection)
{
super(olap4jConnection);
}

public OlapConnection getConnection() {
return super.getConnection();
}

// implement java.sql.DatabaseMetaData methods
// introduced in JDBC 4.0/JDK 1.6

Expand Down
2 changes: 1 addition & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public XmlaOlap4jCellSet(
}
}

public CellSetMetaData getMetaData() throws OlapException {
public CellSetMetaData getMetaData() {
return metaData;
}

Expand Down
2 changes: 1 addition & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public ResultSet getUDTs(
throw new UnsupportedOperationException();
}

public OlapConnection getConnection() throws SQLException {
public OlapConnection getConnection() {
return olap4jConnection;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void setArray(int parameterIndex, Array x) throws SQLException {
throw new UnsupportedOperationException();
}

public CellSetMetaData getMetaData() throws SQLException {
public CellSetMetaData getMetaData() {
return cellSetMetaData;
}

Expand Down
2 changes: 1 addition & 1 deletion src/org/olap4j/query/SelectionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.olap4j.metadata.Member;

/**
* Contains factory methods for creating {@link SelectionImpl}s.
* Contains factory methods for creating implementations of {@link Selection}.
*
* <p>Created using {@link Query#getSelectionFactory()}.
*
Expand Down

0 comments on commit df5d08b

Please sign in to comment.