JDBC step column alias resultset not working with DB2
search cancel

JDBC step column alias resultset not working with DB2

book

Article ID: 229210

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

The SQL JDBC step which is not returning result set column name as per specified alias i.e. Column_Alias, however the query work fine in db.

Example Query : select Column as Column_Alias from table;

Returns column name as 'Column' instead of expected 'Column_Alias'

Environment

All supported DevTest releases.

Cause

There is a change in behavior in the DB2 drivers as per DB2 Alias name behaviour changes with latest drivers versions

 

 

Resolution

Add parameter in JDBC URL as below:

jdbc:db2://hostname:50000/DBName:useJDBC4ColumnNameAndLabelSemantics=false;

This will allow for resultset to have the ColumnAlias.