agents.sql
Class SQLDatabase

java.lang.Object
  |
  +--agents.sql.SQLDatabase
All Implemented Interfaces:
SQL

public class SQLDatabase
extends java.lang.Object
implements SQL

Class for implementation of the methods for manipulating the databases.


Field Summary
static java.lang.String ASSIGNMENT_ACCESS
           
static java.lang.String MONITOR_ACCESS
           
static java.lang.String REPORT_ACCESS
           
static java.lang.String REVIEW_ACCESS
           
 
Fields inherited from interface agents.SQL
MS_23H59M59S
 
Constructor Summary
SQLDatabase()
          Method for creating a new instance of this class.
 
Method Summary
 void close()
          Method for closing connection with a database.
 void create(java.lang.String database)
          Method for creating a database.
 void drop(java.lang.String database)
          Method for deleting a database.
 java.sql.ResultSet executeQuery(java.lang.String query)
          Method for executing query in a connected database.
 int executeUpdate(java.lang.String query)
          Method for executing update in a connected database.
 java.lang.String getDirectory(java.lang.String username, java.lang.String dir, java.util.Date exp_date, java.lang.String directoryCourse, int classSelected)
          Method for getting the directory of the student or group for the FTP.
 java.lang.String getDirectory(java.lang.String username, java.lang.String accessType, int subType, java.util.Date exp_date, java.lang.String directoryCourse, int classSelected)
          Method for returning the access directory to the user.
 java.lang.String getEmail(java.lang.String username)
          Method for getting the email of the student in the database.
 java.lang.String[] getLogOptions(int classSelected)
          Method for getting the log options for the FTP.
 java.lang.String getPassword(java.lang.String username)
          Method for getting the password of the student in the database.
 java.lang.String getUserType(java.lang.String username)
          Method for getting the user type of the student in the database.
 void init(java.lang.String database)
          Method for connecting to one database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASSIGNMENT_ACCESS

public static final java.lang.String ASSIGNMENT_ACCESS

REVIEW_ACCESS

public static final java.lang.String REVIEW_ACCESS

REPORT_ACCESS

public static final java.lang.String REPORT_ACCESS

MONITOR_ACCESS

public static final java.lang.String MONITOR_ACCESS
Constructor Detail

SQLDatabase

public SQLDatabase()
            throws java.sql.SQLException,
                   java.lang.ClassNotFoundException
Method for creating a new instance of this class.
Method Detail

drop

public void drop(java.lang.String database)
          throws java.io.IOException
Method for deleting a database.
Specified by:
drop in interface SQL

create

public void create(java.lang.String database)
            throws java.io.IOException
Method for creating a database.
Specified by:
create in interface SQL

init

public void init(java.lang.String database)
          throws java.sql.SQLException
Method for connecting to one database.
Specified by:
init in interface SQL

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String query)
                                throws java.sql.SQLException
Method for executing query in a connected database.
Specified by:
executeQuery in interface SQL

executeUpdate

public int executeUpdate(java.lang.String query)
                  throws java.sql.SQLException
Method for executing update in a connected database.
Specified by:
executeUpdate in interface SQL

close

public void close()
           throws java.sql.SQLException
Method for closing connection with a database.
Specified by:
close in interface SQL

getPassword

public java.lang.String getPassword(java.lang.String username)
                             throws java.sql.SQLException
Method for getting the password of the student in the database.
Specified by:
getPassword in interface SQL

getEmail

public java.lang.String getEmail(java.lang.String username)
                          throws java.sql.SQLException
Method for getting the email of the student in the database.

getUserType

public java.lang.String getUserType(java.lang.String username)
                             throws java.sql.SQLException
Method for getting the user type of the student in the database.

getLogOptions

public java.lang.String[] getLogOptions(int classSelected)
                                 throws java.sql.SQLException
Method for getting the log options for the FTP. This method return a list of activities (assignment, reviews and reports).

getDirectory

public java.lang.String getDirectory(java.lang.String username,
                                     java.lang.String dir,
                                     java.util.Date exp_date,
                                     java.lang.String directoryCourse,
                                     int classSelected)
                              throws java.sql.SQLException
Method for getting the directory of the student or group for the FTP.
Specified by:
getDirectory in interface SQL

getDirectory

public java.lang.String getDirectory(java.lang.String username,
                                     java.lang.String accessType,
                                     int subType,
                                     java.util.Date exp_date,
                                     java.lang.String directoryCourse,
                                     int classSelected)
                              throws java.sql.SQLException
Method for returning the access directory to the user.