× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You may want to use the DB2 JDBC driver for the As/400. I have noticed
that when I use the JT Open or jt400 driver, I only get the column
descriptions on tables created from DDS members. 

When I use the DB2 driver, I get the column descriptions for tables
created via SQL. ( ie CREATE TABLE syntax.) 

I have never been able to get the column desciptions from both types of
tables from a single driver.

-Sarah 

 

> -----Original Message-----
> From: Jason Palmatier [mailto:cobraconn@xxxxxxxxx] 
> Sent: Thursday, January 20, 2005 1:31 PM
> To: wdsci-l@xxxxxxxxxxxx
> Subject: [WDSCI-L] AS400JDBCDriver does not return Column 
> Label (i.e.iSeries Column Header)?
> 
> 
>    I have created a sample table on a v5r2 iSeries and
> used the LABEL ON statement to set the column header
> (i.e. Column Label to Java's ResultSet object) to a
> human readable string.  If I query the MetaData on the
> iSeries from STRSQL the labels for each column appear
> to be set correctly. 
>    However, if I pull the table contents into a
> ResultSet via the JT Open 4.6 AS400JDBCDriver and then
> get the MetaData for the result set I still end up
> with the COLUMN_NAME when I do 
> resultSetMetaData.getColumnLabel(colIndex).  The label added 
> via LABEL ON does not seem to be honored by the JDBC Driver.  
> Has anyone run into this before, and if so, is there a way to 
> force the use of the column header so it will be returned via the
> ResultSetMetaData.getColumnLabel(colIndex) call?  I've
> placed the table creation SQL statements and the code
> used to connect and retrieve the table data below:
> 
> DROP TABLE sampleTable;
> 
> CREATE TABLE QGPL/sampleTable
> (
>    COLUMN1    char( 20) not null with default ,
>    COLUMN2    char( 20) not null with default ,
>    COLUMN3    char( 20) not null with default 
> );
> 
> LABEL ON COLUMN sampleTable
> (
>    COLUMN1    is 'Column One'
>    COLUMN2    is 'Column Two'
>    COLUMN3    is 'Column Three'
> );
> 
> I then connect to the iSeries and pull the data as
> follows:
> 
> ----------------------------------------------
> 
> DriverManager.registerDriver(new 
> com.ibm.as400.access.AS400JDBCDriver());
> 
> Connection connection = DriverManager.getConnection 
> ("jdbc:as400://" + system);
> 
> DatabaseMetaData dmd = connection.getMetaData();
> 
> Statement select = connection.createStatement();
> 
> ResultSet rs = select.executeQuery ("SELECT * FROM
> QGPL" + dmd.getCatalogSeparator() + "sampleTable");
> 
> ResultSetMetaData rsmd = rs.getMetaData();
> 
> for(int j=1; j<=rsmd.getColumnCount(); j++)
> {
>    System.out.println(rsmd.getColumnLabel(j));
> }
> 
> ----------------------------------------------
> 
> When printing the column labels I expect to get:
> 
> Column One
> Column Two 
> Column Three
> 
> but instead get:
> 
> COLUMN1
> COLUMN2
> COLUMN3
> 
> Is there any way to fix this?
> 
> - Jason
> 
> 
> 
>               
> __________________________________ 
> Do you Yahoo!? 
> Meet the all-new My Yahoo! - Try it today! 
> http://my.yahoo.com 
>  
> 
> -- 
> This is the Websphere Development Studio Client for iSeries  
> (WDSCI-L) mailing list To post a message email: 
> WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change 
> list options,
> visit: http://lists.midrange.com/mailman/listinfo/wdsci-l
> or email: WDSCI-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/wdsci-l.
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.