diff --git itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java index 13aa39b..ae128a9 100644 --- itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java +++ itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java @@ -868,7 +868,7 @@ private void doTestSelectAll(String tableName, int maxRows, int fetchSize) throw assertNotNull("ResultSet is null", res); assertTrue("getResultSet() not returning expected ResultSet", res == stmt .getResultSet()); - assertEquals("get update count not as expected", 0, stmt.getUpdateCount()); + assertEquals("get update count not as expected", -1, stmt.getUpdateCount()); int i = 0; ResultSetMetaData meta = res.getMetaData(); diff --git jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java index 0e04ced..2cbf58c 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java @@ -21,6 +21,7 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.util.HashMap; import java.util.Map; @@ -435,7 +436,7 @@ public int getFetchSize() throws SQLException { @Override public ResultSet getGeneratedKeys() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLFeatureNotSupportedException("Method not supported"); } /* @@ -469,7 +470,7 @@ public int getMaxRows() throws SQLException { @Override public boolean getMoreResults() throws SQLException { - throw new SQLException("Method not supported"); + return false; } /* @@ -480,7 +481,7 @@ public boolean getMoreResults() throws SQLException { @Override public boolean getMoreResults(int current) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLFeatureNotSupportedException("Method not supported"); } /* @@ -550,7 +551,7 @@ public int getResultSetType() throws SQLException { @Override public int getUpdateCount() throws SQLException { checkConnection("getUpdateCount"); - return 0; + return -1; } /* @@ -600,7 +601,7 @@ public boolean isPoolable() throws SQLException { @Override public void setCursorName(String name) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLFeatureNotSupportedException("Method not supported"); } /* @@ -611,7 +612,9 @@ public void setCursorName(String name) throws SQLException { @Override public void setEscapeProcessing(boolean enable) throws SQLException { - throw new SQLException("Method not supported"); + if (enable) { + throw new SQLException("Method not supported"); + } } /*