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




    Hi Vengoal,

    Depending on your needs, Keith's answer of
ResultSetMetaData.getColumnDisplaySize() is probably enough.  If you need
more information and specifics about the columns, you can also use
DatabaseMetaData.getColumns().

    There's actually an example of both methods in the list archives at:

http://archive.midrange.com/java101/200107/msg00035.html

    I also have an example using ResultSetMetaData.getColumnDisplaySize() to
set up a fixed font display in one of the exercises for my JDBC tutorial at
Sun's developer site.  The complete program is at:

http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/exercises/SRS/solution/ScrollResultJ.java


                                                         Joe Sam

Joe Sam Shirah -        http://www.conceptgo.com
conceptGO       -        Consulting/Development/Outsourcing
Java Filter Forum:       http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International?    http://www.jguru.com/faq/I18N
Que Java400?            http://www.jguru.com/faq/Java400


----- Original Message ----- 
From: "McCully, Keith (RBS Insurance)" <Keith.McCully@xxxxxxxxx>
To: "'Java Programming on and around the iSeries / AS400'"
<java400-l@xxxxxxxxxxxx>
Sent: Wednesday, September 06, 2006 5:21 AM
Subject: RE: How do I retrieve the every field length defined in DDL with
JDBC ?


Hi Vengoal,

Create a ResultSetMetaData object then use its getColumnDisplaySize method
for every column.

If you want further info then refer to the JDBC API docs.

Regards,

Keith

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx]

Sent: 06 September 2006 04:56
To: Java Programming on and around the iSeries / AS400
Subject: How do I retrieve the every field length defined in DDL with JDBC
?

*** WARNING : This message originates from the Internet ***

Hi,
    I have one table created with following DDL:

CREATE TABLE ACTION
(
  ACTIONCD      CHAR(1),
  ACTDEP            CHAR(10),
  DESCRIPTION  VARCHAR(80),
  SHORTDESC    VARCHAR(10)
)

How do I retrieve the atble's  every field length defined in DDL with JDBC
?

Best regards,

Vengoal
--


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.