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



Richard,

the specification that you are talking about is Java specification(JDBC) or
SQL specification? Standard SQL supports column names qualified by the table
name.....

Thanks.

-----Original Message-----
From: Richard Dettinger [mailto:cujo@us.ibm.com]
Sent: Friday, November 16, 2001 7:49 AM
To: java400-l@midrange.com
Subject: RE: java code help...



You can't qualify column names.  Sorry its just not allowed.  The
specification states that if a column name exists multiple times in a
ResultSet that the column name applies to the first entry.

You could write your SQL statement to give the columns unique names.
That's the only work around available.

BTW:  Your app will perform better if you use the column indexes instead of
the column names.  Part of why using names instead of column indexes is so
expensive is because you have to do a linear search of the names of the
columns in the ResultSet for just this reason.  If your ResultSet has 100
rows and you are fetching the 100th row with a column name, you could be
spending an order of magnitude more time in the driver figuring out what
the column index is over actually doing the work of getting the data.

Sorry, dude... I'm a JDBC driver writer... I have to say those types of
things to the application programmers.  :-)

Richard D. Dettinger
AS/400 Java Data Access Team

Democracy's enemies have always underestimated the courage of the American
people.
It was true at Concord Bridge.  It was true at Pearl Harbor.  And it was
true today.

         Rochester Post-Bulletin
         Tuesday September 11, 2001


"Hatzenbeler, Tim" <thatzenbeler@clinitech.net>@midrange.com on 11/15/2001
04:59:31 PM

Please respond to java400-l@midrange.com

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


To:   "'java400-l@midrange.com'" <java400-l@midrange.com>
cc:
Subject:  RE: java code help...



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
I added the 'a' for a reason, i'm trying to figure out how to qulaify the
field name to a praticular table...


> -----Original Message-----
> From:   Clapham, Paul [SMTP:pclapham@core-mark.com]
> Sent:   Thursday, November 15, 2001 1:48 PM
> To:     java400-l@midrange.com
> Subject:     RE: java code help...
>
> Question #1: the actual field name is probably "CUSNUM" and not
> "A.CUSNUM".
>
> Question #2: if you want to use Java to display data in tabular format on
> your PC screen, then you probably want to use a JTable from the Swing
> components.  But it would take much more than a few minutes to explain
> that,
> so I'll just point you towards a tutorial on that subject:
> http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
>
> PC2
>
> -----Original Message-----
> From: Hatzenbeler, Tim [mailto:thatzenbeler@clinitech.net]
> Sent: November 15, 2001 12:56
> To: 'java400-l@midrange.com'
> Subject: java code help...
>
>
> This message is in MIME format. Since your mail reader does not
understand
> this format, some or all of this message may not be legible.
> --
> [ Picked text/plain from multipart/alternative ]
> I'm really trying to understand java, and right now, all I have are 2
> examples, that I found out on the net...
> And I got them to compile and run, on the PC, using the 400 toolbox jar..
>
> I was wondering if someone could hold my hand for a few minutes, and
offer
> me a great big push in the right direction...
>
> Question #1.  I have this code, and I have modified it, so I could
attempt
> to qualify the field names...  But it didn't work... Could someone please
> correct my error.
>
> ERROR Message at runtime: An undefined column name was detected.
>
>     ResultSet rs = stmt.executeQuery ("SELECT * FROM QIWS.QCUSTCDT A
ORDER
> BY LSTNAM");
>    while (rs.next ()) {
>         String cusnum = rs.getString("A.CUSNUM");
>
> Question #2,  Could someone please show me how to take the result set
that
> I
> get, and instead of printing it in a dos window, how would I place the
> data
> in a real window on my pc, in a datasheet type view (similar to excel, or
> when I do an SQL through ops nav)...
>
> I offer many thanks,  tim...
> _______________________________________________
> 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
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.
_______________________________________________
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
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.




_______________________________________________
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
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.