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



Thanks for your reply. I had though of that (thinking maybe the getObject()
method was overly inefficient or something), unfortunately this data is
going to be used in a JTable that automatically displays data by type -
String, Date, Integer, etc. and I need to preserve the datatype that comes
from the database. It is written so that I can simply supply the table with
a collection of Objects and it displays according to datatype. Having to
manually set each datatype for each query would be overly cumbersome. 


-----Original Message-----
From: Alex Pinsky [mailto:apinsky@xxxxxxxxxxxxxxx] 
Sent: Friday, February 06, 2004 11:19 AM
To: Java Programming on and around the iSeries / AS400
Subject: RE: Null Values in Resultset - related to blocksize of datasource?

Hi,
Try to use rs.getString() method instead of getObject(). Define receiving
array as an array of Strings. You can always parse you String value later in
the app to the desired data type.
Hope this help,
Alex Pinsky
Intranet developer
Aeropostale, Inc.

-----Original Message-----
From: Todd Bryant [mailto:tbryant@xxxxxxxxxxxxxxxxxxxxxxx]
Sent: Friday, February 06, 2004 11:34 AM
To: 'java400-l@xxxxxxxxxxxx'
Subject: Null Values in Resultset - related to blocksize of datasource?


Hi. We are having an intermittent problem with our application where a
resultset will return null values in several fields for several records when
there should be data in those fields. I believe it may be related to the
"blockSize" setting of the datasource. The blockSize is set to the default
of 32. 

Some background: I need to iterate through a resultset and put the data into
a collection so I can transfer this data to an applet. We notice that
sometimes the 31st record of a collection will have null values half way
through the record. The next few records will have sporadic data, and then
all is fine until we get to the 62nd record. At that point, the same thing
happens - a null value half way through the record, and then the next few
records have some null values in them. 

This behavior will continue for 5-30 minutes and then it goes away. When
this is happening to a particular procedure, other procedures will run fine
with no dropping of values. We are on V5R1, using the Native driver. We are
upgrading to V5R2 this weekend. It is very hard to troubleshoot because it
may not happen even once a week and we cannot force the condition.

Any help would be greatly appreciated. Thanks


This is the method I use to create a collection:
----------- 
        public static ArrayList ResultSetToList(ResultSet rs) {
                ArrayList list = new ArrayList();
                Object[] row = null;
                try {
                        ResultSetMetaData meta = rs.getMetaData();
                        int columnCount = meta.getColumnCount();
                        while (rs.next()) {
                                row = new Object[columnCount];
                                for (int i = 0; i < columnCount; i++) {
                                        row[i] = rs.getObject(i + 1);
                                }
                                list.add(row);
                        }
                }
                catch (Exception e) {
                        System.err.println("Error in ResultSetToList()");
                        e.printStackTrace();
                        list = new ArrayList();
                }
                return list;
        }


Todd Bryant
Programmer/Analyst
University of Nebraska Foundation
402-472-0107
 


_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
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@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
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.