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

make column label name display instead column name when useOldAliasMetadataBehavior option true

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.9
    • 1.2.2
    • Other
    • None
    • ALL
    • Sprint connector/j 1.3.0

    Description

      Like CONJ-149, column alias display feature need.

      as_is

      select col_1 as col_A from test_table;
      :  getColumnName return col_1
       

      i need feature about useOldAliasMetadataBehavior option (like CONJ-149 TABLE)
      when useOldAliasMetadataBehavior is true

      select col_1 as col_A from test_table;
      :  getColumnName return col_A

      that make column label name display instead column name when useOldAliasMetadataBehavior option true

      how about my idea,
      and sample my code is below

      MySQLResultSetMetaData.java

       public String getColumnName(final int column) throws SQLException {
              String s =  getColumnInformation(column).getOriginalName();      
      +        if (returnTableAlias == true)    // if useOldAliasMetadataBehavior=true then getColumnName return getCoulmnLabel
      +         s =  getColumnLabel(column); 
            
              if ("".equals(s))  // odd things that are no columns, e.g count(*)
                  s =  getColumnLabel(column);
              return s;
          }

      Attachments

        Issue Links

          Activity

            diego dupin Diego Dupin added a comment -

            getColumnLabel must be your solution :

            select col_1 as col_A from test_table;
            :  getColumnName return col_1
            :  getColumnLabel return col_A

            JDBC-4.0 indicate that there is 2 differents things :

            • getColumnName will have the physical name
            • getColumnLabel will be the alias if defined, the physical name if not.

            Does it not answer your needs ?

            diego dupin Diego Dupin added a comment - getColumnLabel must be your solution : select col_1 as col_A from test_table; : getColumnName return col_1 : getColumnLabel return col_A JDBC-4.0 indicate that there is 2 differents things : getColumnName will have the physical name getColumnLabel will be the alias if defined, the physical name if not. Does it not answer your needs ?

            getColumnLabel is solution.
            I agree,
            BUT,
            1. mysql client supports useOldAliasMetadataBehavior option about column alias
            2. Some package solution application code was used getColumnName instead of getColumnLagel
            (using with useOldAliasMetadataBehavior=true)

            My situation some package developer says,
            " Our package run in mysql envirment(useOldAliasMetadataBehavior=ture), but mariadb does not"
            so I want mariadb support more (old) package or appliation.
            and it's more Compatible with mysql feature.

            seung hoon seung hoon yoo added a comment - getColumnLabel is solution. I agree, BUT, 1. mysql client supports useOldAliasMetadataBehavior option about column alias 2. Some package solution application code was used getColumnName instead of getColumnLagel (using with useOldAliasMetadataBehavior=true) My situation some package developer says, " Our package run in mysql envirment(useOldAliasMetadataBehavior=ture), but mariadb does not" so I want mariadb support more (old) package or appliation. and it's more Compatible with mysql feature.
            diego dupin Diego Dupin added a comment -

            done as requested for mysql compatibility

            diego dupin Diego Dupin added a comment - done as requested for mysql compatibility

            People

              diego dupin Diego Dupin
              seung hoon seung hoon yoo
              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.