com.peter.subject
Class DBSubject

java.lang.Object
  |
  +--com.peter.db.DBAccess
        |
        +--com.peter.subject.DBSubject

public class DBSubject
extends DBAccess

This class handles the queries to the Database. It is ment to be used for Subject.

Version:
$Revision: 1.0.2, 2003-11-04 $
Author:
Peter Larsson

Constructor Summary
DBSubject(DBConHandler handler)
          The constructor for this object
 
Method Summary
 int addSubject(Subject subject)
          Adds one Subject to the database.
 int deleteSubject(Subject subject)
          Deleting one Subject from the database.
 Subject[] getSubjectFromDBM(DBMatrix dbm)
          Returns an array of fetched Subject from the database.
 Subject[] getSubjects()
          Fetch an array of Subject from the database.
 Subject[] getSubjects(Subject subject)
          Fetch an array of Subject from the database, with the same value as each variable in subject has.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSubject

public DBSubject(DBConHandler handler)
The constructor for this object
Parameters:
handler - The handler to use for SQL-queries
Method Detail

getSubjectFromDBM

public Subject[] getSubjectFromDBM(DBMatrix dbm)
Returns an array of fetched Subject from the database.
Parameters:
dbm - The DBMatrix
Returns:
An array of Subject

addSubject

public int addSubject(Subject subject)

Adds one Subject to the database.

Parameters:
subject - A Subject
Returns:
An integer representing the result

deleteSubject

public int deleteSubject(Subject subject)

Deleting one Subject from the database.

Parameters:
subject - A Subject
Returns:
An integer representing the result

getSubjects

public Subject[] getSubjects()

Fetch an array of Subject from the database.

Returns:
An array of Subject

getSubjects

public Subject[] getSubjects(Subject subject)

Fetch an array of Subject from the database, with the same value as each variable in subject has.

Parameters:
subject - An Subject
Returns:
An array of Subject