com.peter.user
Class DBUser

java.lang.Object
  |
  +--com.peter.db.DBAccess
        |
        +--com.peter.user.DBUser

public class DBUser
extends DBAccess

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

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

Constructor Summary
DBUser(DBConHandler handler)
          The constructor for this object
 
Method Summary
 int addUser(User user)
          Adds one User to the database.
 int deleteUser(User user)
          Deleting one object from the database.
 User[] getUserFromDBM(DBMatrix dbm)
          Returns an array of fetched User from the database.
 User[] getUsers()
          Fetch an array of User from the database.
 User[] getUsers(User user)
          Fetch an array of User from the database, with the same value as each variable in user has.
 int updateUser(User user)
          Update one object in the database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBUser

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

getUserFromDBM

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

addUser

public int addUser(User user)

Adds one User to the database.

Parameters:
user - A User
Returns:
An integer representing the result

deleteUser

public int deleteUser(User user)

Deleting one object from the database.

Parameters:
user - A User
Returns:
An integer representing the result

updateUser

public int updateUser(User user)

Update one object in the database.

Parameters:
user - A User
Returns:
An integer representing the result

getUsers

public User[] getUsers()

Fetch an array of User from the database.

Returns:
An array of User

getUsers

public User[] getUsers(User user)

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

Parameters:
user - A User
Returns:
An array of User