mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support spring 2.0
This commit is contained in:
@@ -643,7 +643,7 @@ public class StatFilter extends FilterEventAdapter implements StatFilterMBean {
|
||||
return dataSource.getUrl();
|
||||
}
|
||||
|
||||
public final JdbcSqlStat createSqlStat(StatementProxy statement, String sql) {
|
||||
public JdbcSqlStat createSqlStat(StatementProxy statement, String sql) {
|
||||
final ConcurrentMap<String, JdbcSqlStat> sqlStatMap = dataSourceStat.getSqlStatMap();
|
||||
JdbcSqlStat sqlStat = sqlStatMap.get(sql);
|
||||
if (sqlStat == null) {
|
||||
|
||||
@@ -218,6 +218,9 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
}
|
||||
|
||||
public void setOracle(boolean isOracle) {
|
||||
if (inited) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
this.isOracle = isOracle;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,33 @@
|
||||
package com.alibaba.druid.support.spring;
|
||||
|
||||
import org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class DruidNativeJdbcExtractor extends Jdbc4NativeJdbcExtractor {
|
||||
import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter;
|
||||
|
||||
public class DruidNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
|
||||
|
||||
protected Connection doGetNativeConnection(Connection con) throws SQLException {
|
||||
return (Connection) con.unwrap(Connection.class);
|
||||
}
|
||||
|
||||
public Statement getNativeStatement(Statement stmt) throws SQLException {
|
||||
return (Statement) stmt.unwrap(Statement.class);
|
||||
}
|
||||
|
||||
public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException {
|
||||
return (PreparedStatement) ps.unwrap(PreparedStatement.class);
|
||||
}
|
||||
|
||||
public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException {
|
||||
return (CallableStatement) cs.unwrap(CallableStatement.class);
|
||||
}
|
||||
|
||||
public ResultSet getNativeResultSet(ResultSet rs) throws SQLException {
|
||||
return (ResultSet) rs.unwrap(ResultSet.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user