eu.etaxonomy.cdm.api.service
Interface IDatabaseService

All Known Implementing Classes:
DatabaseServiceHibernateImpl

public interface IDatabaseService

Author:
a.mueller

Method Summary
 boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum, String server, String database, String username, String password)
          Connect to the database with the given parameters.
 boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum, String server, String database, String username, String password, int port, String filePath, H2Mode mode, NomenclaturalCode code)
          Connect to the database with the given parameters
 boolean connectToDatasource(CdmPersistentDataSource dataSource)
          Connect to the database with the given parameters.
 String getUrl()
          Returns the database URL
 String getUsername()
          Returns the username.
 CdmPersistentDataSource saveDataSource(String strDataSourceName, ICdmDataSource dataSource)
          Saves a new ICdmDatasource into the datasource config file.
 void setApplicationController(CdmApplicationController cdmApplicationController)
           
 CdmPersistentDataSource updateDataSource(String strDataSourceName, CdmPersistentDataSource dataSource)
          Update an already saved datasource in datasource config file
 

Method Detail

getUrl

String getUrl()
Returns the database URL

Returns:

getUsername

String getUsername()
Returns the username.

Returns:

connectToDatabase

boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum,
                          String server,
                          String database,
                          String username,
                          String password,
                          int port,
                          String filePath,
                          H2Mode mode,
                          NomenclaturalCode code)
                          throws TermNotFoundException
Connect to the database with the given parameters

Parameters:
databaseTypeEnum -
url -
username -
password -
port -
Returns:
returns true if successful
Throws:
TermNotFoundException

connectToDatabase

boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum,
                          String server,
                          String database,
                          String username,
                          String password)
                          throws TermNotFoundException
Connect to the database with the given parameters. Uses default port.

Parameters:
databaseTypeEnum -
url -
username -
password -
Returns:
returns true if successful
Throws:
TermNotFoundException

connectToDatasource

boolean connectToDatasource(CdmPersistentDataSource dataSource)
                            throws TermNotFoundException
Connect to the database with the given parameters. Uses default port.

Parameters:
dataSource -
Returns:
returns true if successful
Throws:
TermNotFoundException

saveDataSource

CdmPersistentDataSource saveDataSource(String strDataSourceName,
                                       ICdmDataSource dataSource)
Saves a new ICdmDatasource into the datasource config file.

Parameters:
strDataSourceName -
dataSource -
code -
Returns:

updateDataSource

CdmPersistentDataSource updateDataSource(String strDataSourceName,
                                         CdmPersistentDataSource dataSource)
                                         throws DataSourceNotFoundException
Update an already saved datasource in datasource config file

Parameters:
strDataSourceName - the beanId under which the dataSource should be saved
dataSource - the dataSource to be saved
Returns:
the CdmDataSource, null if not successful
Throws:
DataSourceNotFoundException

setApplicationController

void setApplicationController(CdmApplicationController cdmApplicationController)


Copyright © 2007-2013 EDIT. All Rights Reserved.