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

getGeneratedKeys() return ResultSet with column name

Details

    Description

      It would be preferable if the ResultSet returned by getGeneratedKeys() provided the name of the table columns with ResultSet.getMetaData().getColumnName(int index) rather than insert_id

      Otherwise it assumes that we already know the name of the column which is the primary key!
      In any case this does not follow the JDBC specifications.

      see: Statement.java

      Attachments

        Activity

          prrvchr prrvchr created issue -
          prrvchr prrvchr made changes -
          Description
          https://github.com/mariadb-corporation/mariadb-connector-j/blob/2eb246da205da899fd88238d1bc253f9809d9a2e/src/main/java/org/mariadb/jdbc/Statement.java#L963
          It would be preferable if the ResultSet returned by getGeneratedKeys() provided the name of the table columns with *ResultSet.getMetaData().getColumnName(int index)* rather than *insert_id*

          Otherwise it assumes that we already know the name of the column which is the primary key!

          see: [Statement.java|https://github.com/mariadb-corporation/mariadb-connector-j/blob/2eb246da205da899fd88238d1bc253f9809d9a2e/src/main/java/org/mariadb/jdbc/Statement.java#L963]
          prrvchr prrvchr made changes -
          Description It would be preferable if the ResultSet returned by getGeneratedKeys() provided the name of the table columns with *ResultSet.getMetaData().getColumnName(int index)* rather than *insert_id*

          Otherwise it assumes that we already know the name of the column which is the primary key!

          see: [Statement.java|https://github.com/mariadb-corporation/mariadb-connector-j/blob/2eb246da205da899fd88238d1bc253f9809d9a2e/src/main/java/org/mariadb/jdbc/Statement.java#L963]
          It would be preferable if the ResultSet returned by getGeneratedKeys() provided the name of the table columns with *ResultSet.getMetaData().getColumnName(int index)* rather than *insert_id*

          Otherwise it assumes that we already know the name of the column which is the primary key!
          In any case this does not follow the JDBC specifications.

          see: [Statement.java|https://github.com/mariadb-corporation/mariadb-connector-j/blob/2eb246da205da899fd88238d1bc253f9809d9a2e/src/main/java/org/mariadb/jdbc/Statement.java#L963]
          diego dupin Diego Dupin made changes -
          Fix Version/s N/A [ 22125 ]
          Resolution Won't Do [ 10201 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            diego dupin Diego Dupin
            prrvchr prrvchr
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.