|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.common.jTable
Object made with a vector of vector to store data, and another vector to store column names.
Field Summary | |
protected static java.lang.String |
_
|
protected java.util.Vector |
columnNames
|
protected java.util.Vector |
data
|
Constructor Summary | |
jTable()
Creates a new empty instance of preludeTable |
|
jTable(java.sql.Connection con,
java.lang.String sql)
Creates an instance with table obtained from SQL query and connection specified in params. |
|
jTable(java.util.Vector data,
java.util.Vector columnNames)
Creates an initialized instance of preludeTable |
Method Summary | |
void |
clear()
|
java.util.Vector |
getColumn(int column)
Get a column from this jTable |
java.util.Vector |
getColumnNames()
Get this.columnNames Vector. |
int |
getColumnSize()
Get N dimension of MxN this.data Vector of Vectors |
java.util.Vector |
getData()
Get this.data Vector of Vectors. |
int[] |
getIgnoredColumnsPdf()
Get column numbers of a jTable to be ignored for generating pdf report. |
int |
getNamedColumnNumber(java.lang.String columnName)
Get named column number from this table. |
static int |
getNamedColumnNumber(java.lang.String columnName,
java.util.Vector vec)
Get named column number from this table. |
java.util.Vector |
getRow(int row)
Get a row from this jTable. |
int |
getRowSize()
Get M dimension of MxN this.data Vector of Vectors |
static jTable |
getTableVector(java.sql.Connection con,
java.lang.String sql)
Method to get tuples and columns according to sql query. |
java.lang.Object |
getValue(int row,
int column)
Get value from data Vector of Vectors in Object generic format. |
java.lang.Object |
getValue(int row,
int column,
java.lang.Object defaultIfNull)
Get value from this data Vector of Vectors in Object generic format if value is not null. |
java.lang.Object |
getValue(int row,
int column,
java.lang.Object ob,
java.lang.Object defaultIfobFound)
Get value in position (row,column) of a table. |
void |
printTable()
Print a Prelude generic table Vector in standard output |
void |
setColumnNames(java.util.Vector columnNames)
Set initial values to columnNames vector. |
void |
setDataVector(java.util.Vector data)
Sets initial values to vectors. |
void |
setDataVector(java.util.Vector data,
java.util.Vector columnNames)
Sets initial values to data and columnNames vectors. |
void |
setTableVector(java.sql.Connection con,
java.lang.String sql)
Set a table vector in this object. |
void |
setValue(int row,
int column,
java.lang.Object ob)
Set ob Object into this.data Vector of Vectors at (row, column) position |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector data
protected java.util.Vector columnNames
protected static final java.lang.String _
Constructor Detail |
public jTable()
public jTable(java.sql.Connection con, java.lang.String sql) throws java.sql.SQLException
con
- Connection variable to access PostgreSQL database.sql
- String with SQL query to fill jTable object.
java.sql.SQLException
- SQL syntax error executing query to define an object.public jTable(java.util.Vector data, java.util.Vector columnNames)
data
- Vector of Vectors to store data.columnNames
- Vector with column names.Method Detail |
public void clear()
public void setDataVector(java.util.Vector data, java.util.Vector columnNames)
data
- Vector of vector to store database table query.columnNames
- Vector with column namespublic void setColumnNames(java.util.Vector columnNames)
columnNames
- Vector with column names.public java.lang.Object getValue(int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
row
- integer with row index of data vector.column
- integer with column indes of data vector.
java.lang.ArrayIndexOutOfBoundsException
- index exceeded of this jTablepublic java.lang.Object getValue(int row, int column, java.lang.Object defaultIfNull)
row
- row index.column
- column index.defaultIfNull
- Object returned if value in (row, column) position is null.
java.lang.ArrayIndexOutOfBoundsException
- index exceeded of this jTablepublic java.lang.Object getValue(int row, int column, java.lang.Object ob, java.lang.Object defaultIfobFound)
row
- int row index.column
- int column index.ob
- Object which is found, is returned defaultIfobFound
.defaultIfobFound
- Object returned if value in (row, column) position is ob
.
public java.util.Vector getRow(int row) throws java.lang.ArrayIndexOutOfBoundsException
row
- row index wanted.
java.lang.ArrayIndexOutOfBoundsException
- index exceeded of this jTablepublic java.util.Vector getColumn(int column) throws java.lang.ArrayIndexOutOfBoundsException
column
- column index wanted.
java.lang.ArrayIndexOutOfBoundsException
- index exceeded of this jTablepublic int getRowSize()
public int getColumnSize()
public void setValue(int row, int column, java.lang.Object ob)
row
- row index.column
- column index.ob
- Object to be set.public void setDataVector(java.util.Vector data)
data
- Vector of vector to store database table query.public java.util.Vector getData()
public java.util.Vector getColumnNames()
public int getNamedColumnNumber(java.lang.String columnName)
this
table.
columnName
- Name to find in this
table.
columnName
public static int getNamedColumnNumber(java.lang.String columnName, java.util.Vector vec)
this
table.
columnName
- Name to find in this
table.vec
- Vector of columnNames of this object.
columnName
public int[] getIgnoredColumnsPdf()
public void printTable()
public void setTableVector(java.sql.Connection con, java.lang.String sql) throws java.sql.SQLException
this
object.
con
- Connection to the database.sql
- Sql command whose result is stored in this
object.
java.sql.SQLException
- SQL error setting table vector.public static jTable getTableVector(java.sql.Connection con, java.lang.String sql) throws java.sql.SQLException
con
- Connection ip_address:port to connect to database.sql
- SQL command to execute over connection con.
java.sql.SQLException
- SQL syntax error in statement.executeQuery(String sql);
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |