|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object butler.sql.metadata.DatabaseBroker butler.sql.metadata.DefaultDatabaseBroker
public class DefaultDatabaseBroker
Default subclass of DatabaseBroker.
This subclass creates Database objects from a configuration
file.
The configuration file should be located in the current
working directory (user.dir) and have the name "databases.xml",
or the complete path could be given by the system property
butler.config.file.
If the system property catalina.home is set (means that butler
is used in a servlet engine environment), connection pooling
will be used. Otherwise, for swing clients, pooling will not
be used.
The format of the configuration file is described in the DTD
below.
Nested Class Summary | |
---|---|
static class |
DefaultDatabaseBroker.Factory
Factory for creating JNDI resources. |
Field Summary |
---|
Fields inherited from class butler.sql.metadata.DatabaseBroker |
---|
_driver, _schemaParser, _tm |
Constructor Summary | |
---|---|
DefaultDatabaseBroker()
|
Method Summary | |
---|---|
void |
completeRequest(boolean success)
Deprecated. Use DatabaseBroker.getInstance().getTransactionManager().commit() |
Database |
getDatabase(java.lang.String name)
Returns the database with the given alias. |
java.util.Iterator |
getDatabaseNames()
Returns an iteraton of all names of databases registered to this DatabaseBroker. |
java.util.Map |
getDatabases()
|
Schema |
getDefaultSchema()
Returns the default schema. |
java.lang.String |
getFile()
Returns the full path of the configuration file. |
java.lang.Object |
getRequestContext()
|
Schema |
getSchema(java.lang.String alias)
Returns the schema with the given alias. |
void |
initRequest()
Deprecated. Use DatabaseBroker.getInstance().getTransactionManager().begin() |
void |
setDriver(ButlerDriver driver)
|
void |
setFile(java.lang.String name)
Sets full path of the configuration file. |
void |
setPassword(java.lang.String pwd)
Sets the current user password. |
void |
setRequestContext(java.lang.Object requestContext)
|
void |
setUser(java.lang.String user)
Sets the current user name. |
Methods inherited from class butler.sql.metadata.DatabaseBroker |
---|
commit, getContext, getDB, getDriver, getInstance, getSchemaParser, getTable, getTransactionManager, getUserTransaction, registerChangedRecord, saveRecords, setInstance, setSchemaParser, unregisterChangedRecord |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDatabaseBroker()
Method Detail |
---|
public void setUser(java.lang.String user)
public void setPassword(java.lang.String pwd)
public void setFile(java.lang.String name) throws java.lang.Exception
java.lang.Exception
public java.lang.String getFile()
public java.util.Iterator getDatabaseNames() throws java.lang.Exception
getDatabaseNames
in class DatabaseBroker
java.lang.Exception
public java.util.Map getDatabases() throws java.lang.Exception
getDatabases
in class DatabaseBroker
java.lang.Exception
public Database getDatabase(java.lang.String name) throws java.lang.Exception
getDatabase
in class DatabaseBroker
java.lang.Exception
public Schema getSchema(java.lang.String alias) throws java.lang.Exception
getSchema
in class DatabaseBroker
java.lang.Exception
public Schema getDefaultSchema() throws java.lang.Exception
getDefaultSchema
in class DatabaseBroker
java.lang.Exception
public void setDriver(ButlerDriver driver)
public java.lang.Object getRequestContext() throws java.lang.Exception
java.lang.Exception
public void setRequestContext(java.lang.Object requestContext)
public void initRequest()
DatabaseBroker
initRequest
in class DatabaseBroker
public void completeRequest(boolean success) throws java.sql.SQLException
completeRequest
in class DatabaseBroker
success
- Tells if the request was
a success or ended with an exception.
java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |