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:
@@ -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