Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TableModel problem when displaying a null data object.

853670Apr 7 2011 — edited Apr 8 2011
~hello all,

ok-I'll start in this group and see where it leads... tia

I am connecting to a MySQL database. The tables allow null date values. Having created a JTable and given it MyTableModel, the table is displayed ok; the null date fields are blank, which is what I want; but the console is giving me this warning: +"com.mdr.db.MyTableModel: failed to get myRowset value. Value '0000-00-00' can not be represented as java.sql.Date"+. MyTableModel.getValueAt() is simply calling a underlying JdbcRowSet rowset with the following:

mylTable.getRowset().absolute(rowIndex+1);
if (columnIndex != -1) {
value = patrolTable.getRowset().getObject(columnIndex+1);
}

Everything works ok, but I would like to eliminate the console error. One of the problems ~I think~ is that I am retrieving variable columns to display with the SELECT statement. The gui allows the user to select what columns/data to display dynamically. So the date column(s) will move around.

If you can point me in the right direction on this it would be greatly appreciated!

regards
_mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2011
Added on Apr 7 2011
6 comments
405 views