|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.examples.jdbcdatasource.DefaultHelloDBService
This example application creates a conmponent which makes use of a JdbcDataSource to connect to a Hypersonic SQL database. It then adds a row to a table that it creates displaying a list of all the rows in the table. Note, this code ignores exceptions to keep the code simple.
| Field Summary |
| Fields inherited from interface org.apache.avalon.examples.jdbcdatasource.HelloDBService |
ROLE |
| Constructor Summary | |
DefaultHelloDBService()
Instantiate a DefaultHelloDBService |
|
| Method Summary | |
void |
addRow(java.lang.String title)
Adds a single row to the database. |
void |
configure(Configuration configuration)
Called by the Container to configure the component. |
void |
deleteRows()
Ask the component to delete all rows in the database. |
void |
dispose()
Called by the Container to dispose the component. |
void |
initialize()
Called by the Container to initialize the component. |
void |
logRows()
Ask the component to log all of the rows in the database to the logger with the info log level. |
void |
service(ServiceManager manager)
Called by the Container to tell the component which ComponentManager is controlling it. |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultHelloDBService()
| Method Detail |
public void addRow(java.lang.String title)
addRow in interface HelloDBServicetitle - The row titlepublic void deleteRows()
deleteRows in interface HelloDBServicepublic void logRows()
logRows in interface HelloDBService
public void service(ServiceManager manager)
throws ServiceException
service in interface Serviceablemanager - which curently owns the component.
ServiceException - if an error occurs
public void configure(Configuration configuration)
throws ConfigurationException
configure in interface Configurableconfiguration - configuration info used to setup the component.
ConfigurationException - if there are any problems with the configuration.
public void initialize()
throws java.lang.Exception
initialize in interface Initializablejava.lang.Exception - if there were any problems durring initialization.public void dispose()
dispose in interface Disposable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||