Skip to content

Commit

Permalink
Compile and apparently work under Java 7 by stubbing interface methods
Browse files Browse the repository at this point in the history
Add @OverRide annotations to these and I'll kill you
  • Loading branch information
FauxFaux committed Oct 20, 2011
1 parent cae3555 commit 1d5ad0a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/main/java/uk/co/uwcs/choob/support/ChoobConnectionWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.sql.Struct;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;

public final class ChoobConnectionWrapper implements Connection
{
Expand Down Expand Up @@ -237,4 +238,27 @@ public ChoobConnectionWrapper(final Connection conn) {
@Override public <T> T unwrap(final Class<T> iface) throws SQLException {
return conn.unwrap(iface);
}

public void setSchema(String schema) throws SQLException {
// silently ignoring is fine
}

public String getSchema() throws SQLException {
// null is an acceptable return value
return null;
}

public void abort(Executor executor) throws SQLException {
throw new SQLException("Method stub; not available in Java 6 and not supported: abort");
}

public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLException("Method stub; not available in Java 6 and not supported: setNetworkTimeout");

}

public int getNetworkTimeout() throws SQLException {
// no timeout; acceptable
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,12 @@ public ChoobStatementWrapper(final Statement stat) {
@Override public <T> T unwrap(final Class<T> iface) throws SQLException {
return stat.unwrap(iface);
}

public void closeOnCompletion() throws SQLException {
throw new SQLException("Method stub; not available in Java 6 and not supported: closeOnCompletion");
}

public boolean isCloseOnCompletion() throws SQLException {
return false;
}
}

0 comments on commit 1d5ad0a

Please sign in to comment.