com.ds.fw.database
Class FwDataBase

java.lang.Object
  |
  +--com.ds.fw.types.FwSimpleObject
        |
        +--com.ds.fw.database.FwDataBase
All Implemented Interfaces:
java.lang.Cloneable, FwCopyableIF, FwDisplayableIF, FwSimpleObjectIF, java.io.Serializable

public class FwDataBase
extends FwSimpleObject

See Also:
Serialized Form

Field Summary
 java.lang.String databaseName
          The database name
 com.ds.fw.types.FwHashVector hDBData
           
 
Constructor Summary
FwDataBase()
          Constructor.Inizialize a new empty FwHashVector object.
 
Method Summary
 void clear()
          Clear the FwHashVector hDBData
 int execNonSelectQuery(java.lang.String SQL)
          Executes a non select query.
 com.ds.fw.beans.FwBaseBean getData(java.lang.String SQL)
          Executes a select query.
 com.ds.fw.types.FwHashVector getDBData()
          Gets the data
 int getNBTables()
          Gets the number of the tables .
 com.ds.fw.database.FwDBTable getTable(int i)
          Gets a table by given index
 com.ds.fw.database.FwDBTable getTable(java.lang.String key)
          Gets a table by given key
 java.lang.String getTField(java.lang.String field, java.lang.String table)
           
 void setDBData(com.ds.fw.types.FwHashVector h)
          Sets the data
 void setTable(com.ds.fw.database.FwDBTable data)
          Inserts a new table
 void setTable(java.lang.String key, com.ds.fw.database.FwDBTable data)
          Inserts a new table
 
Methods inherited from class com.ds.fw.types.FwSimpleObject
getClassName, getClone, getCopy, getCopy, getDeepCopy, getDisplayString, getDisplayStringFor, postCopy, printStackTrace, toString, toStringValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hDBData

public com.ds.fw.types.FwHashVector hDBData

databaseName

public java.lang.String databaseName
The database name

Constructor Detail

FwDataBase

public FwDataBase()
Constructor.Inizialize a new empty FwHashVector object.

Method Detail

getTable

public com.ds.fw.database.FwDBTable getTable(java.lang.String key)
Gets a table by given key

Parameters:
key - - the table key
Returns:
FwDBTable

getTable

public com.ds.fw.database.FwDBTable getTable(int i)
Gets a table by given index

Parameters:
i - - the table index
Returns:
FwDBTable

setTable

public void setTable(java.lang.String key,
                     com.ds.fw.database.FwDBTable data)
Inserts a new table

Parameters:
key - - the key for the table
data - - the data

setTable

public void setTable(com.ds.fw.database.FwDBTable data)
Inserts a new table

Parameters:
data - - the data

getDBData

public com.ds.fw.types.FwHashVector getDBData()
Gets the data

Returns:
FwHashVector , containing the database data

setDBData

public void setDBData(com.ds.fw.types.FwHashVector h)
Sets the data

Parameters:
h - - a FwHashVector , containing the new data

clear

public void clear()
Clear the FwHashVector hDBData


getNBTables

public int getNBTables()
Gets the number of the tables .

Returns:
the size of the hDBData

getData

public com.ds.fw.beans.FwBaseBean getData(java.lang.String SQL)
                                   throws java.sql.SQLException
Executes a select query. Calls method execSelectQuery from FwDBBean

Parameters:
SQL - - the sql query
Returns:
FwBaseBean object , containing the information null if there was some problem during the execution of the sql query
java.sql.SQLException
See Also:
FwDBBean.execSelectQuery(String)

execNonSelectQuery

public int execNonSelectQuery(java.lang.String SQL)
                       throws java.sql.SQLException
Executes a non select query. Calls method execNonSelectQuery from FwDBBean

Parameters:
SQL - - the query
Returns:
0 if there was a problem during the execution of the query (or it was successful, but no rows were updated) and the number of the updated rows otherwise
java.sql.SQLException
See Also:
FwDBBean.execNonSelectQuery(String)

getTField

public java.lang.String getTField(java.lang.String field,
                                  java.lang.String table)