All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tc.database.UsernameAndPasswordQuery

java.lang.Object
   |
   +----tc.database.DatabaseQuery
           |
           +----tc.database.UsernameAndPasswordQuery

public class UsernameAndPasswordQuery
extends DatabaseQuery
UserNameAndPasswordQuery implements the abstract methods in DatabaseQuery so that calling them causes user name and password check.

Version:
0.30, 1998/04/01
Author:
FRED development team, Antti Viljamaa

Constructor Index

 o UsernameAndPasswordQuery(byte[])
Creates a new query.

Method Index

 o calculate(QueryDataSet)
Finalizes the query by checking the username/ password combination.
 o comparePasswords(byte[], byte[])
Compares two passwords and returns true if they match and false if they don't match.
 o getSQLClause()
Returns the SQL query for creating the needed dataset.
 o isWriteQuery()
Returns false.

Constructors

 o UsernameAndPasswordQuery
 public UsernameAndPasswordQuery(byte passwd[])
Creates a new query. Password is given as a parameter. (User name is asked from the database manager.)

Methods

 o calculate
 public void calculate(QueryDataSet dataset) throws DataSetException, ValidationException
Finalizes the query by checking the username/ password combination.

Overrides:
calculate in class DatabaseQuery
 o getSQLClause
 public String getSQLClause()
Returns the SQL query for creating the needed dataset.

Returns:
String A string representing the query.
Overrides:
getSQLClause in class DatabaseQuery
 o isWriteQuery
 public boolean isWriteQuery()
Returns false.

Returns:
false
Overrides:
isWriteQuery in class DatabaseQuery
 o comparePasswords
 private boolean comparePasswords(byte passwd1[],
                                  byte passwd2[])
Compares two passwords and returns true if they match and false if they don't match.

Parameters:
passwd1 - Password.
passwd2 - Password.
Returns:
true if the given passwords match, false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index