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.