[teiid-issues] [JBoss JIRA] (TEIID-3385) ResultSetMetaData returns wrong column name after renaming (using AS)
Juraj Duráni (JIRA)
issues at jboss.org
Wed Mar 18 03:09:19 EDT 2015
[ https://issues.jboss.org/browse/TEIID-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051221#comment-13051221 ]
Juraj Duráni edited comment on TEIID-3385 at 3/18/15 3:09 AM:
--------------------------------------------------------------
Comment removed - misunderstanding.
was (Author: jdurani):
Yes I know that column label should be used. But I expect if I use AS clause to rename column in the result then ResultSetMetaData should return column's label that was declared in AS clause not original name of the column.
ResultSet rs = connection.prepareStatement("SELECT IntKey AS a FROM mytable").executeQuery();
ResultSetMetaData md = rs.getMetaData();
String name = md.getColumnName(1);
Now the variable 'name' contains "IntKey", but I think that it should contain "a".
> ResultSetMetaData returns wrong column name after renaming (using AS)
> ---------------------------------------------------------------------
>
> Key: TEIID-3385
> URL: https://issues.jboss.org/browse/TEIID-3385
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 8.7.1
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
>
> Query: SELECT IntKey AS a FROM <table>;
> Issues:
> - ResultSetMetaData object returns name of the column "IntKey", but it should return "a".
> - method ResultSet.getString("IntKey") thows an exception (org.teiid.jdbc.TeiidSQLException: Column name "INTKEY" does not exist.), but ResultSet.getString("a") returns the correct result.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the teiid-issues
mailing list