EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #396 background imageLoading...
Page #396 background image
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)
Target data source
Behavior before IBM Data Server Driver for
JDBC and SQLJ Version 4.0
Behavior for IBM Data Server Driver for
JDBC and SQLJ Version 4.0 and later
getColumnName
value
getColumnLabel
value
getColumnName
value
getColumnLabel
value
DB2 for z/OS Version
8 or later, and DB2 for
i5/OS Version V5R3
and later
MYLABEL MYLABEL MYCOL MYLABEL
DB2 for z/OS Version
7, and DB2 for i5/OS
Version V5R2
MYLABEL MYLABEL MYLABEL MYLABEL
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
Target data source
Behavior before IBM Data Server Driver for
JDBC and SQLJ Version 4.0
Behavior for IBM Data Server Driver for
JDBC and SQLJ Version 4.0 and later
getColumnName
value
getColumnLabel
value
getColumnName
value
getColumnLabel
value
DB2 for z/OS Version
8 or later, and DB2 for
i5/OS V5R3 and later
MYLABEL LABELONCOL MYCOL MYLABEL
DB2 for z/OS Version
7, and DB2 for i5/OS
V5R2
MYLABEL LABELONCOL MYCOL LABELONCOL
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
â„¢

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability