Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13000

Connection.prepareStatement(String,int) always throws UnsupportedException ignoring 'autoGeneratedKeys' parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8
    • None
    • sql
    • None
    • Docs Required, Release Notes Required

    Description

      Below the method call throwing Exception.

      conn.prepareStatement(query, Statement.NO_GENERATED_KEYS)
      

      But there is should be the same result as for:

      conn.prepareStatement(query)
      

      The possible fix:

      @Override 
      public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
          ensureNotClosed();
          if(autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS)
              throw new SQLFeatureNotSupportedException("Auto generated keys are not supported.");
          return prepareStatement(sql);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            pvinokurov Pavel Vinokurov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: