Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2494

Binding parameters to a PreparedStatement throws a SQLException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • Client - JDBC
    • None

    Description

      git.commit.id.abbrev=7b4c887

      Code :

          prepStatement = conn.prepareStatement("SELECT int_col AS INTCOL FROM dfs.jdbctesting.fewtypes_txt_view where int_col > ?");
          prepStatement.setInt(1, 20);
      

      The above code resulted in the below exception

      Exception in thread "main" java.sql.SQLException: parameter ordinal 1 out of range
      	at net.hydromatic.avatica.Helper.createException(Helper.java:44)
      	at net.hydromatic.avatica.AvaticaPreparedStatement.getParameter(AvaticaPreparedStatement.java:246)
      	at net.hydromatic.avatica.AvaticaPreparedStatement.setInt(AvaticaPreparedStatement.java:105)
      	at Dummy.testBindParamsPrepStatement(Dummy.java:57)
      	at Dummy.main(Dummy.java:30)
      

      Attachments

        1. DRILL-2494.1.patch.txt
          10 kB
          Daniel Barclay

        Issue Links

          Activity

            People

              dsbos Daniel Barclay
              rkins Rahul Kumar Challapalli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: