support spring 2.0

This commit is contained in:
wenshao
2012-01-05 10:39:28 +08:00
parent 54bc95671b
commit 00f0168dc0
6 changed files with 54 additions and 116 deletions
@@ -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);
}
}