4 package eu
.etaxonomy
.cdm
.api
.service
;
6 import eu
.etaxonomy
.cdm
.database
.DatabaseTypeEnum
;
12 public interface IDatabaseService
extends IService
{
17 public DatabaseTypeEnum
getDatabaseEnum();
23 public String
getDriverClassName();
28 public String
getUrl();
33 public String
getUsername();
36 * Set the database connection to the local Hsqldb-database using
37 * the default parameters (defined in Spring-configuration).
38 * Make sure to close the application when exiting the programm,
39 * otherwise the hsql-server might still be running, if startet by cdmLibrary.
40 * @return true if a connection could be established
42 public boolean useLocalHsqldb();
45 * Set the database connection to the local Hsqldb-database using
46 * the given parameters. If a parameter is missing, the default parameter
47 * (defined in Spring-configuration) is taken.
48 * Make sure to close the application when exiting the programm,
49 * otherwise the hsql-server might still be running, if startet by cdmLibrary.
50 * All paramters are optional.
51 * @param path the path to the database files
52 * @param databaseName name of the used database
53 * @param silent if true, messages from the db server are send to stdout
54 * @param startServer if true, the dbserver is started if the url can't be reached by the dbDriver
55 * @return true if a connection could be established
58 public boolean useLocalHsqldb(String path
, String databaseName
, boolean silent
, boolean startServer
);
61 * Connect to the database with the given parameters
62 * @param databaseTypeEnum
69 public boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum
, String server
, String database
, String username
, String password
, int port
);
72 * Connect to the database with the given parameters. Uses default port.
73 * @param databaseTypeEnum
79 public boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum
, String server
, String database
, String username
, String password
);