// Some variables we want to set and use inside the try/catch blocks
LazyLoadingTableModel model = new LazyLoadingTableModel();
TableColumnModel columnModel = table.getColumnModel();
table.setTableHeader(new JDBCResultSetTableHeader(columnModel, this, dragPointHandler));
QueryResult recordSet;
int nColumns = 0;
boolean failed = false;
try {
// Get some information from the Record Set
recordSet = adapter.getResultSet();
if (recordSet != null) {
// Set the appropriate columns into the table (note that this is 1-based not 0-based)
nColumns = recordSet.getColumnCount();
for (int i = 1; i <= nColumns; ++i) {
model.addColumn(recordSet.getColumnName(i));
}
} else {
// cannot get the result set object: no column list
failed = true;
}