|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--amber.server.manager.database.DatabaseConnection
This is a utility class which holds information on a database connection.
DatabaseManager| Constructor Summary | |
DatabaseConnection()
Default constructor. |
|
DatabaseConnection(java.sql.Connection connection,
boolean allocated)
Initialising constructor. |
|
| Method Summary | |
void |
close()
This function closes the connection. |
boolean |
equals(java.lang.Object other)
This function determines if the input object is the same as this object. |
java.sql.Connection |
getConnection()
Gets the connection in the object. |
boolean |
isAllocated()
Returns the allocated state of the connection. |
boolean |
isClosed()
This function checks to see if the internal connection is closed. |
void |
ping()
This function performs a spurious transaction against a database. |
void |
setAllocated(boolean state)
Defines whether the connection is in use. |
void |
setConnection(java.sql.Connection connection)
Sets the connection in the object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DatabaseConnection()
public DatabaseConnection(java.sql.Connection connection,
boolean allocated)
throws java.sql.SQLException
connection - Connection to the database.allocated - boolean true if the connection is already allocated.java.sql.SQLException - containing errors in getting the database meta data.| Method Detail |
public void setConnection(java.sql.Connection connection)
throws java.sql.SQLException
connection - Connection to the database.java.sql.SQLException - containing errors in getting the database meta data.public java.sql.Connection getConnection()
public void setAllocated(boolean state)
state - boolean flag the connection is allocated when true.public boolean isAllocated()
public void ping()
throws java.sql.SQLException
java.sql.SQLException - containing errors in performing ping.
public boolean isClosed()
throws java.sql.SQLException
java.sql.SQLException - containing errors in checking state.public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - Object to match against.
public void close()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the connection is allocated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||