Skip to content

Commit

Permalink
Polish "RowSetFactory is costly to build and is built very often"
Browse files Browse the repository at this point in the history
  • Loading branch information
ttddyy committed Oct 12, 2024
1 parent 681f0cb commit 838ed45
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public class CachedRowSetResultSetProxyLogicFactory implements ResultSetProxyLog

public CachedRowSetResultSetProxyLogicFactory() {
try {
this.rowSetFactory = RowSetProvider.newFactory();
} catch (SQLException e) {
throw new RuntimeException(e);
this.rowSetFactory = RowSetProvider.newFactory();
} catch (SQLException ex) {
throw new RuntimeException(ex);
}
}

Expand All @@ -50,7 +50,7 @@ protected ResultSet getCachedRowSet(ResultSet resultSet) {
try {
// CachedRowSet only works with non-null ResultSet
if (resultSet.getMetaData().getColumnCount() > 0) {
CachedRowSet cachedRowSet = rowSetFactory.createCachedRowSet();
CachedRowSet cachedRowSet = this.rowSetFactory.createCachedRowSet();
cachedRowSet.populate(resultSet);
return cachedRowSet;
} else {
Expand Down

0 comments on commit 838ed45

Please sign in to comment.