Re: ResultSetMetaData enhancements
От | Kris Jurka |
---|---|
Тема | Re: ResultSetMetaData enhancements |
Дата | |
Msg-id | Pine.BSO.4.56.0407122322440.17993@leary.csoft.net обсуждение исходный текст |
Ответ на | Re: ResultSetMetaData enhancements (ow <oneway_111@yahoo.com>) |
Список | pgsql-jdbc |
On Mon, 12 Jul 2004, ow wrote: > Yes, rsmd.getTableName() appears to work. However, I was under > impression that the folowing should also work (but it does not): > > someValue = rs.getXXX("table.column"); // instead of just rs.getXXX("column") > > This would be usefull if result set contained two columns from different > tables with the same name. > It actually isn't rs.getXXX("column"), it's the alias given to a select output. Note that "SELECT a AS b FROM tab" will need to use rs.getXXX("b"), not "a". There are some rules for coming up with a default alias which make the column name the alias for plain columns without aliases. Adding the tablename to the getXXX method doesn't seem any cleaner to me than providing a select alias for the column and actually would have some implementation issues. Notably column names are allowed to have a . in them, so how would you know when someone was providing a table name. Kris Jurka
В списке pgsql-jdbc по дате отправления: