use of oracle.jdbc.OracleConnection in project druid by alibaba.
the class OracleUtils method setImplicitCachingEnabled.
public static void setImplicitCachingEnabled(Connection conn, boolean cache) throws SQLException {
OracleConnection oracleConn = unwrap(conn);
oracleConn.setImplicitCachingEnabled(cache);
}
use of oracle.jdbc.OracleConnection in project druid by alibaba.
the class OracleUtils method purgeImplicitCache.
public static void purgeImplicitCache(Connection conn) throws SQLException {
OracleConnection oracleConn = unwrap(conn);
oracleConn.purgeImplicitCache();
}
use of oracle.jdbc.OracleConnection in project druid by alibaba.
the class OracleUtils method setDefaultRowPrefetch.
public static void setDefaultRowPrefetch(Connection conn, int value) throws SQLException {
OracleConnection oracleConn = unwrap(conn);
oracleConn.setDefaultRowPrefetch(value);
}
use of oracle.jdbc.OracleConnection in project druid by alibaba.
the class TestOraclePing method test_o.
public void test_o() throws Exception {
Class.forName(driverClass);
Connection conn = DriverManager.getConnection(jdbcUrl, user, password);
OracleConnection oracleConn = (OracleConnection) conn;
for (int i = 0; i < 10; ++i) {
ping_1000(oracleConn);
select_1000(oracleConn);
}
conn.close();
}
use of oracle.jdbc.OracleConnection in project druid by alibaba.
the class TestOraclePreparedStatement method test_0.
public void test_0() throws Exception {
Connection conn = DriverManager.getConnection(jdbcUrl, user, password);
OracleConnection oracleConn = (OracleConnection) conn;
// ResultSet metaRs = conn.getMetaData().getTables(null, "ALIBABA", null, new String[] {"TABLE"});
// JdbcUtils.printResultSet(metaRs);
// metaRs.close();
int fetchRowSize = oracleConn.getDefaultRowPrefetch();
// {
// oracleConn.setStatementCacheSize(10);
// oracleConn.setImplicitCachingEnabled(true);
//
// PreparedStatement stmt = conn.prepareStatement(SQL);
// stmt.close();
//
// PreparedStatement stmt2 = conn.prepareStatement(SQL);
// stmt2.close();
// }
OraclePreparedStatement oracleStmt = null;
PreparedStatement stmt = conn.prepareStatement(SQL);
oracleStmt = (OraclePreparedStatement) stmt;
oracleStmt.setRowPrefetch(10);
{
stmt.setInt(1, 327);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
}
rs.close();
//oracleStmt.clearDefines();
}
for (int i = 0; i < 10; ++i) {
OracleUtils.enterImplicitCache(oracleStmt);
OracleUtils.exitImplicitCacheToActive(oracleStmt);
stmt.setInt(1, 327);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
}
rs.close();
}
oracleStmt.setRowPrefetch(1000);
{
stmt.setInt(1, 11);
ResultSet rs = stmt.executeQuery();
rs.next();
rs.close();
stmt.close();
}
conn.close();
}
Aggregations