oracle optimize

This commit is contained in:
wenshao
2011-12-30 07:26:54 +08:00
parent 1352771e3f
commit 4d59388633
9 changed files with 123 additions and 113 deletions
@@ -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