JDBCAdapter
, which extends AbstractTableModel
, illustrates a typical mapping between relational database and Java data types. It may be seen here, and a complete example may be found in samples/demo/jfc/TableExample
, found among the Java SE Development Kit 8u25 Demos and Samples Downloads. In outline,
Override
getColumnClass()
.Get the column's data
type
fromResultSetMetaData
.Use
switch(type)
to return the correct type-token.
Also consider a SwingWorker<Row, Row>
for finer granularity in publish()/process()
.