Java Reference
In-Depth Information
}
blob.free(); // Free the blob and release any
held resources.
}
return true;
}
}
catch (SQLException sqlex)
{
while (sqlex != null)
{
System.err.println("sql
error
:
"+sqlex.getMessage());
System.err.println("sql
state
:
"+sqlex.getSQLState());
System.err.println("error
code:
"+sqlex.getErrorCode());
System.err.println("cause: "+sqlex.getCause());
sqlex = sqlex.getNextException();
}
return false;
}
}
Thismethod,theinverseof initDB() ,showshowtoobtainaresultset'srowcount
by executing a SQL statement such as SELECT COUNT(*) FROM PLANETS , and
how to deserialize a blob's contained object.
TheSwing-basedGUIconsistsofa SwingCanvas component(see Chapter7 )and
an instance of the javax.swing.JTable class, which is used to display and edit
regulartwo-dimensionaltablesofcells,andistheperfectcomponentfordisplayingtab-
ular data.
A complete discussion of JTable and its many supporting types (in the
javax.swing and javax.swing.table packages) is beyond the scope of this
chapter. Instead, consider the following excerpt from the createGUI() method:
TableModel model = new AbstractTableModel()
{
@Override
Search WWH ::




Custom Search