Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1012

stored procedure register output parameter as null if set before registerOutParameter command

    XMLWordPrintable

Details

    Description

      When using a store procedure with in and out parameters, if parameter is set BEFORE registering parameter as an output parameter, it will be sent as NULL to server.
      example :

              cstmt = connection.prepareCall(sql);
              cstmt.setLong(1, 42L);
              cstmt.registerOutParameter(1, Types.NUMERIC);
              cstmt.executeQuery();
      

      as a workaround, registering parameter before setting value has correct behavior:

              cstmt = connection.prepareCall(sql);
              cstmt.registerOutParameter(1, Types.NUMERIC);
              cstmt.setLong(1, 42L);
              cstmt.executeQuery();
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.