diff --git a/pom.xml b/pom.xml index 7cccdf2648..ba3cb24458 100644 --- a/pom.xml +++ b/pom.xml @@ -417,8 +417,8 @@ com.oracle - ojdbc14 - 10.2.0.2 + ojdbc6 + 11.2.0.3 provided diff --git a/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java b/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java index e463ebdddf..3b072b6c04 100644 --- a/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java +++ b/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java @@ -85,7 +85,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements public final static boolean DEFAULT_TEST_ON_RETURN = false; public final static boolean DEFAULT_WHILE_IDLE = true; public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 60 * 1000L; - public static final long DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS = 300 * 1000; + public static final long DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS = 30 * 1000; public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = 3; /** diff --git a/src/main/java/com/alibaba/druid/util/OracleUtils.java b/src/main/java/com/alibaba/druid/util/OracleUtils.java index c9c567ea8f..b38df1b099 100644 --- a/src/main/java/com/alibaba/druid/util/OracleUtils.java +++ b/src/main/java/com/alibaba/druid/util/OracleUtils.java @@ -1,164 +1,165 @@ -/* - * Copyright 1999-2011 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.druid.util; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -import javax.sql.XAConnection; -import javax.transaction.xa.XAException; - -import oracle.jdbc.OracleConnection; -import oracle.jdbc.OracleResultSet; -import oracle.jdbc.OracleStatement; -import oracle.jdbc.internal.OraclePreparedStatement; -import oracle.jdbc.xa.client.OracleXAConnection; -import oracle.sql.ROWID; - -import com.alibaba.druid.pool.DruidPooledConnection; -import com.alibaba.druid.support.logging.Log; -import com.alibaba.druid.support.logging.LogFactory; - -public class OracleUtils { - - private final static Log LOG = LogFactory.getLog(OracleUtils.class); - - public static XAConnection OracleXAConnection(Connection oracleConnection) throws XAException { - return new OracleXAConnection(oracleConnection); - } - - public static int getRowPrefetch(PreparedStatement stmt) throws SQLException { - OracleStatement oracleStmt = stmt.unwrap(OracleStatement.class); - - if (oracleStmt == null) { - return -1; - } - - return oracleStmt.getRowPrefetch(); - } - - public static void setRowPrefetch(PreparedStatement stmt, int value) throws SQLException { - OracleStatement oracleStmt = stmt.unwrap(OracleStatement.class); - if (oracleStmt != null) { - oracleStmt.setRowPrefetch(value); - } - } - - public static void enterImplicitCache(PreparedStatement stmt) throws SQLException { - oracle.jdbc.internal.OraclePreparedStatement oracleStmt = unwrapInternal(stmt); - if (oracleStmt != null) { - oracleStmt.enterImplicitCache(); - } - } - - public static void exitImplicitCacheToClose(PreparedStatement stmt) throws SQLException { - oracle.jdbc.internal.OraclePreparedStatement oracleStmt = unwrapInternal(stmt); - if (oracleStmt != null) { - oracleStmt.exitImplicitCacheToClose(); - } - } - - public static void exitImplicitCacheToActive(PreparedStatement stmt) throws SQLException { - oracle.jdbc.internal.OraclePreparedStatement oracleStmt = unwrapInternal(stmt); - if (oracleStmt != null) { - oracleStmt.exitImplicitCacheToActive(); - } - } - - public static OraclePreparedStatement unwrapInternal(PreparedStatement stmt) throws SQLException { - if (stmt instanceof OraclePreparedStatement) { - return (OraclePreparedStatement) stmt; - } - - OraclePreparedStatement unwrapped = stmt.unwrap(OraclePreparedStatement.class); - - if (unwrapped == null) { - LOG.error("can not unwrap statement : " + stmt.getClass()); - } - - return unwrapped; - } - - public static short getVersionNumber(DruidPooledConnection conn) throws SQLException { - oracle.jdbc.internal.OracleConnection oracleConn = (oracle.jdbc.internal.OracleConnection) unwrap(conn); - return oracleConn.getVersionNumber(); - } - - public static void setDefaultRowPrefetch(Connection conn, int value) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - oracleConn.setDefaultRowPrefetch(value); - } - - public static int getDefaultRowPrefetch(Connection conn, int value) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - return oracleConn.getDefaultRowPrefetch(); - } - - public static boolean getImplicitCachingEnabled(Connection conn) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - return oracleConn.getImplicitCachingEnabled(); - } - - public static int getStatementCacheSize(Connection conn) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - return oracleConn.getStatementCacheSize(); - } - - public static void purgeImplicitCache(Connection conn) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - oracleConn.purgeImplicitCache(); - } - - public static void setImplicitCachingEnabled(Connection conn, boolean cache) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - oracleConn.setImplicitCachingEnabled(cache); - } - - public static void setStatementCacheSize(Connection conn, int size) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - oracleConn.setStatementCacheSize(size); - } - - public static int pingDatabase(Connection conn) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - return oracleConn.pingDatabase(1000); - } - - public static void openProxySession(Connection conn, int type, java.util.Properties prop) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - oracleConn.openProxySession(type, prop); - } - - public static int getDefaultExecuteBatch(Connection conn) throws SQLException { - OracleConnection oracleConn = unwrap(conn); - return oracleConn.getDefaultExecuteBatch(); - } - - public static OracleConnection unwrap(Connection conn) throws SQLException { - if (conn instanceof OracleConnection) { - return (OracleConnection) conn; - } - - return conn.unwrap(OracleConnection.class); - } - - public static ROWID getROWID(ResultSet rs, int columnIndex) throws SQLException { - OracleResultSet oracleResultSet = rs.unwrap(OracleResultSet.class); - return oracleResultSet.getROWID(columnIndex); - } -} +/* + * Copyright 1999-2011 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.druid.util; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.sql.XAConnection; +import javax.transaction.xa.XAException; + +import oracle.jdbc.OracleConnection; +import oracle.jdbc.OracleResultSet; +import oracle.jdbc.OracleStatement; +import oracle.jdbc.internal.OraclePreparedStatement; +import oracle.jdbc.xa.client.OracleXAConnection; +import oracle.sql.ROWID; + +import com.alibaba.druid.pool.DruidPooledConnection; +import com.alibaba.druid.support.logging.Log; +import com.alibaba.druid.support.logging.LogFactory; + +public class OracleUtils { + + private final static Log LOG = LogFactory.getLog(OracleUtils.class); + + public static XAConnection OracleXAConnection(Connection oracleConnection) throws XAException { + return new OracleXAConnection(oracleConnection); + } + + public static int getRowPrefetch(PreparedStatement stmt) throws SQLException { + OracleStatement oracleStmt = stmt.unwrap(OracleStatement.class); + + if (oracleStmt == null) { + return -1; + } + + return oracleStmt.getRowPrefetch(); + } + + public static void setRowPrefetch(PreparedStatement stmt, int value) throws SQLException { + OracleStatement oracleStmt = stmt.unwrap(OracleStatement.class); + if (oracleStmt != null) { + oracleStmt.setRowPrefetch(value); + } + } + + public static void enterImplicitCache(PreparedStatement stmt) throws SQLException { + oracle.jdbc.internal.OraclePreparedStatement oracleStmt = unwrapInternal(stmt); + if (oracleStmt != null) { + oracleStmt.enterImplicitCache(); + } + } + + public static void exitImplicitCacheToClose(PreparedStatement stmt) throws SQLException { + oracle.jdbc.internal.OraclePreparedStatement oracleStmt = unwrapInternal(stmt); + if (oracleStmt != null) { + oracleStmt.exitImplicitCacheToClose(); + } + } + + public static void exitImplicitCacheToActive(PreparedStatement stmt) throws SQLException { + oracle.jdbc.internal.OraclePreparedStatement oracleStmt = unwrapInternal(stmt); + if (oracleStmt != null) { + oracleStmt.exitImplicitCacheToActive(); + } + } + + public static OraclePreparedStatement unwrapInternal(PreparedStatement stmt) throws SQLException { + if (stmt instanceof OraclePreparedStatement) { + return (OraclePreparedStatement) stmt; + } + + OraclePreparedStatement unwrapped = stmt.unwrap(OraclePreparedStatement.class); + + if (unwrapped == null) { + LOG.error("can not unwrap statement : " + stmt.getClass()); + } + + return unwrapped; + } + + public static short getVersionNumber(DruidPooledConnection conn) throws SQLException { + oracle.jdbc.internal.OracleConnection oracleConn = (oracle.jdbc.internal.OracleConnection) unwrap(conn); + return oracleConn.getVersionNumber(); + } + + public static void setDefaultRowPrefetch(Connection conn, int value) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + oracleConn.setDefaultRowPrefetch(value); + } + + public static int getDefaultRowPrefetch(Connection conn, int value) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + return oracleConn.getDefaultRowPrefetch(); + } + + public static boolean getImplicitCachingEnabled(Connection conn) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + return oracleConn.getImplicitCachingEnabled(); + } + + public static int getStatementCacheSize(Connection conn) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + return oracleConn.getStatementCacheSize(); + } + + public static void purgeImplicitCache(Connection conn) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + oracleConn.purgeImplicitCache(); + } + + public static void setImplicitCachingEnabled(Connection conn, boolean cache) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + oracleConn.setImplicitCachingEnabled(cache); + } + + public static void setStatementCacheSize(Connection conn, int size) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + oracleConn.setStatementCacheSize(size); + } + + @SuppressWarnings("deprecation") + public static int pingDatabase(Connection conn) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + return oracleConn.pingDatabase(1000); + } + + public static void openProxySession(Connection conn, int type, java.util.Properties prop) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + oracleConn.openProxySession(type, prop); + } + + public static int getDefaultExecuteBatch(Connection conn) throws SQLException { + OracleConnection oracleConn = unwrap(conn); + return oracleConn.getDefaultExecuteBatch(); + } + + public static OracleConnection unwrap(Connection conn) throws SQLException { + if (conn instanceof OracleConnection) { + return (OracleConnection) conn; + } + + return conn.unwrap(OracleConnection.class); + } + + public static ROWID getROWID(ResultSet rs, int columnIndex) throws SQLException { + OracleResultSet oracleResultSet = rs.unwrap(OracleResultSet.class); + return oracleResultSet.getROWID(columnIndex); + } +} diff --git a/src/test/java/com/alibaba/druid/bvt/pool/basic/TestDataSourceBasic2.java b/src/test/java/com/alibaba/druid/bvt/pool/basic/TestDataSourceBasic2.java index 58bdfba29a..fbaf5d1f8c 100644 --- a/src/test/java/com/alibaba/druid/bvt/pool/basic/TestDataSourceBasic2.java +++ b/src/test/java/com/alibaba/druid/bvt/pool/basic/TestDataSourceBasic2.java @@ -1,130 +1,131 @@ -/* - * Copyright 1999-2011 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.druid.bvt.pool.basic; - -import java.util.Arrays; -import java.util.Properties; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import com.alibaba.druid.pool.DruidDataSource; -import com.alibaba.druid.pool.ExceptionSorter; -import com.alibaba.druid.stat.DruidDataSourceStatManager; - -public class TestDataSourceBasic2 extends TestCase { - - public void test_0() throws Exception { - DruidDataSourceStatManager.cear(); - - DruidDataSource dataSource = new DruidDataSource(); - dataSource.setUrl("jdbc:mock:xxx"); - - dataSource.setBreakAfterAcquireFailure(true); - Assert.assertEquals(true, dataSource.isBreakAfterAcquireFailure()); - - dataSource.setConnectionErrorRetryAttempts(234); - Assert.assertEquals(234, dataSource.getConnectionErrorRetryAttempts()); - - dataSource.setMaxPoolPreparedStatementPerConnectionSize(234); - Assert.assertEquals(234, dataSource.getMaxPoolPreparedStatementPerConnectionSize()); - - dataSource.incrementDupCloseCount(); - Assert.assertEquals(1, dataSource.getDupCloseCount()); - - dataSource.setValidConnectionChecker(null); - dataSource.setValidConnectionCheckerClassName(null); - Assert.assertEquals(null, dataSource.getValidConnectionChecker()); - - dataSource.addConnectionProperty("user", "ljw"); - Assert.assertEquals(1, dataSource.getConnectProperties().size()); - - Assert.assertEquals(0, dataSource.getConnectionInitSqls().size()); - dataSource.setConnectionInitSqls(Arrays. asList("SELECT 1", null, "")); - Assert.assertEquals(1, dataSource.getConnectionInitSqls().size()); - - Assert.assertEquals(30 * 1000, dataSource.getTimeBetweenConnectErrorMillis()); - Assert.assertEquals(234, dataSource.getMaxOpenPreparedStatements()); - Assert.assertEquals(300, dataSource.getRemoveAbandonedTimeout()); - dataSource.setRemoveAbandonedTimeout(400); - Assert.assertEquals(400, dataSource.getRemoveAbandonedTimeout()); - Assert.assertEquals(400 * 1000, dataSource.getRemoveAbandonedTimeoutMillis()); - Assert.assertEquals(3, dataSource.getNumTestsPerEvictionRun()); - dataSource.setNumTestsPerEvictionRun(4); - Assert.assertEquals(4, dataSource.getNumTestsPerEvictionRun()); - - dataSource.setMaxWaitThreadCount(4); - Assert.assertEquals(4, dataSource.getMaxWaitThreadCount()); - - dataSource.setValidationQueryTimeout(4); - Assert.assertEquals(4, dataSource.getValidationQueryTimeout()); - - dataSource.setAccessToUnderlyingConnectionAllowed(true); - Assert.assertEquals(true, dataSource.isAccessToUnderlyingConnectionAllowed()); - - dataSource.setDefaultReadOnly(true); - Assert.assertEquals(Boolean.TRUE, dataSource.getDefaultReadOnly()); - - dataSource.setDefaultTransactionIsolation(10); - Assert.assertEquals(Integer.valueOf(10), dataSource.getDefaultTransactionIsolation()); - - dataSource.setDefaultCatalog("xxx"); - Assert.assertEquals("xxx", dataSource.getDefaultCatalog()); - - dataSource.setPasswordCallbackClassName(null); - dataSource.setUserCallback(null); - - Assert.assertEquals(0, dataSource.getQueryTimeout()); - dataSource.setQueryTimeout(10001); - Assert.assertEquals(10001, dataSource.getQueryTimeout()); - - Assert.assertEquals(-1, dataSource.getMaxWait()); - dataSource.setMaxWait(10001); - Assert.assertEquals(10001, dataSource.getMaxWait()); - - Assert.assertEquals(8, dataSource.getMaxIdle()); - dataSource.setMaxIdle(3); - Assert.assertEquals(3, dataSource.getMaxIdle()); - - Assert.assertEquals(0, dataSource.getLoginTimeout()); - dataSource.setLoginTimeout(30); - Assert.assertEquals(30, dataSource.getLoginTimeout()); - - Assert.assertEquals(null, dataSource.getUsername()); - dataSource.setUsername("ljw"); - Assert.assertEquals("ljw", dataSource.getUsername()); - - Assert.assertEquals(null, dataSource.getPassword()); - dataSource.setPassword("xxx"); - Assert.assertEquals("xxx", dataSource.getPassword()); - - dataSource.setConnectProperties(new Properties()); - Assert.assertEquals(0, dataSource.getConnectProperties().size()); - dataSource.setConnectionProperties("a=1;b=2;c"); - Assert.assertEquals(3, dataSource.getConnectProperties().size()); - - dataSource.setExceptionSorter((ExceptionSorter) null); - - dataSource.close(); - } - - protected void tearDown() throws Exception { - for (DruidDataSource dataSource : DruidDataSourceStatManager.getDruidDataSourceInstances()) { - dataSource.close(); - } - } - -} +/* + * Copyright 1999-2011 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.druid.bvt.pool.basic; + +import java.util.Arrays; +import java.util.Properties; + +import junit.framework.TestCase; + +import org.junit.Assert; + +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.druid.pool.ExceptionSorter; +import com.alibaba.druid.stat.DruidDataSourceStatManager; + +public class TestDataSourceBasic2 extends TestCase { + + public void test_0() throws Exception { + DruidDataSourceStatManager.cear(); + + DruidDataSource dataSource = new DruidDataSource(); + dataSource.setUrl("jdbc:mock:xxx"); + + dataSource.setBreakAfterAcquireFailure(true); + Assert.assertEquals(true, dataSource.isBreakAfterAcquireFailure()); + + dataSource.setConnectionErrorRetryAttempts(234); + Assert.assertEquals(234, dataSource.getConnectionErrorRetryAttempts()); + + dataSource.setMaxPoolPreparedStatementPerConnectionSize(234); + Assert.assertEquals(234, dataSource.getMaxPoolPreparedStatementPerConnectionSize()); + + dataSource.incrementDupCloseCount(); + Assert.assertEquals(1, dataSource.getDupCloseCount()); + + dataSource.setValidConnectionChecker(null); + dataSource.setValidConnectionCheckerClassName(null); + Assert.assertEquals(null, dataSource.getValidConnectionChecker()); + + dataSource.addConnectionProperty("user", "ljw"); + Assert.assertEquals(1, dataSource.getConnectProperties().size()); + + Assert.assertEquals(0, dataSource.getConnectionInitSqls().size()); + dataSource.setConnectionInitSqls(Arrays. asList("SELECT 1", null, "")); + Assert.assertEquals(1, dataSource.getConnectionInitSqls().size()); + + Assert.assertEquals(30 * 1000, dataSource.getTimeBetweenConnectErrorMillis()); + Assert.assertEquals(234, dataSource.getMaxOpenPreparedStatements()); + Assert.assertEquals(300, dataSource.getRemoveAbandonedTimeout()); + dataSource.setRemoveAbandonedTimeout(400); + Assert.assertEquals(400, dataSource.getRemoveAbandonedTimeout()); + Assert.assertEquals(400 * 1000, dataSource.getRemoveAbandonedTimeoutMillis()); + Assert.assertEquals(3, dataSource.getNumTestsPerEvictionRun()); + dataSource.setNumTestsPerEvictionRun(4); + Assert.assertEquals(4, dataSource.getNumTestsPerEvictionRun()); + + dataSource.setMaxWaitThreadCount(4); + Assert.assertEquals(4, dataSource.getMaxWaitThreadCount()); + + dataSource.setValidationQueryTimeout(4); + Assert.assertEquals(4, dataSource.getValidationQueryTimeout()); + + dataSource.setAccessToUnderlyingConnectionAllowed(true); + Assert.assertEquals(true, dataSource.isAccessToUnderlyingConnectionAllowed()); + + dataSource.setDefaultReadOnly(true); + Assert.assertEquals(Boolean.TRUE, dataSource.getDefaultReadOnly()); + + dataSource.setDefaultTransactionIsolation(10); + Assert.assertEquals(Integer.valueOf(10), dataSource.getDefaultTransactionIsolation()); + + dataSource.setDefaultCatalog("xxx"); + Assert.assertEquals("xxx", dataSource.getDefaultCatalog()); + + dataSource.setPasswordCallbackClassName(null); + dataSource.setUserCallback(null); + + Assert.assertEquals(0, dataSource.getQueryTimeout()); + dataSource.setQueryTimeout(10001); + Assert.assertEquals(10001, dataSource.getQueryTimeout()); + + Assert.assertEquals(-1, dataSource.getMaxWait()); + dataSource.setMaxWait(10001); + Assert.assertEquals(10001, dataSource.getMaxWait()); + + Assert.assertEquals(8, dataSource.getMaxIdle()); + dataSource.setMaxIdle(3); + Assert.assertEquals(3, dataSource.getMaxIdle()); + + Assert.assertEquals(0, dataSource.getLoginTimeout()); + dataSource.setLoginTimeout(30); + Assert.assertEquals(30, dataSource.getLoginTimeout()); + + Assert.assertEquals(null, dataSource.getUsername()); + dataSource.setUsername("ljw"); + Assert.assertEquals("ljw", dataSource.getUsername()); + + Assert.assertEquals(null, dataSource.getPassword()); + dataSource.setPassword("xxx"); + Assert.assertEquals("xxx", dataSource.getPassword()); + + dataSource.setConnectProperties(new Properties()); + Assert.assertEquals(0, dataSource.getConnectProperties().size()); + dataSource.setConnectionProperties("a=1;b=2;c"); + Assert.assertEquals(3, dataSource.getConnectProperties().size()); + + dataSource.setExceptionSorter((ExceptionSorter) null); + + dataSource.close(); + } + + protected void tearDown() throws Exception { + for (DruidDataSource dataSource : DruidDataSourceStatManager.getDruidDataSourceInstances()) { + dataSource.close(); + } + } + +} diff --git a/src/test/java/com/alibaba/druid/pool/oracle/DruidDataSourceTest_oracle3.java b/src/test/java/com/alibaba/druid/pool/oracle/DruidDataSourceTest_oracle3.java index 4513b7bcff..4c2ac8d3d8 100644 --- a/src/test/java/com/alibaba/druid/pool/oracle/DruidDataSourceTest_oracle3.java +++ b/src/test/java/com/alibaba/druid/pool/oracle/DruidDataSourceTest_oracle3.java @@ -4,9 +4,10 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.vendor.OracleValidConnectionChecker; @@ -21,9 +22,9 @@ public class DruidDataSourceTest_oracle3 extends TestCase { protected void setUp() throws Exception { dataSource = new DruidDataSource(); - dataSource.setUrl("jdbc:oracle:thin:@192.168.122.184:1521:ORCL"); + dataSource.setUrl("jdbc:oracle:thin:@localhost:1521:sonar"); dataSource.setUsername("system"); - dataSource.setPassword("druid"); + dataSource.setPassword("sonar"); dataSource.setInitialSize(1); dataSource.setMaxActive(14); dataSource.setMinIdle(1); diff --git a/src/test/java/com/alibaba/druid/test/util/OracleMockConnection.java b/src/test/java/com/alibaba/druid/test/util/OracleMockConnection.java index 3a6b6867a4..4d6bb0672f 100644 --- a/src/test/java/com/alibaba/druid/test/util/OracleMockConnection.java +++ b/src/test/java/com/alibaba/druid/test/util/OracleMockConnection.java @@ -1,741 +1,813 @@ -/* - * Copyright 1999-2011 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.druid.test.util; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.sql.Array; -import java.sql.CallableStatement; -import java.sql.Connection; -import java.sql.Date; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Time; -import java.sql.Timestamp; -import java.util.Calendar; -import java.util.Properties; -import java.util.TimeZone; - -import oracle.jdbc.OracleOCIFailover; -import oracle.jdbc.OracleSavepoint; -import oracle.jdbc.internal.OracleConnection; -import oracle.jdbc.pool.OracleConnectionCacheCallback; -import oracle.sql.ARRAY; -import oracle.sql.BINARY_DOUBLE; -import oracle.sql.BINARY_FLOAT; -import oracle.sql.DATE; -import oracle.sql.INTERVALDS; -import oracle.sql.INTERVALYM; -import oracle.sql.NUMBER; -import oracle.sql.TIMESTAMP; -import oracle.sql.TIMESTAMPLTZ; -import oracle.sql.TIMESTAMPTZ; -import oracle.sql.TypeDescriptor; - -import com.alibaba.druid.mock.MockConnection; -import com.alibaba.druid.mock.MockConnectionClosedException; -import com.alibaba.druid.mock.MockDriver; - -public class OracleMockConnection extends MockConnection implements oracle.jdbc.OracleConnection { - - private int defaultRowPrefetch = 10; - - public OracleMockConnection(){ - super(); - } - - public OracleMockConnection(MockDriver driver, String url, Properties connectProperties){ - super(driver, url, connectProperties); - - String val = (String) connectProperties.get("defaultRowPrefetch"); - if (val != null) { - defaultRowPrefetch = Integer.parseInt(val); - } - } - - public Connection _getPC() { - // TODO Auto-generated method stub - return null; - } - - public void abort() throws SQLException { - // TODO Auto-generated method stub - - } - - public void applyConnectionAttributes(Properties arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void archive(int arg0, int arg1, String arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - public void cancel() throws SQLException { - // TODO Auto-generated method stub - - } - - public void clearAllApplicationContext(String arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void close(Properties arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void close(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public ARRAY createARRAY(String arg0, Object arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public BINARY_DOUBLE createBINARY_DOUBLE(double arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public BINARY_FLOAT createBINARY_FLOAT(float arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(Date arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(Time arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(Timestamp arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(Date arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(Time arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public DATE createDATE(Timestamp arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public INTERVALDS createINTERVALDS(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public INTERVALYM createINTERVALYM(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - // TODO Auto-generated method stub - public NUMBER createNUMBER(boolean arg0) throws SQLException { - return null; - } - - public NUMBER createNUMBER(byte arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(short arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(int arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(long arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(float arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(double arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(BigDecimal arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(BigInteger arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public NUMBER createNUMBER(String arg0, int arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public Array createOracleArray(String arg0, Object arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMP createTIMESTAMP(Date arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMP createTIMESTAMP(DATE arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMP createTIMESTAMP(Time arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMP createTIMESTAMP(Timestamp arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMP createTIMESTAMP(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPLTZ createTIMESTAMPLTZ(Date arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPLTZ createTIMESTAMPLTZ(Time arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPLTZ createTIMESTAMPLTZ(Timestamp arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPLTZ createTIMESTAMPLTZ(String arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPLTZ createTIMESTAMPLTZ(DATE arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(Date arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(Time arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(Timestamp arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(DATE arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(Date arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(Time arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(Timestamp arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TIMESTAMPTZ createTIMESTAMPTZ(String arg0, Calendar arg1) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TypeDescriptor[] getAllTypeDescriptorsInCurrentSchema() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public String getAuthenticationAdaptorName() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public boolean getAutoClose() throws SQLException { - // TODO Auto-generated method stub - return false; - } - - public CallableStatement getCallWithKey(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public Properties getConnectionAttributes() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public int getConnectionReleasePriority() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public boolean getCreateStatementAsRefCursor() { - // TODO Auto-generated method stub - return false; - } - - public String getCurrentSchema() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public String getDataIntegrityAlgorithmName() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public int getDefaultExecuteBatch() { - // TODO Auto-generated method stub - return 0; - } - - public int getDefaultRowPrefetch() { - return defaultRowPrefetch; - } - - public TimeZone getDefaultTimeZone() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public Object getDescriptor(String arg0) { - // TODO Auto-generated method stub - return null; - } - - public String getEncryptionAlgorithmName() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public short getEndToEndECIDSequenceNumber() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public String[] getEndToEndMetrics() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public boolean getExplicitCachingEnabled() throws SQLException { - // TODO Auto-generated method stub - return false; - } - - public boolean getImplicitCachingEnabled() throws SQLException { - // TODO Auto-generated method stub - return false; - } - - public boolean getIncludeSynonyms() { - // TODO Auto-generated method stub - return false; - } - - public Object getJavaObject(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public Properties getProperties() { - // TODO Auto-generated method stub - return null; - } - - public boolean getRemarksReporting() { - // TODO Auto-generated method stub - return false; - } - - public boolean getRestrictGetTables() { - // TODO Auto-generated method stub - return false; - } - - public String getSQLType(Object arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public String getSessionTimeZone() { - // TODO Auto-generated method stub - return null; - } - - public String getSessionTimeZoneOffset() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public int getStatementCacheSize() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public PreparedStatement getStatementWithKey(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public int getStmtCacheSize() { - // TODO Auto-generated method stub - return 0; - } - - public short getStructAttrCsId() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public TypeDescriptor[] getTypeDescriptorsFromList(String[][] arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public TypeDescriptor[] getTypeDescriptorsFromListInCurrentSchema(String[] arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public Properties getUnMatchedConnectionAttributes() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public String getUserName() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public boolean getUsingXAFlag() { - // TODO Auto-generated method stub - return false; - } - - public boolean getXAErrorFlag() { - // TODO Auto-generated method stub - return false; - } - - public boolean isLogicalConnection() { - // TODO Auto-generated method stub - return false; - } - - public boolean isProxySession() { - // TODO Auto-generated method stub - return false; - } - - public boolean isUsable() { - // TODO Auto-generated method stub - return false; - } - - public void openProxySession(int arg0, Properties arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void oracleReleaseSavepoint(OracleSavepoint arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void oracleRollback(OracleSavepoint arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public OracleSavepoint oracleSetSavepoint() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public OracleSavepoint oracleSetSavepoint(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public OracleConnection physicalConnectionWithin() { - // TODO Auto-generated method stub - return null; - } - - public int pingDatabase() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public int pingDatabase(int arg0) throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public CallableStatement prepareCallWithKey(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public PreparedStatement prepareStatementWithKey(String arg0) throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public void purgeExplicitCache() throws SQLException { - // TODO Auto-generated method stub - - } - - public void purgeImplicitCache() throws SQLException { - // TODO Auto-generated method stub - - } - - public void putDescriptor(String arg0, Object arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void registerConnectionCacheCallback(OracleConnectionCacheCallback arg0, Object arg1, int arg2) - throws SQLException { - // TODO Auto-generated method stub - - } - - public void registerSQLType(String arg0, Class arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void registerSQLType(String arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void registerTAFCallback(OracleOCIFailover arg0, Object arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setApplicationContext(String arg0, String arg1, String arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setAutoClose(boolean arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setConnectionReleasePriority(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setCreateStatementAsRefCursor(boolean arg0) { - // TODO Auto-generated method stub - - } - - public void setDefaultExecuteBatch(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setDefaultRowPrefetch(int defaultRowPrefetch) throws SQLException { - this.defaultRowPrefetch = defaultRowPrefetch; - } - - public void setDefaultTimeZone(TimeZone arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setEndToEndMetrics(String[] arg0, short arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setExplicitCachingEnabled(boolean arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setImplicitCachingEnabled(boolean arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setIncludeSynonyms(boolean arg0) { - // TODO Auto-generated method stub - - } - - public void setPlsqlWarnings(String arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setRemarksReporting(boolean arg0) { - // TODO Auto-generated method stub - - } - - public void setRestrictGetTables(boolean arg0) { - // TODO Auto-generated method stub - - } - - public void setSessionTimeZone(String arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setStatementCacheSize(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setStmtCacheSize(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setStmtCacheSize(int arg0, boolean arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setUsingXAFlag(boolean arg0) { - // TODO Auto-generated method stub - - } - - public void setWrapper(oracle.jdbc.OracleConnection arg0) { - // TODO Auto-generated method stub - - } - - public void setXAErrorFlag(boolean arg0) { - // TODO Auto-generated method stub - - } - - public void startup(String arg0, int arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void unregisterDatabaseChangeNotification(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - public void unregisterDatabaseChangeNotification(long arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void unregisterDatabaseChangeNotification(int arg0, String arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - public oracle.jdbc.OracleConnection unwrap() { - // TODO Auto-generated method stub - return null; - } - - public PreparedStatement prepareStatement(String sql) throws SQLException { - if (isClosed()) { - throw new MockConnectionClosedException(); - } - - return this.getDriver().createMockPreparedStatement(this, sql); - } - - @Override - public void shutdown(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } -} +/* + * Copyright 1999-2011 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.druid.test.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.sql.Array; +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.Date; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.EnumSet; +import java.util.Properties; +import java.util.TimeZone; + +import oracle.jdbc.OracleOCIFailover; +import oracle.jdbc.OracleSavepoint; +import oracle.jdbc.aq.AQDequeueOptions; +import oracle.jdbc.aq.AQEnqueueOptions; +import oracle.jdbc.aq.AQMessage; +import oracle.jdbc.aq.AQNotificationRegistration; +import oracle.jdbc.dcn.DatabaseChangeRegistration; +import oracle.jdbc.internal.OracleConnection; +import oracle.jdbc.pool.OracleConnectionCacheCallback; +import oracle.sql.ARRAY; +import oracle.sql.BINARY_DOUBLE; +import oracle.sql.BINARY_FLOAT; +import oracle.sql.DATE; +import oracle.sql.INTERVALDS; +import oracle.sql.INTERVALYM; +import oracle.sql.NUMBER; +import oracle.sql.TIMESTAMP; +import oracle.sql.TIMESTAMPLTZ; +import oracle.sql.TIMESTAMPTZ; +import oracle.sql.TypeDescriptor; + +import com.alibaba.druid.mock.MockConnection; +import com.alibaba.druid.mock.MockConnectionClosedException; +import com.alibaba.druid.mock.MockDriver; + +public class OracleMockConnection extends MockConnection implements oracle.jdbc.OracleConnection { + + private int defaultRowPrefetch = 10; + + public OracleMockConnection(){ + super(); + } + + public OracleMockConnection(MockDriver driver, String url, Properties connectProperties){ + super(driver, url, connectProperties); + + String val = (String) connectProperties.get("defaultRowPrefetch"); + if (val != null) { + defaultRowPrefetch = Integer.parseInt(val); + } + } + + public Connection _getPC() { + // TODO Auto-generated method stub + return null; + } + + public void abort() throws SQLException { + // TODO Auto-generated method stub + + } + + public void applyConnectionAttributes(Properties arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void archive(int arg0, int arg1, String arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + public void cancel() throws SQLException { + // TODO Auto-generated method stub + + } + + public void clearAllApplicationContext(String arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void close(Properties arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void close(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public ARRAY createARRAY(String arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public BINARY_DOUBLE createBINARY_DOUBLE(double arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public BINARY_FLOAT createBINARY_FLOAT(float arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(Date arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(Time arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(Timestamp arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(Date arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(Time arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public DATE createDATE(Timestamp arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public INTERVALDS createINTERVALDS(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public INTERVALYM createINTERVALYM(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + // TODO Auto-generated method stub + public NUMBER createNUMBER(boolean arg0) throws SQLException { + return null; + } + + public NUMBER createNUMBER(byte arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(short arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(long arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(float arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(double arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(BigDecimal arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(BigInteger arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public NUMBER createNUMBER(String arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public Array createOracleArray(String arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMP createTIMESTAMP(Date arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMP createTIMESTAMP(DATE arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMP createTIMESTAMP(Time arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMP createTIMESTAMP(Timestamp arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMP createTIMESTAMP(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPLTZ createTIMESTAMPLTZ(Date arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPLTZ createTIMESTAMPLTZ(Time arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPLTZ createTIMESTAMPLTZ(Timestamp arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPLTZ createTIMESTAMPLTZ(String arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPLTZ createTIMESTAMPLTZ(DATE arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(Date arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(Time arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(Timestamp arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(DATE arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(Date arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(Time arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(Timestamp arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TIMESTAMPTZ createTIMESTAMPTZ(String arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TypeDescriptor[] getAllTypeDescriptorsInCurrentSchema() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public String getAuthenticationAdaptorName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public boolean getAutoClose() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + public CallableStatement getCallWithKey(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public Properties getConnectionAttributes() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public int getConnectionReleasePriority() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public boolean getCreateStatementAsRefCursor() { + // TODO Auto-generated method stub + return false; + } + + public String getCurrentSchema() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public String getDataIntegrityAlgorithmName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public int getDefaultExecuteBatch() { + // TODO Auto-generated method stub + return 0; + } + + public int getDefaultRowPrefetch() { + return defaultRowPrefetch; + } + + public TimeZone getDefaultTimeZone() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public Object getDescriptor(String arg0) { + // TODO Auto-generated method stub + return null; + } + + public String getEncryptionAlgorithmName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public short getEndToEndECIDSequenceNumber() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public String[] getEndToEndMetrics() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public boolean getExplicitCachingEnabled() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + public boolean getImplicitCachingEnabled() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + public boolean getIncludeSynonyms() { + // TODO Auto-generated method stub + return false; + } + + public Object getJavaObject(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public Properties getProperties() { + // TODO Auto-generated method stub + return null; + } + + public boolean getRemarksReporting() { + // TODO Auto-generated method stub + return false; + } + + public boolean getRestrictGetTables() { + // TODO Auto-generated method stub + return false; + } + + public String getSQLType(Object arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public String getSessionTimeZone() { + // TODO Auto-generated method stub + return null; + } + + public String getSessionTimeZoneOffset() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public int getStatementCacheSize() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public PreparedStatement getStatementWithKey(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public int getStmtCacheSize() { + // TODO Auto-generated method stub + return 0; + } + + public short getStructAttrCsId() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public TypeDescriptor[] getTypeDescriptorsFromList(String[][] arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public TypeDescriptor[] getTypeDescriptorsFromListInCurrentSchema(String[] arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public Properties getUnMatchedConnectionAttributes() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public String getUserName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public boolean getUsingXAFlag() { + // TODO Auto-generated method stub + return false; + } + + public boolean getXAErrorFlag() { + // TODO Auto-generated method stub + return false; + } + + public boolean isLogicalConnection() { + // TODO Auto-generated method stub + return false; + } + + public boolean isProxySession() { + // TODO Auto-generated method stub + return false; + } + + public boolean isUsable() { + // TODO Auto-generated method stub + return false; + } + + public void openProxySession(int arg0, Properties arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void oracleReleaseSavepoint(OracleSavepoint arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void oracleRollback(OracleSavepoint arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public OracleSavepoint oracleSetSavepoint() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public OracleSavepoint oracleSetSavepoint(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public OracleConnection physicalConnectionWithin() { + // TODO Auto-generated method stub + return null; + } + + public int pingDatabase() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public int pingDatabase(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public CallableStatement prepareCallWithKey(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public PreparedStatement prepareStatementWithKey(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public void purgeExplicitCache() throws SQLException { + // TODO Auto-generated method stub + + } + + public void purgeImplicitCache() throws SQLException { + // TODO Auto-generated method stub + + } + + public void putDescriptor(String arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void registerConnectionCacheCallback(OracleConnectionCacheCallback arg0, Object arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + public void registerSQLType(String arg0, Class arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void registerSQLType(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void registerTAFCallback(OracleOCIFailover arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setApplicationContext(String arg0, String arg1, String arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setAutoClose(boolean arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setConnectionReleasePriority(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setCreateStatementAsRefCursor(boolean arg0) { + // TODO Auto-generated method stub + + } + + public void setDefaultExecuteBatch(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setDefaultRowPrefetch(int defaultRowPrefetch) throws SQLException { + this.defaultRowPrefetch = defaultRowPrefetch; + } + + public void setDefaultTimeZone(TimeZone arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setEndToEndMetrics(String[] arg0, short arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setExplicitCachingEnabled(boolean arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setImplicitCachingEnabled(boolean arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setIncludeSynonyms(boolean arg0) { + // TODO Auto-generated method stub + + } + + public void setPlsqlWarnings(String arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setRemarksReporting(boolean arg0) { + // TODO Auto-generated method stub + + } + + public void setRestrictGetTables(boolean arg0) { + // TODO Auto-generated method stub + + } + + public void setSessionTimeZone(String arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setStatementCacheSize(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setStmtCacheSize(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setStmtCacheSize(int arg0, boolean arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setUsingXAFlag(boolean arg0) { + // TODO Auto-generated method stub + + } + + public void setWrapper(oracle.jdbc.OracleConnection arg0) { + // TODO Auto-generated method stub + + } + + public void setXAErrorFlag(boolean arg0) { + // TODO Auto-generated method stub + + } + + public void startup(String arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void unregisterDatabaseChangeNotification(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + public void unregisterDatabaseChangeNotification(long arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void unregisterDatabaseChangeNotification(int arg0, String arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + public oracle.jdbc.OracleConnection unwrap() { + // TODO Auto-generated method stub + return null; + } + + public PreparedStatement prepareStatement(String sql) throws SQLException { + if (isClosed()) { + throw new MockConnectionClosedException(); + } + + return this.getDriver().createMockPreparedStatement(this, sql); + } + + public void shutdown(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void commit(EnumSet arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public AQMessage dequeue(String arg0, AQDequeueOptions arg1, byte[] arg2) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public AQMessage dequeue(String arg0, AQDequeueOptions arg1, String arg2) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void enqueue(String arg0, AQEnqueueOptions arg1, AQMessage arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public DatabaseChangeRegistration getDatabaseChangeRegistration(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public AQNotificationRegistration[] registerAQNotification(String[] arg0, Properties[] arg1, Properties arg2) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public DatabaseChangeRegistration registerDatabaseChangeNotification(Properties arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void shutdown(DatabaseShutdownMode arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void startup(DatabaseStartupMode arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void unregisterAQNotification(AQNotificationRegistration arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void unregisterDatabaseChangeNotification(DatabaseChangeRegistration arg0) throws SQLException { + // TODO Auto-generated method stub + + } +} diff --git a/src/test/java/com/alibaba/druid/test/util/OracleMockPreparedStatement.java b/src/test/java/com/alibaba/druid/test/util/OracleMockPreparedStatement.java index f13e1bbcd5..48b2c554cb 100644 --- a/src/test/java/com/alibaba/druid/test/util/OracleMockPreparedStatement.java +++ b/src/test/java/com/alibaba/druid/test/util/OracleMockPreparedStatement.java @@ -1,869 +1,1011 @@ -/* - * Copyright 1999-2011 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.druid.test.util; - -import java.io.InputStream; -import java.io.Reader; -import java.math.BigDecimal; -import java.net.URL; -import java.sql.Array; -import java.sql.Blob; -import java.sql.Clob; -import java.sql.Date; -import java.sql.Ref; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Time; -import java.sql.Timestamp; -import java.util.Calendar; - -import oracle.jdbc.OracleParameterMetaData; -import oracle.jdbc.OracleResultSetCache; -import oracle.sql.ARRAY; -import oracle.sql.BFILE; -import oracle.sql.BINARY_DOUBLE; -import oracle.sql.BINARY_FLOAT; -import oracle.sql.BLOB; -import oracle.sql.CHAR; -import oracle.sql.CLOB; -import oracle.sql.CustomDatum; -import oracle.sql.DATE; -import oracle.sql.Datum; -import oracle.sql.INTERVALDS; -import oracle.sql.INTERVALYM; -import oracle.sql.NUMBER; -import oracle.sql.OPAQUE; -import oracle.sql.ORAData; -import oracle.sql.RAW; -import oracle.sql.REF; -import oracle.sql.ROWID; -import oracle.sql.STRUCT; -import oracle.sql.StructDescriptor; -import oracle.sql.TIMESTAMP; -import oracle.sql.TIMESTAMPLTZ; -import oracle.sql.TIMESTAMPTZ; - -import com.alibaba.druid.mock.MockPreparedStatement; - -public class OracleMockPreparedStatement extends MockPreparedStatement implements oracle.jdbc.internal.OraclePreparedStatement { - - private int executeBatch = 50; - private int rowPrefetch; - - public OracleMockPreparedStatement(OracleMockConnection conn, String sql){ - super(conn, sql); - this.rowPrefetch = conn.getDefaultRowPrefetch(); - } - - @Override - public OracleParameterMetaData OracleGetParameterMetaData() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - @Override - public void defineParameterType(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineParameterTypeBytes(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineParameterTypeChars(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public int getExecuteBatch() { - return executeBatch; - } - - public ResultSet getReturnResultSet() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public void registerReturnParameter(int arg0, int arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void registerReturnParameter(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - public void registerReturnParameter(int arg0, int arg1, String arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public int sendBatch() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setARRAY(int arg0, ARRAY arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setARRAYAtName(String arg0, ARRAY arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setArrayAtName(String arg0, Array arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setAsciiStreamAtName(String arg0, InputStream arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBFILE(int arg0, BFILE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBFILEAtName(String arg0, BFILE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBLOB(int arg0, BLOB arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBLOBAtName(String arg0, BLOB arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBfile(int arg0, BFILE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBfileAtName(String arg0, BFILE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBigDecimalAtName(String arg0, BigDecimal arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryDouble(int arg0, double arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryDouble(int arg0, BINARY_DOUBLE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryDoubleAtName(String arg0, double arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryDoubleAtName(String arg0, BINARY_DOUBLE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryFloat(int arg0, float arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryFloat(int arg0, BINARY_FLOAT arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryFloatAtName(String arg0, float arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryFloatAtName(String arg0, BINARY_FLOAT arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBinaryStreamAtName(String arg0, InputStream arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBlobAtName(String arg0, Blob arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBooleanAtName(String arg0, boolean arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setByteAtName(String arg0, byte arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setBytesAtName(String arg0, byte[] arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setBytesForBlob(int arg0, byte[] arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setBytesForBlobAtName(String arg0, byte[] arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCHAR(int arg0, CHAR arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCHARAtName(String arg0, CHAR arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCLOB(int arg0, CLOB arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCLOBAtName(String arg0, CLOB arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setClobAtName(String arg0, Clob arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCursor(int arg0, ResultSet arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCursorAtName(String arg0, ResultSet arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCustomDatum(int arg0, CustomDatum arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCustomDatumAtName(String arg0, CustomDatum arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setDATE(int arg0, DATE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setDATEAtName(String arg0, DATE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setDateAtName(String arg0, Date arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setDisableStmtCaching(boolean arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void setDoubleAtName(String arg0, double arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setExecuteBatch(int executeBatch) throws SQLException { - this.executeBatch = executeBatch; - } - - @Override - public void setFixedCHAR(int arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setFixedCHARAtName(String arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setFloatAtName(String arg0, float arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setFormOfUse(int arg0, short arg1) { - // TODO Auto-generated method stub - - } - - @Override - public void setINTERVALDS(int arg0, INTERVALDS arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setINTERVALDSAtName(String arg0, INTERVALDS arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setINTERVALYM(int arg0, INTERVALYM arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setINTERVALYMAtName(String arg0, INTERVALYM arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setIntAtName(String arg0, int arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setLongAtName(String arg0, long arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setNUMBER(int arg0, NUMBER arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setNUMBERAtName(String arg0, NUMBER arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setNullAtName(String arg0, int arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setNullAtName(String arg0, int arg1, String arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setOPAQUE(int arg0, OPAQUE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setOPAQUEAtName(String arg0, OPAQUE arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setORAData(int arg0, ORAData arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setORADataAtName(String arg0, ORAData arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setObjectAtName(String arg0, Object arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setObjectAtName(String arg0, Object arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setObjectAtName(String arg0, Object arg1, int arg2, int arg3) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setOracleObject(int arg0, Datum arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setOracleObjectAtName(String arg0, Datum arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setPlsqlIndexTable(int arg0, Object arg1, int arg2, int arg3, int arg4, int arg5) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setRAW(int arg0, RAW arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setRAWAtName(String arg0, RAW arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setREF(int arg0, REF arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setREFAtName(String arg0, REF arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setROWID(int arg0, ROWID arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setROWIDAtName(String arg0, ROWID arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setRefAtName(String arg0, Ref arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setRefType(int arg0, REF arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setRefTypeAtName(String arg0, REF arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setSTRUCT(int arg0, STRUCT arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setSTRUCTAtName(String arg0, STRUCT arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setShortAtName(String arg0, short arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setStringAtName(String arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setStringForClob(int arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setStringForClobAtName(String arg0, String arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setStructDescriptor(int arg0, StructDescriptor arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setStructDescriptorAtName(String arg0, StructDescriptor arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTIMESTAMP(int arg0, TIMESTAMP arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTIMESTAMPAtName(String arg0, TIMESTAMP arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTIMESTAMPLTZ(int arg0, TIMESTAMPLTZ arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTIMESTAMPLTZAtName(String arg0, TIMESTAMPLTZ arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTIMESTAMPTZ(int arg0, TIMESTAMPTZ arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTIMESTAMPTZAtName(String arg0, TIMESTAMPTZ arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTimeAtName(String arg0, Time arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setTimestampAtName(String arg0, Timestamp arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - public void setTimestampAtName(String arg0, Timestamp arg1, Calendar arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setURLAtName(String arg0, URL arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setUnicodeStreamAtName(String arg0, InputStream arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void clearDefines() throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void closeWithKey(String arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public int creationState() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void defineColumnType(int arg0, int arg1) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineColumnType(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineColumnType(int arg0, int arg1, String arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineColumnType(int arg0, int arg1, int arg2, short arg3) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineColumnTypeBytes(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void defineColumnTypeChars(int arg0, int arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - public int getLobPrefetchSize() { - // TODO Auto-generated method stub - return 0; - } - - public long getRegisteredQueryId() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - public String[] getRegisteredTableNames() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getRowPrefetch() { - return rowPrefetch; - } - - @Override - public boolean isNCHAR(int arg0) throws SQLException { - // TODO Auto-generated method stub - return false; - } - - public void setLobPrefetchSize(int arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setResultSetCache(OracleResultSetCache arg0) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setRowPrefetch(int rowPrefetch) throws SQLException { - this.rowPrefetch = rowPrefetch; - } - - public long getChecksum() throws SQLException { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean getFixedString() { - // TODO Auto-generated method stub - return false; - } - - @Override - public int getcacheState() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean getserverCursor() { - // TODO Auto-generated method stub - return false; - } - - @Override - public int getstatementType() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setFixedString(boolean arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void enterExplicitCache() throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void enterImplicitCache() throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void exitExplicitCacheToActive() throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void exitExplicitCacheToClose() throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void exitImplicitCacheToActive() throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void exitImplicitCacheToClose() throws SQLException { - // TODO Auto-generated method stub - - } - - public String getOriginalSql() throws SQLException { - // TODO Auto-generated method stub - return null; - } - - public void setCharacterStreamAtName(String arg0, Reader arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - - @Override - public void setCheckBindTypes(boolean arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void setInternalBytes(int arg0, byte[] arg1, int arg2) throws SQLException { - // TODO Auto-generated method stub - - } - -} +/* + * Copyright 1999-2011 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.druid.test.util; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLXML; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; + +import oracle.jdbc.OracleParameterMetaData; +import oracle.jdbc.OracleResultSetCache; +import oracle.jdbc.dcn.DatabaseChangeRegistration; +import oracle.sql.ARRAY; +import oracle.sql.BFILE; +import oracle.sql.BINARY_DOUBLE; +import oracle.sql.BINARY_FLOAT; +import oracle.sql.BLOB; +import oracle.sql.CHAR; +import oracle.sql.CLOB; +import oracle.sql.CustomDatum; +import oracle.sql.DATE; +import oracle.sql.Datum; +import oracle.sql.INTERVALDS; +import oracle.sql.INTERVALYM; +import oracle.sql.NUMBER; +import oracle.sql.OPAQUE; +import oracle.sql.ORAData; +import oracle.sql.RAW; +import oracle.sql.REF; +import oracle.sql.ROWID; +import oracle.sql.STRUCT; +import oracle.sql.StructDescriptor; +import oracle.sql.TIMESTAMP; +import oracle.sql.TIMESTAMPLTZ; +import oracle.sql.TIMESTAMPTZ; + +import com.alibaba.druid.mock.MockPreparedStatement; + +public class OracleMockPreparedStatement extends MockPreparedStatement implements oracle.jdbc.internal.OraclePreparedStatement { + + private int executeBatch = 50; + private int rowPrefetch; + + public OracleMockPreparedStatement(OracleMockConnection conn, String sql){ + super(conn, sql); + this.rowPrefetch = conn.getDefaultRowPrefetch(); + } + + @Override + public OracleParameterMetaData OracleGetParameterMetaData() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void defineParameterType(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineParameterTypeBytes(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineParameterTypeChars(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public int getExecuteBatch() { + return executeBatch; + } + + public ResultSet getReturnResultSet() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public void registerReturnParameter(int arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void registerReturnParameter(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + public void registerReturnParameter(int arg0, int arg1, String arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public int sendBatch() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setARRAY(int arg0, ARRAY arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setARRAYAtName(String arg0, ARRAY arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setArrayAtName(String arg0, Array arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setAsciiStreamAtName(String arg0, InputStream arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBFILE(int arg0, BFILE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBFILEAtName(String arg0, BFILE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBLOB(int arg0, BLOB arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBLOBAtName(String arg0, BLOB arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBfile(int arg0, BFILE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBfileAtName(String arg0, BFILE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBigDecimalAtName(String arg0, BigDecimal arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryDouble(int arg0, double arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryDouble(int arg0, BINARY_DOUBLE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryDoubleAtName(String arg0, double arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryDoubleAtName(String arg0, BINARY_DOUBLE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryFloat(int arg0, float arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryFloat(int arg0, BINARY_FLOAT arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryFloatAtName(String arg0, float arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryFloatAtName(String arg0, BINARY_FLOAT arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryStreamAtName(String arg0, InputStream arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBlobAtName(String arg0, Blob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBooleanAtName(String arg0, boolean arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setByteAtName(String arg0, byte arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBytesAtName(String arg0, byte[] arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setBytesForBlob(int arg0, byte[] arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setBytesForBlobAtName(String arg0, byte[] arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCHAR(int arg0, CHAR arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCHARAtName(String arg0, CHAR arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCLOB(int arg0, CLOB arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCLOBAtName(String arg0, CLOB arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setClobAtName(String arg0, Clob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCursor(int arg0, ResultSet arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCursorAtName(String arg0, ResultSet arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCustomDatum(int arg0, CustomDatum arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCustomDatumAtName(String arg0, CustomDatum arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setDATE(int arg0, DATE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setDATEAtName(String arg0, DATE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setDateAtName(String arg0, Date arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setDisableStmtCaching(boolean arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void setDoubleAtName(String arg0, double arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setExecuteBatch(int executeBatch) throws SQLException { + this.executeBatch = executeBatch; + } + + @Override + public void setFixedCHAR(int arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setFixedCHARAtName(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setFloatAtName(String arg0, float arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setFormOfUse(int arg0, short arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void setINTERVALDS(int arg0, INTERVALDS arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setINTERVALDSAtName(String arg0, INTERVALDS arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setINTERVALYM(int arg0, INTERVALYM arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setINTERVALYMAtName(String arg0, INTERVALYM arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setIntAtName(String arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setLongAtName(String arg0, long arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNUMBER(int arg0, NUMBER arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNUMBERAtName(String arg0, NUMBER arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNullAtName(String arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNullAtName(String arg0, int arg1, String arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setOPAQUE(int arg0, OPAQUE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setOPAQUEAtName(String arg0, OPAQUE arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setORAData(int arg0, ORAData arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setORADataAtName(String arg0, ORAData arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setObjectAtName(String arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setObjectAtName(String arg0, Object arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setObjectAtName(String arg0, Object arg1, int arg2, int arg3) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setOracleObject(int arg0, Datum arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setOracleObjectAtName(String arg0, Datum arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setPlsqlIndexTable(int arg0, Object arg1, int arg2, int arg3, int arg4, int arg5) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRAW(int arg0, RAW arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRAWAtName(String arg0, RAW arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setREF(int arg0, REF arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setREFAtName(String arg0, REF arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setROWID(int arg0, ROWID arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setROWIDAtName(String arg0, ROWID arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRefAtName(String arg0, Ref arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRefType(int arg0, REF arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRefTypeAtName(String arg0, REF arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setSTRUCT(int arg0, STRUCT arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setSTRUCTAtName(String arg0, STRUCT arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setShortAtName(String arg0, short arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setStringAtName(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setStringForClob(int arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setStringForClobAtName(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setStructDescriptor(int arg0, StructDescriptor arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setStructDescriptorAtName(String arg0, StructDescriptor arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTIMESTAMP(int arg0, TIMESTAMP arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTIMESTAMPAtName(String arg0, TIMESTAMP arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTIMESTAMPLTZ(int arg0, TIMESTAMPLTZ arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTIMESTAMPLTZAtName(String arg0, TIMESTAMPLTZ arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTIMESTAMPTZ(int arg0, TIMESTAMPTZ arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTIMESTAMPTZAtName(String arg0, TIMESTAMPTZ arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTimeAtName(String arg0, Time arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTimestampAtName(String arg0, Timestamp arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + public void setTimestampAtName(String arg0, Timestamp arg1, Calendar arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setURLAtName(String arg0, URL arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setUnicodeStreamAtName(String arg0, InputStream arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void clearDefines() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void closeWithKey(String arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public int creationState() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void defineColumnType(int arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineColumnType(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineColumnType(int arg0, int arg1, String arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineColumnType(int arg0, int arg1, int arg2, short arg3) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineColumnTypeBytes(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void defineColumnTypeChars(int arg0, int arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + public int getLobPrefetchSize() { + // TODO Auto-generated method stub + return 0; + } + + public long getRegisteredQueryId() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + public String[] getRegisteredTableNames() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getRowPrefetch() { + return rowPrefetch; + } + + @Override + public boolean isNCHAR(int arg0) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + public void setLobPrefetchSize(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setResultSetCache(OracleResultSetCache arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRowPrefetch(int rowPrefetch) throws SQLException { + this.rowPrefetch = rowPrefetch; + } + + public long getChecksum() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public boolean getFixedString() { + // TODO Auto-generated method stub + return false; + } + + @Override + public int getcacheState() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public boolean getserverCursor() { + // TODO Auto-generated method stub + return false; + } + + @Override + public int getstatementType() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setFixedString(boolean arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void enterExplicitCache() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void enterImplicitCache() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void exitExplicitCacheToActive() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void exitExplicitCacheToClose() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void exitImplicitCacheToActive() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void exitImplicitCacheToClose() throws SQLException { + // TODO Auto-generated method stub + + } + + public String getOriginalSql() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + public void setCharacterStreamAtName(String arg0, Reader arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCheckBindTypes(boolean arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void setInternalBytes(int arg0, byte[] arg1, int arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setAsciiStreamAtName(String arg0, InputStream arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setAsciiStreamAtName(String arg0, InputStream arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryStreamAtName(String arg0, InputStream arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBinaryStreamAtName(String arg0, InputStream arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBlobAtName(String arg0, InputStream arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setBlobAtName(String arg0, InputStream arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCharacterStreamAtName(String arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCharacterStreamAtName(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setClobAtName(String arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setClobAtName(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setDateAtName(String arg0, Date arg1, Calendar arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNCharacterStreamAtName(String arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNCharacterStreamAtName(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNClobAtName(String arg0, NClob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNClobAtName(String arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNClobAtName(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNStringAtName(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setRowIdAtName(String arg0, RowId arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setSQLXMLAtName(String arg0, SQLXML arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTimeAtName(String arg0, Time arg1, Calendar arg2) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setDatabaseChangeRegistration(DatabaseChangeRegistration arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public SqlKind getSqlKind() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setSnapshotSCN(long arg0) throws SQLException { + // TODO Auto-generated method stub + + } + +} diff --git a/src/test/java/com/alibaba/druid/test/util/OracleMockResultSet.java b/src/test/java/com/alibaba/druid/test/util/OracleMockResultSet.java index f78668b9bc..9dca5dbd9b 100644 --- a/src/test/java/com/alibaba/druid/test/util/OracleMockResultSet.java +++ b/src/test/java/com/alibaba/druid/test/util/OracleMockResultSet.java @@ -511,4 +511,46 @@ public class OracleMockResultSet extends MockResultSet implements OracleResultSe } + @Override + public AuthorizationIndicator getAuthorizationIndicator(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public AuthorizationIndicator getAuthorizationIndicator(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void updateINTERVALDS(String arg0, INTERVALDS arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateINTERVALYM(String arg0, INTERVALYM arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTIMESTAMP(String arg0, TIMESTAMP arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTIMESTAMPLTZ(String arg0, TIMESTAMPLTZ arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTIMESTAMPTZ(String arg0, TIMESTAMPTZ arg1) throws SQLException { + // TODO Auto-generated method stub + + } + }