|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DatabaseConnection
This interface represents a connection to a database server, although in reality this is probably more than one connection (probably a pool of them). The main methods used to interact with the database server are:
beginTransaction will start an open transaction and keep a
dedicated connection for this until you either rollback or commit. Please
remember that if you don't properly rollback or commit, the underlying data
source may starve out of connections and become unusable.
createAutoExecutor will create an object that exposes methods for
sending SQL code to the database server, but will operate in auto commit
mode, and only allocates a connection from the underlying data source when
required. You can't starve the data source using auto executors, they can't
even be closed as they are stateless.
getCatalog will give you access to the meta data information on
the remote server. These objects loads data from the server as you use it
| Method Summary | |
|---|---|
DatabaseTransaction |
beginTransaction(TransactionIsolation isolation)
Allocated a connection and begins a transaction |
void |
close()
Closes this connection and any underlying data source |
AutoExecutor |
createAutoExecutor()
Creates an AutoExecutor using this database connection for supplying connections |
Catalog |
getCatalog(String catalogName)
Looks up one catalog on the server |
List<Catalog> |
getCatalogs()
|
String |
getDefaultCatalogName()
|
TransactionIsolation |
getDefaultTransactionIsolation()
|
DatabaseServerType |
getServerType()
|
| Method Detail |
|---|
DatabaseServerType getServerType()
DatabaseTransaction beginTransaction(TransactionIsolation isolation)
throws SQLException
isolation - Isolation level for the new transaction
SQLException - If an error occurred when allocating a connection
for this transactionAutoExecutor createAutoExecutor()
String getDefaultCatalogName()
TransactionIsolation getDefaultTransactionIsolation()
List<Catalog> getCatalogs()
throws SQLException
SQLException - If an error occurred when asking the database
for catalog information
Catalog getCatalog(String catalogName)
throws SQLException
catalogName - Name of the catalog
SQLException - If an error occurred when asking the database
for catalog informationvoid close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||