|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.liquidsite.util.db.DatabaseConnection
A database connection. This class encapsulates a JDBC database connection and holds some additional information needed by the connection pool. When the database connection is no longer needed, it MUST be returned to the database connector so that the used resources can be reused or freed.
DatabaseConnector| Method Summary | |
void |
close()
Closes the connection. |
DatabaseResults |
execute(DatabaseQuery query)
Executes a database query or statement. |
void |
execute(java.io.File file)
Executes a set of SQL statements from a file. |
java.lang.String |
getCatalog()
Returns the current connection catalog. |
int |
getQueryTimeout()
Returns the query execution timeout. |
boolean |
isExpired()
Checks if this connection has expired. |
boolean |
isValid()
Checks if the connection is valid. |
void |
reset()
Resets the database connection to default values. |
void |
setCatalog(java.lang.String catalog)
Sets the current connection catalog. |
void |
setQueryTimeout(int timeout)
Sets the query execution timeout. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public boolean isValid()
public boolean isExpired()
public int getQueryTimeout()
setQueryTimeout(int),
DatabaseConnector.DEFAULT_QUERY_TIMEOUTpublic void setQueryTimeout(int timeout)
timeout - the query execution timeout in seconds, or
a negative value for unlimitedgetQueryTimeout()
public java.lang.String getCatalog()
throws DatabaseConnectionException
DatabaseConnectionException - if the database connection
couldn't be reestablished
public void setCatalog(java.lang.String catalog)
throws DatabaseConnectionException,
DatabaseException
catalog - the new connection catalog
DatabaseConnectionException - if the database connection
couldn't be reestablished
DatabaseException - if the database catalog didn't exist
public void reset()
throws DatabaseConnectionException
DatabaseConnectionException - if the database connection
couldn't be reestablished
public DatabaseResults execute(DatabaseQuery query)
throws DatabaseException
query - the database query
DatabaseException - if the query or statement couldn't
be executed correctly
public void execute(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException,
DatabaseException
file - the file with SQL statements
java.io.FileNotFoundException - if the file couldn't be found
java.io.IOException - if the file couldn't be read properly
DatabaseException - if some statement couldn't be
executed correctlypublic void close()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||