IBM DB2 Manual page 396

Table of Contents

Advertisement

Table 87. ResultSetMetaData.getColumnName and ResultSetMetaData.getColumnName before and after IBM Data
Server Driver for JDBC and SQLJ Version 4.0 for a query with an AS CLAUSE (continued)
Behavior before IBM Data Server Driver for
JDBC and SQLJ Version 4.0
getColumnName
Target data source
value
DB2 for z/OS Version
MYLABEL
8 or later, and DB2 for
i5/OS Version V5R3
and later
DB2 for z/OS Version
MYLABEL
7, and DB2 for i5/OS
Version V5R2
Example: The following query contains no AS clause:
SELECT MYCOL FROM MYTABLE
The ResultSetMetaData.getColumnName and ResultSetMetaData.getColumnLabel
methods on the query return MYCOL, regardless of the target data source.
Example: On a DB2 for z/OS or DB2 for i5/OS data source, a LABEL ON
statement is used to define a label for a column:
LABEL ON COLUMN MYTABLE.MYCOL IS 'LABELONCOL'
The following query contains an AS CLAUSE, which defines a label for a column
in the ResultSet:
SELECT MYCOL AS MYLABEL FROM MYTABLE
The following table lists the ResultSetMetaData.getColumnName and
ResultSetMetaData.getColumnName values that are returned for the query.
Table 88. ResultSetMetaData.getColumnName and ResultSetMetaData.getColumnName before and after IBM Data
Server Driver for JDBC and SQLJ Version 4.0 for a table column with a LABEL ON statement in a query with an AS
CLAUSE
Behavior before IBM Data Server Driver for
JDBC and SQLJ Version 4.0
getColumnName
Target data source
value
DB2 for z/OS Version
MYLABEL
8 or later, and DB2 for
i5/OS V5R3 and later
DB2 for z/OS Version
MYLABEL
7, and DB2 for i5/OS
V5R2
Example: On a DB2 for z/OS or DB2 for i5/OS data source, a LABEL ON
statement is used to define a label for a column:
LABEL ON COLUMN MYTABLE.MYCOL IS 'LABELONCOL'
The following query contains no AS CLAUSE:
SELECT MYCOL FROM MYTABLE
380
Application Programming Guide and Reference for Java
Behavior for IBM Data Server Driver for
JDBC and SQLJ Version 4.0 and later
getColumnLabel
getColumnName
value
value
MYLABEL
MYCOL
MYLABEL
MYLABEL
Behavior for IBM Data Server Driver for
JDBC and SQLJ Version 4.0 and later
getColumnLabel
getColumnName
value
value
LABELONCOL
MYCOL
LABELONCOL
MYCOL
getColumnLabel
value
MYLABEL
MYLABEL
getColumnLabel
value
MYLABEL
LABELONCOL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents