appli.sqlplayer.gui
Class ResultsetTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byappli.sqlplayer.gui.ResultsetTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ResultsetTableModel
extends javax.swing.table.AbstractTableModel

This table model manages a SQL/jdbc result set

Version:
2.0 June 2003
Author:
Marc Wenger/CDS
See Also:
Serialized Form

Field Summary
private  int cCols
           
private  java.lang.String[] colNames
           
private  int[] colSizes
           
private  int cRows
           
private  java.lang.String[][] data
           
private static java.lang.String strNull
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ResultsetTableModel(java.sql.ResultSet rs)
          Constructor from a sql result set.
 
Method Summary
 int getColumnCount()
           
 java.lang.String getColumnName(int i)
           
 int getColumnSize(int i)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
           
private  void readData(java.sql.ResultSet rs)
          Read the data in the data 2D array
private  void setEmpty()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strNull

private static final java.lang.String strNull
See Also:
Constant Field Values

cRows

private int cRows

cCols

private int cCols

colNames

private java.lang.String[] colNames

colSizes

private int[] colSizes

data

private java.lang.String[][] data
Constructor Detail

ResultsetTableModel

public ResultsetTableModel(java.sql.ResultSet rs)
Constructor from a sql result set.

Parameters:
rs - ResultSet. A null value creates an empty model
Method Detail

setEmpty

private void setEmpty()

readData

private void readData(java.sql.ResultSet rs)
Read the data in the data 2D array

Parameters:
rs - ResultSet to use

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)

getColumnName

public java.lang.String getColumnName(int i)

getColumnSize

public int getColumnSize(int i)

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()