This is an automated email from the ASF dual-hosted git repository.
sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 2aba1e72206 Refactor AbstractUnsupportedOperationResultSet (#31889)
2aba1e72206 is described below
commit 2aba1e72206759430a1f438a7d1f3a9bf48536b1
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Jun 27 13:07:40 2024 +0800
Refactor AbstractUnsupportedOperationResultSet (#31889)
* Remove useless static on ShardingSphereSQLParserEngine
* Refactor SQLRewriteEntryTest
* Refactor AbstractUnsupportedOperationResultSet
---
.../driver/jdbc/core/resultset/ShardingSphereResultSet.java | 11 -----------
.../AbstractUnsupportedDatabaseMetaDataResultSet.java | 11 -----------
.../AbstractUnsupportedGeneratedKeysResultSet.java | 11 -----------
.../unsupported/AbstractUnsupportedOperationResultSet.java | 11 +++++++++++
.../state/circuit/resultset/CircuitBreakerResultSet.java | 11 -----------
5 files changed, 11 insertions(+), 44 deletions(-)
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSet.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSet.java
index 13044aa1f0b..903b39f4fba 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSet.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSet.java
@@ -34,7 +34,6 @@ import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
-import java.sql.NClob;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
@@ -331,16 +330,6 @@ public final class ShardingSphereResultSet extends
AbstractResultSetAdapter {
return getClob(getIndexFromColumnLabelAndIndexMap(columnLabel));
}
- @Override
- public NClob getNClob(final int columnIndex) throws SQLException {
- return (NClob) mergeResultSet.getValue(columnIndex, NClob.class);
- }
-
- @Override
- public NClob getNClob(final String columnLabel) throws SQLException {
- return getNClob(getIndexFromColumnLabelAndIndexMap(columnLabel));
- }
-
@Override
public Array getArray(final int columnIndex) throws SQLException {
return (Array) mergeResultSet.getValue(columnIndex, Array.class);
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java
index 7fa617069e6..b70fc73ff7d 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java
@@ -23,7 +23,6 @@ import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
-import java.sql.NClob;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
@@ -117,16 +116,6 @@ public abstract class
AbstractUnsupportedDatabaseMetaDataResultSet extends Abstr
throw new SQLFeatureNotSupportedException("getClob");
}
- @Override
- public final NClob getNClob(final int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException("getNClob");
- }
-
- @Override
- public final NClob getNClob(final String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException("getNClob");
- }
-
@Override
public final Date getDate(final int columnIndex, final Calendar cal)
throws SQLException {
throw new SQLFeatureNotSupportedException("getDate(int columnIndex,
Calendar cal)");
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java
index 8125795b08d..ee4efe7d16b 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java
@@ -24,7 +24,6 @@ import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
-import java.sql.NClob;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
@@ -208,16 +207,6 @@ public abstract class
AbstractUnsupportedGeneratedKeysResultSet extends Abstract
throw new SQLFeatureNotSupportedException("getClob");
}
- @Override
- public final NClob getNClob(final int columnIndex) throws SQLException {
- throw new SQLFeatureNotSupportedException("getNClob");
- }
-
- @Override
- public final NClob getNClob(final String columnLabel) throws SQLException {
- throw new SQLFeatureNotSupportedException("getNClob");
- }
-
@Override
public final URL getURL(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException("getURL");
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java
index a84b6f8b009..06cb2b075f0 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.driver.jdbc.unsupported;
import java.io.Reader;
+import java.sql.NClob;
import java.sql.Ref;
import java.sql.RowId;
import java.sql.SQLException;
@@ -149,6 +150,16 @@ public abstract class
AbstractUnsupportedOperationResultSet extends AbstractUnsu
throw new SQLFeatureNotSupportedException("getHoldability");
}
+ @Override
+ public final NClob getNClob(final int columnIndex) throws SQLException {
+ throw new SQLFeatureNotSupportedException("getNClob");
+ }
+
+ @Override
+ public final NClob getNClob(final String columnLabel) throws SQLException {
+ throw new SQLFeatureNotSupportedException("getNClob");
+ }
+
@Override
public final Reader getNCharacterStream(final int columnIndex) throws
SQLException {
throw new SQLFeatureNotSupportedException("getNCharacterStream");
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/resultset/CircuitBreakerResultSet.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/resultset/CircuitBreakerResultSet.java
index 71fa245a39f..679d6500103 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/resultset/CircuitBreakerResultSet.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/resultset/CircuitBreakerResultSet.java
@@ -27,7 +27,6 @@ import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
-import java.sql.NClob;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLWarning;
@@ -369,16 +368,6 @@ public final class CircuitBreakerResultSet extends
AbstractUnsupportedOperationR
return null;
}
- @Override
- public NClob getNClob(final int columnIndex) {
- return null;
- }
-
- @Override
- public NClob getNClob(final String columnLabel) {
- return null;
- }
-
@Override
public URL getURL(final int columnIndex) {
return null;