base
Class SQLLocalAccess

java.lang.Object
  extended by base.SQLAccess
      extended by base.SQLLocalAccess

public class SQLLocalAccess
extends SQLAccess

This method inherits from SQLAccess and implements the functionalities for accessing the local SmallSQL database. For a description of the inherited method splease refer to the base class.


Field Summary
 
Fields inherited from class base.SQLAccess
CDTable, CDTracksTable, DVDTable, ScheduleTable, StationsTable, T_CDS, T_CDTRACKS, T_COUNT, T_DVDS, T_SCHEDULE, T_STATIONS, T_TEXT
 
Constructor Summary
SQLLocalAccess()
           
 
Method Summary
 void closeJDBC()
          Closes a JDBC connection to a database; after this method was called the database cant be accessed any longer.
 void doSQLOperation(String Cmd)
          This method sends a raw SQL statement to the database
 DefaultListModel doSQLQuery(int table, String Cmd)
          This method sends a raw SQL statement to the database and puts the results in a list of objects that belong to the type of the result
 boolean initJDBC()
          Establishes a new JDBC connection; this method has to be called after object creation and before the database is accessed.
 DefaultListModel loadStations()
          Fetch a full list of TV stations from the database
 void saveRecording(RecordInfo info, String uname, String pwd)
          This method deletes stores a new schedule for a recording within the database
 void saveStations(StationsList list, String uname, String pwd)
          This method deletes a possibly existing list of TV stations out of the database and stores the new one
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLLocalAccess

public SQLLocalAccess()
Method Detail

doSQLOperation

public void doSQLOperation(String Cmd)
This method sends a raw SQL statement to the database

Parameters:
Cmd - the SQL statement that has to be sent to the database

doSQLQuery

public DefaultListModel doSQLQuery(int table,
                                   String Cmd)
This method sends a raw SQL statement to the database and puts the results in a list of objects that belong to the type of the result

Parameters:
table - a constant T_xxx that specifies the table the results come from and - out of this information - selects the correct object type to put the resulting data into
Cmd - the raw SQL statement the data are requested with
Returns:
a list of objects containing the resulting data or null or an empty list if no data could be found

loadStations

public DefaultListModel loadStations()
Description copied from class: SQLAccess
Fetch a full list of TV stations from the database

Overrides:
loadStations in class SQLAccess
Returns:
the TV stations that have been stored within the database

saveStations

public void saveStations(StationsList list,
                         String uname,
                         String pwd)
Description copied from class: SQLAccess
This method deletes a possibly existing list of TV stations out of the database and stores the new one

Overrides:
saveStations in class SQLAccess
Parameters:
list - the new list of TV stations to be saved

saveRecording

public void saveRecording(RecordInfo info,
                          String uname,
                          String pwd)
Description copied from class: SQLAccess
This method deletes stores a new schedule for a recording within the database

Overrides:
saveRecording in class SQLAccess
Parameters:
info - the schedule information to be saved

initJDBC

public boolean initJDBC()
Description copied from class: SQLAccess
Establishes a new JDBC connection; this method has to be called after object creation and before the database is accessed.

Overrides:
initJDBC in class SQLAccess

closeJDBC

public void closeJDBC()
Description copied from class: SQLAccess
Closes a JDBC connection to a database; after this method was called the database cant be accessed any longer.

Overrides:
closeJDBC in class SQLAccess