OPENJPA-2087. Adding "missing" methods on the concrete JDBC classes to allow building with Java 7. Committing this change on behalf of Jacob Nowosatka.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1226933 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kevin W. Sutter 2012-01-03 20:04:38 +00:00
parent 6369c744bd
commit 9cc9b97c97
12 changed files with 151 additions and 1 deletions

View File

@ -25,8 +25,10 @@ import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.List;
import java.util.Properties;
import java.util.logging.Logger;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.lib.jdbc.DelegatingDataSource;
@ -216,6 +218,11 @@ public class SimpleDriverDataSource
else
return null;
}
// Java 7 methods follow
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException();
}
}

View File

@ -1026,4 +1026,22 @@ public class DelegatingCallableStatement
public void setPoolable(boolean poolable) throws SQLException {
_stmnt.setPoolable(poolable);
}
// Java 7 methods follow
public <T>T getObject(String columnLabel, Class<T> type) throws SQLException{
throw new UnsupportedOperationException();
}
public <T>T getObject(int columnIndex, Class<T> type) throws SQLException{
throw new UnsupportedOperationException();
}
public boolean isCloseOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
public void closeOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
}

View File

@ -36,6 +36,7 @@ import java.sql.Statement;
import java.sql.Struct;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;
import org.apache.openjpa.lib.util.Closeable;
@ -510,4 +511,26 @@ public class DelegatingConnection implements Connection, Closeable {
public void setClientInfo(String name, String value) throws SQLClientInfoException {
_conn.setClientInfo(name, value);
}
// Java 7 methods follow
public void abort(Executor executor) throws SQLException {
throw new UnsupportedOperationException();
}
public int getNetworkTimeout() throws SQLException{
throw new UnsupportedOperationException();
}
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException{
throw new UnsupportedOperationException();
}
public String getSchema() throws SQLException {
throw new UnsupportedOperationException();
}
public void setSchema(String schema)throws SQLException {
throw new UnsupportedOperationException();
}
}

View File

@ -22,6 +22,8 @@ import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
import javax.sql.DataSource;
@ -153,4 +155,10 @@ public class DelegatingDataSource implements DataSource, Closeable {
return false;
}
}
// Java 7 methods follow
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException();
}
}

View File

@ -822,4 +822,15 @@ public class DelegatingDatabaseMetaData implements DatabaseMetaData {
public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
return _metaData.supportsStoredFunctionsUsingCallSyntax();
}
// Java 7 methods follow
public boolean generatedKeyAlwaysReturned() throws SQLException {
throw new UnsupportedOperationException();
}
public ResultSet getPseudoColumns(String catalog, String schemaPattern,
String tableNamepattern, String columnNamePattern) throws SQLException {
throw new UnsupportedOperationException();
}
}

View File

@ -555,4 +555,14 @@ public class DelegatingPreparedStatement
public void setPoolable(boolean poolable) throws SQLException {
_stmnt.setPoolable(poolable);
}
// Java 7 methods follow
public boolean isCloseOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
public void closeOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
}

View File

@ -881,5 +881,15 @@ public class DelegatingResultSet implements ResultSet, Closeable {
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
_rs.updateSQLXML(columnLabel, xmlObject);
}
// Java 7 methods follow
public <T>T getObject(String columnLabel, Class<T> type) throws SQLException{
throw new UnsupportedOperationException();
}
public <T>T getObject(int columnIndex, Class<T> type) throws SQLException{
throw new UnsupportedOperationException();
}
}

View File

@ -293,4 +293,14 @@ public class DelegatingStatement implements Statement, Closeable {
public boolean isPoolable() throws SQLException {
return _stmnt.isPoolable();
}
// Java 7 methods follow
public boolean isCloseOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
public void closeOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
}

View File

@ -36,6 +36,7 @@ import java.sql.Struct;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;
/**
* A virtual connection that contains multiple physical connections.
@ -336,4 +337,26 @@ public class DistributedConnection implements Connection {
throws SQLClientInfoException {
throw new UnsupportedOperationException();
}
// Java 7 methods follow
public void abort(Executor executor) throws SQLException {
throw new UnsupportedOperationException();
}
public int getNetworkTimeout() throws SQLException{
throw new UnsupportedOperationException();
}
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException{
throw new UnsupportedOperationException();
}
public String getSchema() throws SQLException {
throw new UnsupportedOperationException();
}
public void setSchema(String schema)throws SQLException {
throw new UnsupportedOperationException();
}
}

View File

@ -345,4 +345,14 @@ public class DistributedPreparedStatement
public void setSQLXML(int arg0, SQLXML arg1) throws SQLException {
throw new UnsupportedOperationException();
}
// Java 7 methods follow
public boolean isCloseOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
public void closeOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
}

View File

@ -909,4 +909,14 @@ public class DistributedResultSet implements ResultSet {
public void updateSQLXML(String arg0, SQLXML arg1) throws SQLException {
throw new UnsupportedOperationException();
}
// Java 7 methods follow
public <T>T getObject(String columnLabel, Class<T> type) throws SQLException{
throw new UnsupportedOperationException();
}
public <T>T getObject(int columnIndex, Class<T> type) throws SQLException{
throw new UnsupportedOperationException();
}
}

View File

@ -298,4 +298,14 @@ public class DistributedTemplate<T extends Statement>
public void setPoolable(boolean arg0) throws SQLException {
throw new UnsupportedOperationException();
}
// Java 7 methods follow
public boolean isCloseOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
public void closeOnCompletion() throws SQLException{
throw new UnsupportedOperationException();
}
}