com.peter.topic
Class DBTopic

java.lang.Object
  |
  +--com.peter.db.DBAccess
        |
        +--com.peter.topic.DBTopic

public class DBTopic
extends DBAccess

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

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

Constructor Summary
DBTopic(DBConHandler handler)
          The constructor for this object
 
Method Summary
 int addTopic(Topic topic)
          Adds one Topic to the database.
 int deleteTopic(Topic topic)
          Deleting one object from the database.
 Topic[] getTopics()
          Fetch an array of Topics from the database.
 Topic[] getTopics(Topic topic)
          Fetch an array of Topics from the database, with the same value as each variable in Topics topic has.
 Topic[] getTopicsFromDBM(DBMatrix dbm)
          Returns an array of fetched Topics from the database.
 int updateTopic(Topic topic)
          Updates one Topic to the database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTopic

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

getTopicsFromDBM

public Topic[] getTopicsFromDBM(DBMatrix dbm)
Returns an array of fetched Topics from the database.
Parameters:
dbm - The DBMatrix
Returns:
An array of GuestBookImages

addTopic

public int addTopic(Topic topic)

Adds one Topic to the database.

Parameters:
topic - A Topic
Returns:
An integer representing the result

deleteTopic

public int deleteTopic(Topic topic)

Deleting one object from the database.

Parameters:
topic - A Topic
Returns:
An integer representing the result

updateTopic

public int updateTopic(Topic topic)

Updates one Topic to the database.

Parameters:
topic - A Topic
Returns:
An integer representing the result

getTopics

public Topic[] getTopics()

Fetch an array of Topics from the database.

Returns:
An array of Topics

getTopics

public Topic[] getTopics(Topic topic)

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

Parameters:
topic - A Topic
Returns:
An array of Topic