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'

Cause

There is a change in behavior in the DB2 drivers as per https://www.ibm.com/support/pages/db2-alias-name-behaviour-changes-latest-drivers-versions

 

 

Environment

Release : 10.6

Component : DevTest Application Test

Resolution

Add parameter in JDBC URL as below:

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

This should allow for resultset to have the ColumnAlias.