Home:ALL Converter>JDBC getColumnName getColumnLabel DB2

JDBC getColumnName getColumnLabel DB2

Ask Time:2012-09-04T16:45:26         Author:andy

Json Formatter

Is it possible to provide both column name and column label in JDBC ResultSetMetadata in DB2 for queries where a real table column is not involved?

select substr('Hallo', 1) as greeting from sysibm.sysdummy1

I would like to achieve a different column label and column name for the above query. In this case getColumnName and getColumnLabel both return the String "GREETING". I would like to set a different column label (e.g. "Begrüßung").

I use DB2 JCC4 Driver and DB2 V9. Thanks.

Author:andy,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12259829/jdbc-getcolumnname-getcolumnlabel-db2
yy