Skip to content

Commit

Permalink
Merge pull request alibaba#496 from cutedemons/master
Browse files Browse the repository at this point in the history
resultset proxy
  • Loading branch information
cutedemons committed Jan 14, 2014
2 parents 48b158b + 1476e8f commit 31b90b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 11 additions & 1 deletion src/main/java/com/alibaba/druid/filter/FilterChainImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import com.alibaba.druid.proxy.jdbc.NClobProxyImpl;
import com.alibaba.druid.proxy.jdbc.PreparedStatementProxy;
import com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl;
import com.alibaba.druid.proxy.jdbc.ResultSetMetaDataProxy;
import com.alibaba.druid.proxy.jdbc.ResultSetMetaDataProxyImpl;
import com.alibaba.druid.proxy.jdbc.ResultSetProxy;
import com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl;
import com.alibaba.druid.proxy.jdbc.StatementProxy;
Expand Down Expand Up @@ -965,7 +967,7 @@ public ResultSetMetaData resultSet_getMetaData(ResultSetProxy resultSet) throws
if (this.pos < filterSize) {
return nextFilter().resultSet_getMetaData(this, resultSet);
}
return resultSet.getResultSetRaw().getMetaData();
return wrap(resultSet.getResultSetRaw().getMetaData(), resultSet);
}

@Override
Expand Down Expand Up @@ -4474,6 +4476,14 @@ public ResultSetProxy wrap(StatementProxy statement, ResultSet resultSet) {
statement.getLastExecuteSql());
}

public ResultSetMetaDataProxy wrap(ResultSetMetaData metaData, ResultSetProxy resultSet) {
if (metaData == null) {
return null;
}

return new ResultSetMetaDataProxyImpl(metaData, dataSource.createMetaDataId(), resultSet);
}

public ClobProxy wrap(ConnectionProxy conn, Clob clob) {
if (clob == null) {
return null;
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/com/alibaba/druid/wall/WallFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.alibaba.druid.proxy.jdbc.ConnectionProxy;
import com.alibaba.druid.proxy.jdbc.DataSourceProxy;
import com.alibaba.druid.proxy.jdbc.PreparedStatementProxy;
import com.alibaba.druid.proxy.jdbc.ResultSetMetaDataProxyImpl;
import com.alibaba.druid.proxy.jdbc.ResultSetProxy;
import com.alibaba.druid.proxy.jdbc.StatementProxy;
import com.alibaba.druid.support.logging.Log;
Expand Down Expand Up @@ -780,16 +779,6 @@ public boolean resultSet_next(FilterChain chain, ResultSetProxy resultSet) throw
return hasNext;
}

@Override
public ResultSetMetaData resultSet_getMetaData(FilterChain chain, ResultSetProxy resultSet) throws SQLException {
ResultSetMetaData metaData = chain.resultSet_getMetaData(resultSet);
if (metaData == null) {
return null;
}

return new ResultSetMetaDataProxyImpl(metaData, chain.getDataSource().createMetaDataId(), resultSet);
}

public long getViolationCount() {
return this.provider.getViolationCount();
}
Expand Down

0 comments on commit 31b90b8

Please sign in to comment.