From 838ed45a5469d91f3667c70464c52f253b48064b Mon Sep 17 00:00:00 2001 From: Tadaya Tsuyukubo Date: Fri, 11 Oct 2024 22:38:07 -0700 Subject: [PATCH] Polish "RowSetFactory is costly to build and is built very often" --- .../proxy/CachedRowSetResultSetProxyLogicFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/ttddyy/dsproxy/proxy/CachedRowSetResultSetProxyLogicFactory.java b/src/main/java/net/ttddyy/dsproxy/proxy/CachedRowSetResultSetProxyLogicFactory.java index 1ad8a06b..367f2d8a 100644 --- a/src/main/java/net/ttddyy/dsproxy/proxy/CachedRowSetResultSetProxyLogicFactory.java +++ b/src/main/java/net/ttddyy/dsproxy/proxy/CachedRowSetResultSetProxyLogicFactory.java @@ -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); } } @@ -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 {