× 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.



The iSeries JDBC drivers return the column name today as you have noticed.
Sorry.  There is some work being done to investigate how hard it would be
to make it possible for the drivers to get this information in a future
release.

For now, I think your only work around is to use the
DatabaseMetaData.getColumns API to get the information (it is provided
through that interface today).

Of note (and this one even I can't explain), the native JDBC driver can't
return labels today.  It can return comments.  The Toolbox JDBC driver (I
believe) will return either.  Its got something to do with where the data
is stored in the database and the different ways the two drivers get at the
data.

What that means is that the getColumn API for Native JDBC can return info
for a column from:

COMMENT ON lib.table (COLUMN1 IS 'text')

but not this:

LABEL ON COLUMN lib.table (COLUMN1 TEXT IS 'text')

Again, toolbox seems to work with both.

Regards,

Richard D. Dettinger
AS/400 Java Data Access Team

"Biologists have a special word for stability -- dead"

                Larry Wall
                Open Source Developers Journal
                Issue 1, Jan  2000


"Patrick L Archibald" <Patrick.Archibald@HomeTelco.com>@midrange.com on
08/24/2001 01:37:43 PM

Please respond to java400-l@midrange.com

Sent by:  java400-l-admin@midrange.com


To:   <JAVA400-L@midrange.com>
cc:
Subject:  getColumnLabel of ResultSetMetaData returns only the field name



Hi All

I can't get the getColumnLabel from a to work like
I think it should.

After creating the SQL table TRASH/ROOT1 from STRSQL tool,
I've done the following:

label on column trash/root1 (dircname is 'Directory Name')

label on column trash/root1 (dircname text is 'Directory Name')

When I use the getColumnLabel from a ResultSetMetaData in
my servlet I get just the field name DIRCNAME returned.

I'm stumped. Does OS/400 not support this method or? I've
searched the newsgroups using google and found many others
on different systems having trouble with this. Some said
that it only works if you specify the "AS" in the "SELECT"
statement.  I hope that is not the case.  I'm building
HTML tables dynamically on any file.  I would like
to use the column heading or label in the <TH> tags.

Specs: OS/400 V4R5M0 620-2175-832MB WAS 3.5.3 JDK 1.2

BTW, have y'all noticed the changes recently
to the newsgroup search function at http://www.google.com?

Thanx, PLA
/
/ Patrick L Archibald
/ http://HomeTelco.com/pla/
/
_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com






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.