Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-945

Connecting to Tajo by JDBC driver failed with SQL Exception "Invalid JDBC URI"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: JDBC Driver
    • Labels:
      None

      Description

      When a Java program tries to make a connection to Tajo using JDBC driver, as described in Tajo document http://tajo.apache.org/docs/current/jdbc_driver.html, the program failed with SQL Exception "Invalid JDBC URI".

      Connection conn = DriverManager.getConnection("jdbc:tajo://127.0.0.1:26002");

      1. TAJO-945.patch
        0.7 kB
        Mai Hai Thanh

        Activity

        Hide
        hyunsik Hyunsik Choi added a comment - - edited

        The documentation is wrong. It would work well if you use 'jdbc:tajo://127.0.0.1:26002/default' as JDBC URI, where default is your database name.

        Show
        hyunsik Hyunsik Choi added a comment - - edited The documentation is wrong. It would work well if you use 'jdbc:tajo://127.0.0.1:26002/default' as JDBC URI, where default is your database name.
        Hide
        mhthanh Mai Hai Thanh added a comment - - edited

        Hi Hyunsik,
        You are right. When I try the new URI "jdbc:tajo://127.0.0.1:26002/default" as you mentioned, the JDBC driver works well. However, this is still a (trivial) bug because in the class org.apache.tajo.jdbc.TajoConnection, there have already been some lines of code to handle the case of missing database name (the database name would be set to DEFAULT_DATABASE_NAME). The solution is simple and I made a patch file.

        Show
        mhthanh Mai Hai Thanh added a comment - - edited Hi Hyunsik, You are right. When I try the new URI "jdbc:tajo://127.0.0.1:26002/default" as you mentioned, the JDBC driver works well. However, this is still a (trivial) bug because in the class org.apache.tajo.jdbc.TajoConnection , there have already been some lines of code to handle the case of missing database name (the database name would be set to DEFAULT_DATABASE_NAME). The solution is simple and I made a patch file.
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12655721/TAJO-945.patch
        against master revision 499d108.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to introduce 1 new Findbugs (version 2.0.3) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-jdbc.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/466//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/466//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-jdbc.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/466//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12655721/TAJO-945.patch against master revision 499d108. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to introduce 1 new Findbugs (version 2.0.3) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-jdbc. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/466//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/466//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-jdbc.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/466//console This message is automatically generated.
        Hide
        jihoonson Jihoon Son added a comment -

        Nice finding and thanks Mai Hai Thanh!
        The patch looks good to me.
        Here is my +1.
        I'll commit it shortly.

        Show
        jihoonson Jihoon Son added a comment - Nice finding and thanks Mai Hai Thanh ! The patch looks good to me. Here is my +1. I'll commit it shortly.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #301 (See https://builds.apache.org/job/Tajo-master-build/301/)
        TAJO-945: Connecting to Tajo by JDBC driver failed with SQL Exception "Invalid JDBC URI". (Mai Hai Thanh via jihoon) (jihoonson: rev 1867c53e4de46bf5c6f2a69fe9d1fd27facac35b)

        • CHANGES
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoConnection.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #301 (See https://builds.apache.org/job/Tajo-master-build/301/ ) TAJO-945 : Connecting to Tajo by JDBC driver failed with SQL Exception "Invalid JDBC URI". (Mai Hai Thanh via jihoon) (jihoonson: rev 1867c53e4de46bf5c6f2a69fe9d1fd27facac35b) CHANGES tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoConnection.java
        Hide
        hyunsik Hyunsik Choi added a comment -

        Thank you Mai for nice finding and your contribution. The patch is committed to master branch. Fixing it as resolved.

        Show
        hyunsik Hyunsik Choi added a comment - Thank you Mai for nice finding and your contribution. The patch is committed to master branch. Fixing it as resolved.

          People

          • Assignee:
            mhthanh Mai Hai Thanh
            Reporter:
            mhthanh Mai Hai Thanh
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development