0

Hi all,
UDATE:
Let's not hastily rush into this. I may have found my problem. BTW, my result set is populated with all of the required data.

I have a custom renderer which renders table cell values from a query. The result data is populated into a 2 dimensional array. Then it is rendered to fit into a Jtable and accompanying Frame. My application calls this class for 3 different tables. One has lately started throwing exceptions from getClass an override from AbsractTableModel:

@Override
        public Class getColumnClass(int c) {
            return getValueAt(0, c).getClass();
       //Exception thrown here

        public Object getValueAt(int row, int col) {
            return data[row][col];
        }
       //Because a null was populated here.

This leads me to believe that my jdbc connection isn't returning data fast enough to populate the data[][] object. Will step-through-debug to pinpoint the issue. The table will recover from the exception and display 3 or 4 values from one row. Many rows may be returned. Other days it works fine. Other queries call the same overriden table model, renderer, and data[][] object, without issue. Those queries only contain a handful of data however. The query that bombs actually isn't very top-heavy. It will return only a handful of records as well.

Also, I can run oracle sql developer from my desktop (the same location as the application) and return accurate results from the same query.

Let me know what code you will need to see in addition to this. There's a lot of it so I didn't want to introduce too much noise to this problem. Thanks!

Edited by eggmatters: n/a

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by eggmatters
0

Hi all,
UDATE:
Let's not hastily rush into this. I may have found my problem. BTW, my result set is populated with all of the required data.

Yep. I have found it. Will mark as solved. What I didn't and never had to anticipate with my query was the possibility of a null value. I was testing a different data set which did just that. This is perfectly acceptable for the DB constraints, it just is rare. Sure enough, when the table populates, it will only display the fist set of valid values returned by said row. Oracle Sql Developer catches this and populates that field with the string "(null") I will do the same.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.