applications.basics
Class GenericTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by applications.basics.GenericTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class GenericTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Field Summary
 java.lang.String[] columnNames
           
 java.util.Vector data
           
 DbInfo dbi
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
GenericTableModel(java.lang.String host, java.lang.String user, java.lang.String password, java.lang.String database, java.lang.String table, java.lang.String schema)
           
GenericTableModel(t_connect con, java.lang.String table, java.lang.String schema)
           
 
Method Summary
 void addRow(java.util.Vector v)
           
 void clearData()
           
 void close()
           
 void executeQuery()
           
protected  void finalize()
           
 java.lang.Class getColumnClass(int column)
          Does not work!!! public Class getColumnClass(int c) { try { return getValueAt(0, c).getClass(); } catch (Exception e) { System.out.println("(GenericTableModel)Fatal Error in method: getColumnClass(int " + c + ")\n"); e.printStackTrace(); return null; } }
 int getColumnCount()
           
 java.lang.String getColumnName(int i)
           
 t_connect getCon()
           
 java.lang.String getDatabase()
          Get the value of database.
 java.lang.String getHost()
          Get the value of host.
 java.lang.String getKomma(java.lang.String column)
           
 java.lang.Object getObject(int i)
          getting the object from the resultSet, because there seems to be something strange with the resultSet.getObject() of my JDBC-Driver
 java.lang.String getPassword()
          Get the value of password.
 java.lang.String getQuery()
          Get the value of query.
 int getRowCount()
           
 java.lang.String getSchema()
          Get the value of schema.
 java.lang.String getSQLError()
          Get the value of SQLError.
 java.lang.String getTable()
          Get the value of table.
 java.lang.String getUser()
          Get the value of user.
 java.lang.Object getValueAt(int row, int col)
           
 boolean isCellEditable(int row, int col)
           
 void open()
           
 void removeRow(int row)
           
 void setCon(t_connect v)
           
 void setDatabase(java.lang.String v)
          Set the value of database.
 void setHost(java.lang.String v)
          Set the value of host.
 void setPassword(java.lang.String v)
          Set the value of password.
 void setQuery(java.lang.String v)
          Set the value of query.
 void setSchema(java.lang.String v)
          Set the value of schema.
 void setSQLError(java.lang.String v)
          Set the value of SQLError.
 void setTable(java.lang.String v)
          Set the value of table.
 void setUser(java.lang.String v)
          Set the value of user.
 void setValueAt(java.lang.Object value, int row, int col)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbi

public DbInfo dbi

columnNames

public java.lang.String[] columnNames

data

public java.util.Vector data
Constructor Detail

GenericTableModel

public GenericTableModel(t_connect con,
                         java.lang.String table,
                         java.lang.String schema)

GenericTableModel

public GenericTableModel(java.lang.String host,
                         java.lang.String user,
                         java.lang.String password,
                         java.lang.String database,
                         java.lang.String table,
                         java.lang.String schema)
Method Detail

getCon

public t_connect getCon()

setCon

public void setCon(t_connect v)

getHost

public java.lang.String getHost()
Get the value of host.

Returns:
Value of host.

setHost

public void setHost(java.lang.String v)
Set the value of host.

Parameters:
v - Value to assign to host.

getUser

public java.lang.String getUser()
Get the value of user.

Returns:
Value of user.

setUser

public void setUser(java.lang.String v)
Set the value of user.

Parameters:
v - Value to assign to user.

getPassword

public java.lang.String getPassword()
Get the value of password.

Returns:
Value of password.

setPassword

public void setPassword(java.lang.String v)
Set the value of password.

Parameters:
v - Value to assign to password.

getDatabase

public java.lang.String getDatabase()
Get the value of database.

Returns:
Value of database.

setDatabase

public void setDatabase(java.lang.String v)
Set the value of database.

Parameters:
v - Value to assign to database.

getTable

public java.lang.String getTable()
Get the value of table.

Returns:
Value of table.

setTable

public void setTable(java.lang.String v)
Set the value of table.

Parameters:
v - Value to assign to table.

getSchema

public java.lang.String getSchema()
Get the value of schema.

Returns:
value of schema.

setSchema

public void setSchema(java.lang.String v)
Set the value of schema.

Parameters:
v - Value to assign to schema.

getSQLError

public java.lang.String getSQLError()
Get the value of SQLError.

Returns:
value of SQLError.

setSQLError

public void setSQLError(java.lang.String v)
Set the value of SQLError.

Parameters:
v - Value to assign to SQLError.

getQuery

public java.lang.String getQuery()
Get the value of query.

Returns:
value of query.

setQuery

public void setQuery(java.lang.String v)
Set the value of query.

Parameters:
v - Value to assign to query.

clearData

public void clearData()

addRow

public void addRow(java.util.Vector v)

removeRow

public void removeRow(int row)

getColumnName

public java.lang.String getColumnName(int i)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getColumnClass

public java.lang.Class getColumnClass(int column)
Does not work!!! public Class getColumnClass(int c) { try { return getValueAt(0, c).getClass(); } catch (Exception e) { System.out.println("(GenericTableModel)Fatal Error in method: getColumnClass(int " + c + ")\n"); e.printStackTrace(); return null; } }

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

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

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getKomma

public java.lang.String getKomma(java.lang.String column)

executeQuery

public void executeQuery()

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

open

public void open()

getObject

public java.lang.Object getObject(int i)
getting the object from the resultSet, because there seems to be something strange with the resultSet.getObject() of my JDBC-Driver