Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-585

Avatica JDBC methods should throw SQLFeatureNotSupportedException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      The unsupported JDBC method are throwing UnsupportedOperationException.

      This cause calcite jdbc client program fail to catch the exception and goes to unhandled exception routine.

      For example
      AvaticaStatement.java
      public boolean getMoreResults() throws SQLException

      { throw new UnsupportedOperationException(); }

      The expected exception for this is SQLFeatureNotSupportedException (a subclass of SQLException).

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.3.0-incubating (2015-05-30).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.3.0-incubating (2015-05-30).
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/b6283dbb .
          Hide
          yeongwei YeongWei added a comment -

          CALCITE-585-2015.04.14.patch contains the fixes mentioned and test added to CalciteRemoteDriverTest.java.

          Show
          yeongwei YeongWei added a comment - CALCITE-585 -2015.04.14.patch contains the fixes mentioned and test added to CalciteRemoteDriverTest.java.
          Hide
          julianhyde Julian Hyde added a comment -

          Yes.

          Rather than throwing directly, can you please call a method:

          throw connection.helper.unsupported();

          . Then we can add more info by refactoring that method. Also, please add a test for one or two of the methods to make sure they continue to throw.

          Show
          julianhyde Julian Hyde added a comment - Yes. Rather than throwing directly, can you please call a method: throw connection.helper.unsupported(); . Then we can add more info by refactoring that method. Also, please add a test for one or two of the methods to make sure they continue to throw.
          Hide
          yeongwei YeongWei added a comment -

          Hi Julian, Will you accept a patch that fixed all the no implementation methods that throw the UnsupportedOperationException() into SQLFeatureNotSupportedException() for AvaticaConnection, AvaticaStatement and AvaticaPreparedStatement?

          For other methods with implementation, each of it may have to be addressed separately.

          Show
          yeongwei YeongWei added a comment - Hi Julian, Will you accept a patch that fixed all the no implementation methods that throw the UnsupportedOperationException() into SQLFeatureNotSupportedException() for AvaticaConnection, AvaticaStatement and AvaticaPreparedStatement? For other methods with implementation, each of it may have to be addressed separately.
          Hide
          julianhyde Julian Hyde added a comment -

          I agree, such methods should throw SQLFeatureNotSupportedException. Feel free to submit a patch.

          Show
          julianhyde Julian Hyde added a comment - I agree, such methods should throw SQLFeatureNotSupportedException. Feel free to submit a patch.

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              jiunnjye Ng Jiunn Jye
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development