mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
oracle optimize
This commit is contained in:
@@ -50,6 +50,10 @@ public class ResultSetProxyImpl extends WrapperProxyImpl implements ResultSetPro
|
||||
private final StatementProxy statement;
|
||||
private final String sql;
|
||||
|
||||
protected int cursorIndex = 0;
|
||||
protected int fetchRowCount = 0;
|
||||
protected long constructNano;
|
||||
|
||||
public ResultSetProxyImpl(StatementProxy statement, ResultSet resultSet, long id, String sql){
|
||||
super(resultSet, id);
|
||||
this.statement = statement;
|
||||
@@ -57,6 +61,22 @@ public class ResultSetProxyImpl extends WrapperProxyImpl implements ResultSetPro
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public long getConstructNano() {
|
||||
return constructNano;
|
||||
}
|
||||
|
||||
public void setConstructNano(long constructNano) {
|
||||
this.constructNano = constructNano;
|
||||
}
|
||||
|
||||
public int getCursorIndex() {
|
||||
return cursorIndex;
|
||||
}
|
||||
|
||||
public int getFetchRowCount() {
|
||||
return fetchRowCount;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
@@ -545,12 +565,26 @@ public class ResultSetProxyImpl extends WrapperProxyImpl implements ResultSetPro
|
||||
|
||||
@Override
|
||||
public boolean next() throws SQLException {
|
||||
return createChain().resultSet_next(this);
|
||||
boolean moreRows = createChain().resultSet_next(this);
|
||||
|
||||
if (moreRows) {
|
||||
cursorIndex++;
|
||||
if (cursorIndex > fetchRowCount) {
|
||||
fetchRowCount = cursorIndex;
|
||||
}
|
||||
}
|
||||
return moreRows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean previous() throws SQLException {
|
||||
return createChain().resultSet_previous(this);
|
||||
boolean moreRows = createChain().resultSet_previous(this);
|
||||
|
||||
if (moreRows) {
|
||||
cursorIndex--;
|
||||
}
|
||||
|
||||
return moreRows;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user