diff --git a/src/main/java/com/alibaba/druid/mock/MockCallableStatement.java b/src/main/java/com/alibaba/druid/mock/MockCallableStatement.java index d0a520986f..d605e84154 100644 --- a/src/main/java/com/alibaba/druid/mock/MockCallableStatement.java +++ b/src/main/java/com/alibaba/druid/mock/MockCallableStatement.java @@ -29,6 +29,7 @@ import java.sql.NClob; import java.sql.Ref; import java.sql.RowId; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLXML; import java.sql.Time; import java.sql.Timestamp; @@ -663,4 +664,12 @@ public class MockCallableStatement extends MockPreparedStatement implements Call setObject(parameterName, x); } + public T getObject(int parameterIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public T getObject(String parameterName, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/mock/MockConnection.java b/src/main/java/com/alibaba/druid/mock/MockConnection.java index 5a81cb85d6..a21275e571 100644 --- a/src/main/java/com/alibaba/druid/mock/MockConnection.java +++ b/src/main/java/com/alibaba/druid/mock/MockConnection.java @@ -25,6 +25,7 @@ import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.SQLClientInfoException; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Savepoint; @@ -32,6 +33,7 @@ import java.sql.Statement; import java.sql.Struct; import java.util.Map; import java.util.Properties; +import java.util.concurrent.Executor; public class MockConnection implements Connection { @@ -479,4 +481,24 @@ public class MockConnection implements Connection { return new MockStruct(); } + public void setSchema(String schema) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public String getSchema() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void abort(Executor executor) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public int getNetworkTimeout() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/mock/MockDriver.java b/src/main/java/com/alibaba/druid/mock/MockDriver.java index 3ee5c0ceb3..360fe1cc97 100644 --- a/src/main/java/com/alibaba/druid/mock/MockDriver.java +++ b/src/main/java/com/alibaba/druid/mock/MockDriver.java @@ -24,11 +24,13 @@ import java.sql.DriverPropertyInfo; import java.sql.NClob; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLXML; import java.util.List; import java.util.Properties; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Logger; import com.alibaba.druid.logging.Log; import com.alibaba.druid.logging.LogFactory; @@ -278,4 +280,8 @@ public class MockDriver implements Driver { protected SQLXML createSQLXML(MockConnection conn) throws SQLException { return new MockSQLXML(); } + + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/mock/MockResultSet.java b/src/main/java/com/alibaba/druid/mock/MockResultSet.java index b3e545d30f..984fc0e3d9 100644 --- a/src/main/java/com/alibaba/druid/mock/MockResultSet.java +++ b/src/main/java/com/alibaba/druid/mock/MockResultSet.java @@ -29,6 +29,7 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.RowId; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Statement; @@ -1209,4 +1210,12 @@ public class MockResultSet implements ResultSet { updateObject(columnLabel, x); } + public T getObject(int columnIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public T getObject(String columnLabel, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/mock/MockStatement.java b/src/main/java/com/alibaba/druid/mock/MockStatement.java index 5589e67324..985e717fa2 100644 --- a/src/main/java/com/alibaba/druid/mock/MockStatement.java +++ b/src/main/java/com/alibaba/druid/mock/MockStatement.java @@ -18,6 +18,7 @@ package com.alibaba.druid.mock; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.Statement; @@ -449,4 +450,12 @@ public class MockStatement implements Statement { return false; } + public void closeOnCompletion() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public boolean isCloseOnCompletion() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/pool/DataSourceAdapter.java b/src/main/java/com/alibaba/druid/pool/DataSourceAdapter.java index 07973b0e16..eaddfe64d4 100644 --- a/src/main/java/com/alibaba/druid/pool/DataSourceAdapter.java +++ b/src/main/java/com/alibaba/druid/pool/DataSourceAdapter.java @@ -3,6 +3,8 @@ package com.alibaba.druid.pool; import java.io.PrintWriter; import java.sql.Connection; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.util.logging.Logger; import javax.sql.DataSource; @@ -43,4 +45,9 @@ public class DataSourceAdapter extends WrapperAdapter implements DataSource { public Connection getConnection(String username, String password) throws SQLException { throw new UnsupportedOperationException(); } + + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java b/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java index 7563842a42..a08e83449c 100644 --- a/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java +++ b/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java @@ -24,6 +24,7 @@ import java.sql.Driver; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.Statement; import java.util.ArrayList; import java.util.Collection; @@ -36,6 +37,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Logger; import javax.management.JMException; import javax.management.openmbean.CompositeDataSupport; @@ -1304,4 +1306,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements public abstract String getProperties(); + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/pool/DruidDataSourceC3P0Adapter.java b/src/main/java/com/alibaba/druid/pool/DruidDataSourceC3P0Adapter.java index 155154366a..9292fa9a1a 100644 --- a/src/main/java/com/alibaba/druid/pool/DruidDataSourceC3P0Adapter.java +++ b/src/main/java/com/alibaba/druid/pool/DruidDataSourceC3P0Adapter.java @@ -4,8 +4,10 @@ import java.io.PrintWriter; import java.sql.Connection; import java.sql.Driver; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.util.List; import java.util.Properties; +import java.util.logging.Logger; import javax.sql.DataSource; @@ -471,4 +473,7 @@ public class DruidDataSourceC3P0Adapter implements DataSource, DruidDataSourceC3 this.propertyCycle = propertyCycle; } + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/pool/PoolableCallableStatement.java b/src/main/java/com/alibaba/druid/pool/PoolableCallableStatement.java index dfaa653340..349f6a55b2 100644 --- a/src/main/java/com/alibaba/druid/pool/PoolableCallableStatement.java +++ b/src/main/java/com/alibaba/druid/pool/PoolableCallableStatement.java @@ -26,6 +26,7 @@ import java.sql.NClob; import java.sql.Ref; import java.sql.RowId; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLXML; import java.util.Calendar; @@ -1046,4 +1047,12 @@ public class PoolableCallableStatement extends PoolablePreparedStatement impleme } } + public T getObject(int parameterIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public T getObject(String parameterName, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/pool/PoolableConnection.java b/src/main/java/com/alibaba/druid/pool/PoolableConnection.java index 9951abdfba..4aa520cff3 100644 --- a/src/main/java/com/alibaba/druid/pool/PoolableConnection.java +++ b/src/main/java/com/alibaba/druid/pool/PoolableConnection.java @@ -25,6 +25,7 @@ import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.SQLClientInfoException; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Savepoint; @@ -32,6 +33,7 @@ import java.sql.Statement; import java.sql.Struct; import java.util.Map; import java.util.Properties; +import java.util.concurrent.Executor; import javax.sql.ConnectionEvent; import javax.sql.ConnectionEventListener; @@ -876,4 +878,23 @@ public class PoolableConnection implements PooledConnection, Connection { } } + public void setSchema(String schema) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public String getSchema() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void abort(Executor executor) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public int getNetworkTimeout() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/pool/PoolableResultSet.java b/src/main/java/com/alibaba/druid/pool/PoolableResultSet.java index 8321770f24..00c21d8d08 100644 --- a/src/main/java/com/alibaba/druid/pool/PoolableResultSet.java +++ b/src/main/java/com/alibaba/druid/pool/PoolableResultSet.java @@ -27,6 +27,7 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.RowId; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Statement; @@ -1739,4 +1740,11 @@ public final class PoolableResultSet extends PoolableWrapper implements ResultSe } } + public T getObject(int columnIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public T getObject(String columnLabel, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/pool/PoolableStatement.java b/src/main/java/com/alibaba/druid/pool/PoolableStatement.java index e22e0b8bfe..61998ecff9 100644 --- a/src/main/java/com/alibaba/druid/pool/PoolableStatement.java +++ b/src/main/java/com/alibaba/druid/pool/PoolableStatement.java @@ -544,4 +544,12 @@ public class PoolableStatement extends PoolableWrapper implements Statement { public String toString() { return stmt.toString(); } + + public void closeOnCompletion() throws SQLException { + + } + + public boolean isCloseOnCompletion() throws SQLException { + return false; + } } diff --git a/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceConnection.java b/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceConnection.java index 2d6eac6747..dd3ee97ff2 100644 --- a/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceConnection.java +++ b/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceConnection.java @@ -10,6 +10,7 @@ import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.SQLClientInfoException; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Savepoint; @@ -19,6 +20,7 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Properties; +import java.util.concurrent.Executor; import com.alibaba.druid.pool.WrapperAdapter; import com.alibaba.druid.proxy.jdbc.CallableStatementProxyImpl; @@ -578,4 +580,24 @@ public class MultiDataSourceConnection extends WrapperAdapter implements Connect return connectedTime; } + public void setSchema(String schema) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public String getSchema() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void abort(Executor executor) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public int getNetworkTimeout() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceStatement.java b/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceStatement.java index 35029004ca..86b59c1d6b 100644 --- a/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceStatement.java +++ b/src/main/java/com/alibaba/druid/pool/ha/MultiDataSourceStatement.java @@ -2,6 +2,7 @@ package com.alibaba.druid.pool.ha; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.Statement; @@ -449,4 +450,12 @@ public class MultiDataSourceStatement extends WrapperAdapter implements Statemen public String getCursorName() { return cursorName; } + + public void closeOnCompletion() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public boolean isCloseOnCompletion() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/proxy/DruidDriver.java b/src/main/java/com/alibaba/druid/proxy/DruidDriver.java index 14f557077d..2d30707eca 100644 --- a/src/main/java/com/alibaba/druid/proxy/DruidDriver.java +++ b/src/main/java/com/alibaba/druid/proxy/DruidDriver.java @@ -20,6 +20,7 @@ import java.sql.Driver; import java.sql.DriverManager; import java.sql.DriverPropertyInfo; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.util.ArrayList; import java.util.List; import java.util.Properties; @@ -27,6 +28,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Logger; import com.alibaba.druid.filter.Filter; import com.alibaba.druid.logging.Log; @@ -281,4 +283,8 @@ public class DruidDriver implements Driver, DruidDriverMBean { public static ConcurrentMap getProxyDataSources() { return proxyDataSources; } + + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/main/java/com/alibaba/druid/proxy/jdbc/CallableStatementProxyImpl.java b/src/main/java/com/alibaba/druid/proxy/jdbc/CallableStatementProxyImpl.java index 8c753b788a..36e174981e 100644 --- a/src/main/java/com/alibaba/druid/proxy/jdbc/CallableStatementProxyImpl.java +++ b/src/main/java/com/alibaba/druid/proxy/jdbc/CallableStatementProxyImpl.java @@ -26,6 +26,7 @@ import java.sql.NClob; import java.sql.Ref; import java.sql.RowId; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLXML; import java.util.Calendar; @@ -600,4 +601,12 @@ public class CallableStatementProxyImpl extends PreparedStatementProxyImpl imple createChain().callableStatement_setNClob(this, parameterName, reader); } + public T getObject(int parameterIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public T getObject(String parameterName, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/proxy/jdbc/ConnectionProxyImpl.java b/src/main/java/com/alibaba/druid/proxy/jdbc/ConnectionProxyImpl.java index 8583e00faf..21a16c002e 100644 --- a/src/main/java/com/alibaba/druid/proxy/jdbc/ConnectionProxyImpl.java +++ b/src/main/java/com/alibaba/druid/proxy/jdbc/ConnectionProxyImpl.java @@ -25,6 +25,7 @@ import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.SQLClientInfoException; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Savepoint; @@ -33,6 +34,7 @@ import java.sql.Struct; import java.util.Date; import java.util.Map; import java.util.Properties; +import java.util.concurrent.Executor; import com.alibaba.druid.filter.FilterChain; import com.alibaba.druid.filter.FilterChainImpl; @@ -319,4 +321,24 @@ public class ConnectionProxyImpl extends WrapperProxyImpl implements ConnectionP createChain().connection_setTypeMap(this, map); } + public void setSchema(String schema) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public String getSchema() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void abort(Executor executor) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public int getNetworkTimeout() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/proxy/jdbc/ResultSetProxyImpl.java b/src/main/java/com/alibaba/druid/proxy/jdbc/ResultSetProxyImpl.java index 73dff1344e..520ec43e60 100644 --- a/src/main/java/com/alibaba/druid/proxy/jdbc/ResultSetProxyImpl.java +++ b/src/main/java/com/alibaba/druid/proxy/jdbc/ResultSetProxyImpl.java @@ -29,6 +29,7 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.RowId; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Statement; @@ -1007,4 +1008,12 @@ public class ResultSetProxyImpl extends WrapperProxyImpl implements ResultSetPro return createChain().resultSet_wasNull(this); } + public T getObject(int columnIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public T getObject(String columnLabel, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } diff --git a/src/main/java/com/alibaba/druid/proxy/jdbc/StatementProxyImpl.java b/src/main/java/com/alibaba/druid/proxy/jdbc/StatementProxyImpl.java index fb6d37dacb..970b1c4d3b 100644 --- a/src/main/java/com/alibaba/druid/proxy/jdbc/StatementProxyImpl.java +++ b/src/main/java/com/alibaba/druid/proxy/jdbc/StatementProxyImpl.java @@ -18,6 +18,7 @@ package com.alibaba.druid.proxy.jdbc; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.Statement; import java.util.ArrayList; @@ -305,4 +306,12 @@ public class StatementProxyImpl extends WrapperProxyImpl implements StatementPro public String getLastExecuteSql() { return lastExecuteSql; } + + public void closeOnCompletion() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + public boolean isCloseOnCompletion() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } } diff --git a/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java b/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java index 26d476be23..34e9be3d23 100644 --- a/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java +++ b/src/test/java/com/alibaba/druid/bvt/pool/basic/PoolableCallableStatementTest.java @@ -1886,13 +1886,13 @@ public class PoolableCallableStatementTest extends TestCase { public void test_getObject() throws Exception { - stmt.getObject(1, null); - stmt.getObject("1", null); + stmt.getObject(1, (java.util.Map) null); + stmt.getObject("1", (java.util.Map) null); { SQLException error = null; try { - stmt.getObject(0, null); + stmt.getObject(0, (java.util.Map) null); } catch (SQLException ex) { error = ex; } @@ -1902,7 +1902,7 @@ public class PoolableCallableStatementTest extends TestCase { { SQLException error = null; try { - stmt.getObject("0", null); + stmt.getObject("0", (java.util.Map) null); } catch (SQLException ex) { error = ex; } diff --git a/src/test/java/com/alibaba/druid/bvt/pool/basic/ResultSetTest.java b/src/test/java/com/alibaba/druid/bvt/pool/basic/ResultSetTest.java index 898b44cec6..fcf6f9924f 100644 --- a/src/test/java/com/alibaba/druid/bvt/pool/basic/ResultSetTest.java +++ b/src/test/java/com/alibaba/druid/bvt/pool/basic/ResultSetTest.java @@ -1714,13 +1714,13 @@ public class ResultSetTest extends TestCase { public void test_getObject() throws Exception { resultSet.next(); - resultSet.getObject(1, null); - resultSet.getObject("1", null); + resultSet.getObject(1, (java.util.Map) null); + resultSet.getObject("1", (java.util.Map) null); { SQLException error = null; try { - resultSet.getObject(0, null); + resultSet.getObject(0, (java.util.Map) null); } catch (SQLException ex) { error = ex; } @@ -1730,7 +1730,7 @@ public class ResultSetTest extends TestCase { { SQLException error = null; try { - resultSet.getObject("0", null); + resultSet.getObject("0", (java.util.Map) null); } catch (SQLException ex) { error = ex; }