|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbabase.ranker.Database
public class Database
Class dealing with everything related to the Database including creating and maintaing connections as well as common tasks associated with the ranking of individuals.
| Constructor Summary | |
|---|---|
Database(Controller c)
Creates a database object with a connection to the controller. |
|
| Method Summary | |
|---|---|
boolean |
checkConnection()
Returns the current connection status. |
void |
connect(java.lang.String user,
java.lang.String pass,
java.lang.String db)
Connects to a database using login credentials supplied to login manager. |
void |
createRankMatrix(Cage cage)
Retrieves all the necessary information from the database's actor_actees table in order to construct a rank matrix from the result set and produce a ranking matrix to be displayed in the ranker GUI from the dyadic agonistic interacitons that took place amongst them. |
void |
disconnect()
Disconnects from the database |
java.lang.String |
getDB()
Returns the database string |
java.sql.ResultSetMetaData |
getMetaData()
Returns the result set meta data of a given successful query. |
Ranking |
getRankings()
Get rankings for a given cage of individuals from the ranks table in the database. |
java.lang.String |
getRankQuery(java.lang.String rnktype)
Get the correct query for a given ranktype specified in the chooser. |
java.sql.ResultSet |
getResultSet()
Returns the result set of a given successful query. |
void |
query(java.lang.String q)
Querys the database with a given query q. |
void |
queryNoResults(java.lang.String q)
Querys the database without giving any results. |
java.lang.String |
quote(java.lang.String original)
Puts single quotes around a string. |
boolean |
rankingExists()
Checks to see whether a current ranking exists for the chosen group, date, and ranktype specified in the chooser. |
void |
setCage(Cage c)
Changes the cage associated with this database. |
void |
update(java.lang.String q)
Updates the database with a given update. |
void |
writeRanking()
Writes a ranking to the database's ranks rable using the ranking information contained within the Cage object deleting a current ranking if it exists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Database(Controller c)
c - | Method Detail |
|---|
public void setCage(Cage c)
c - a Cage
public void connect(java.lang.String user,
java.lang.String pass,
java.lang.String db)
throws java.sql.SQLException
user - a usernamepass - a passworddb - a database
java.sql.SQLException - if it cannot connectpublic java.lang.String getDB()
public void disconnect()
throws java.sql.SQLException
java.sql.SQLException - if it cannot disconnectpublic boolean checkConnection()
public void query(java.lang.String q)
throws java.sql.SQLException
q - a query
java.sql.SQLException
public void queryNoResults(java.lang.String q)
throws java.sql.SQLException
q - a query
java.sql.SQLException
public void update(java.lang.String q)
throws java.sql.SQLException
q - is a update to be performed
java.sql.SQLExceptionpublic java.sql.ResultSet getResultSet()
public java.sql.ResultSetMetaData getMetaData()
public java.lang.String getRankQuery(java.lang.String rnktype)
throws java.sql.SQLException
rnktype - a rank type
java.sql.SQLExceptionpublic void writeRanking()
public Ranking getRankings()
throws java.sql.SQLException
java.sql.SQLException
public boolean rankingExists()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String quote(java.lang.String original)
original - a string without quotes
public void createRankMatrix(Cage cage)
throws java.sql.SQLException
cage - a Cage
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||